-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.0] SpringBone.center 復活 #1664
Conversation
….Center. Update exporter and importer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
よさそう。
@@ -38,9 +38,6 @@ public enum UpdateTypes | |||
[SerializeField, Header("Runtime")] | |||
public UpdateTypes UpdateType = UpdateTypes.LateUpdate; | |||
|
|||
[SerializeField] | |||
public Transform SpringBoneCenter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
システムからモデルに1つ与えるものは要らない
@@ -33,6 +33,9 @@ public class Spring | |||
[SerializeField] | |||
public List<VRM10SpringBoneJoint> Joints = new List<VRM10SpringBoneJoint>(); | |||
|
|||
[SerializeField] | |||
public Transform Center; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spring に情報を持つ
@@ -72,7 +72,7 @@ private FastSpringBoneBuffer CreateFastSpringBoneBuffer(Vrm10InstanceSpringBone | |||
return new FastSpringBoneBuffer( | |||
springBone.Springs.Select(spring => new FastSpringBoneSpring | |||
{ | |||
center = m_target.SpringBoneCenter, | |||
center = spring.Center, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FastSpringBone
の実装は Spring ごとに Center が違うことを想定しているかな?
してそうだけど、要確認
var center = model.Nodes.IndexOf(converter.Nodes[x.Center.gameObject]); | ||
if (center != -1) | ||
{ | ||
spring.Center = center; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Center
が設定されていれば、ノード番号を得て Export する
@@ -595,6 +595,11 @@ async Task LoadSpringBoneAsync(IAwaitCaller awaitCaller, Vrm10Instance controlle | |||
var spring = new Vrm10InstanceSpringBone.Spring(gltfSpring.Name); | |||
controller.SpringBone.Springs.Add(spring); | |||
|
|||
if (gltfSpring.Center.HasValue) | |||
{ | |||
spring.Center = Nodes[gltfSpring.Center.Value]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
center
が存在すれば、設定する
vrm-c/vrm-specification#374