Skip to content
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

Merged
merged 2 commits into from
May 31, 2022
Merged

Conversation

ousttrue
Copy link
Contributor

@ousttrue ousttrue requested a review from Santarh May 30, 2022 13:16
@ousttrue ousttrue added this to the v0.99 milestone May 30, 2022
Copy link
Contributor

@Santarh Santarh left a 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;
Copy link
Contributor

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;
Copy link
Contributor

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,
Copy link
Contributor

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;
Copy link
Contributor

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];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

center が存在すれば、設定する

@ousttrue ousttrue merged commit bcbd4b9 into vrm-c:master May 31, 2022
@ousttrue ousttrue deleted the fix10/springbone_center branch January 24, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants