Skip to content

[VRMC_springBone_limit] fix editor ui - #2834

Open
ousttrue wants to merge 1 commit into
vrm-c:masterfrom
ousttrue:fix/spring_limit_ui
Open

[VRMC_springBone_limit] fix editor ui#2834
ousttrue wants to merge 1 commit into
vrm-c:masterfrom
ousttrue:fix/spring_limit_ui

Conversation

@ousttrue

@ousttrue ousttrue commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

fixed #2831

Add joints でLimit設定をコピーするか、コピーしないことをUI上で明示する

は、良くわからなかったので特に作業していません。

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the VRM 1.0 SpringBone AngleLimit inspector UX to better reflect the current draft spec and reduce user confusion around limit settings (per issue #2831).

Changes:

  • Update the AngleLimit foldout label and remove outdated “import/export not implemented” messaging.
  • Clarify Cone/Hinge limit UI by labeling m_pitch as “Angle”, and add a warning for end-of-chain (last tail) joints.
  • Add constructor parameter documentation notes for AngleLimit fields in BlittableJointMutable.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
Packages/VRM10/Editor/Components/SpringBone/VRM10SpringBoneJointEditor.cs Adjusts AngleLimit inspector labeling/warnings and removes outdated HelpBox text.
Packages/UniGLTF/Runtime/SpringBoneJobs/Blittables/BlittableJointMutable.cs Adds documentation notes clarifying AngleLimit parameter meaning.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +101 to +104
if (isLastTail)
{
case UniGLTF.SpringBoneJobs.AnglelimitTypes.None:
break;

case UniGLTF.SpringBoneJobs.AnglelimitTypes.Cone:
EditorGUILayout.PropertyField(m_angleLimitRotation);
EditorGUILayout.PropertyField(m_angleLimitPitch);
break;

case UniGLTF.SpringBoneJobs.AnglelimitTypes.Hinge:
EditorGUILayout.PropertyField(m_angleLimitRotation);
EditorGUILayout.PropertyField(m_angleLimitPitch);
break;

case UniGLTF.SpringBoneJobs.AnglelimitTypes.Spherical:
EditorGUILayout.PropertyField(m_angleLimitRotation);
EditorGUILayout.PropertyField(m_angleLimitPitch);
EditorGUILayout.PropertyField(m_angleLimitYaw);
break;
EditorGUILayout.HelpBox("末端ノードでは無効です。", MessageType.Warning);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAY: "末端ノードではAngleLimitは無視されます。" と明確に書いてあげたほうが親切かも。また、設定をコピーして回るときに毎回Noneに変えるのも面倒なので、WarningでなくInfoで良いかも。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MUST: isLastTailtrue のときにTypeを変更するUIが表示されなくなるのはCopilotの指摘通り。これは修正するべきです。

Comment on lines +41 to +42
/// <param name="angleLimit1">pitch when Spherical</param>
/// <param name="angleLimit2">yaw when Spherical</param>
if (m_showAnglelimitSettings)
{
EditorGUILayout.HelpBox("SpringBoneの角度制限はまだdraft仕様です。将来的に仕様が変更される可能性があります。また、VRMファイルへのインポート・エクスポート機能はまだ実装されていません。\nThe angle limit feature for SpringBone is still in draft status. The specifications may change in the future. Also, the import/export of VRM files has not yet been implemented.", MessageType.Warning);
EditorGUILayout.HelpBox("SpringBoneの角度制限はまだdraft仕様です。将来的に仕様が変更される可能性があります。\nThe angle limit feature for SpringBone is still in draft status. The specifications may change in the future.", MessageType.Warning);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

#2834 (comment) と同一の指摘です。

@0b5vr

0b5vr commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Add joints でLimit設定をコピーするか、コピーしないことをUI上で明示する

は、良くわからなかったので特に作業していません。

Add jointsについて、これは VRM10SpringBoneJoint のコンテキストメニューより実行できる "Add joints" について、これがSpringBoneのstiffness, dragForce等の設定はコピーするが、limitの情報はコピーしないという指摘です。言葉足らずですいません 🙇

void AddJointRecursive(Transform t, VRM10SpringBoneJoint src)
{
var joint = t.gameObject.GetOrAddComponent<VRM10SpringBoneJoint>();
// copy settings
joint.m_stiffnessForce = src.m_stiffnessForce;
joint.m_gravityPower = src.m_gravityPower;
joint.m_gravityDir = src.m_gravityDir;
joint.m_dragForce = src.m_dragForce;
joint.m_jointRadius = src.m_jointRadius;
if (t.childCount > 0)
{
// only first child
AddJointRecursive(t.GetChild(0), src);
}
}
void GetJoints(Transform t, List<VRM10SpringBoneJoint> joints)
{
if (t.TryGetComponent<VRM10SpringBoneJoint>(out var joint))
{
joints.Add(joint);
}
if (t.childCount > 0)
{
GetJoints(t.GetChild(0), joints);
}
}
[ContextMenu("Add joints")]
private void AddJointsToChild0()
{
var root = GetComponentInParent<Vrm10Instance>();
if (root == null)
{
UniGLTFLogger.Warning("not Vrm10Instance");
return;
}
if (transform.childCount == 0)
{
UniGLTFLogger.Warning("no children");
return;
}
AddJointRecursive(transform.GetChild(0), this);
// updater root
foreach (var spring in root.SpringBone.Springs)
{
for (int i = 0; i < spring.Joints.Count; ++i)
{
if (spring.Joints[i] == this)
{
// found
while (spring.Joints.Count - 1 > i)
{
// remove after this joint
spring.Joints.RemoveAt(spring.Joints.Count - 1);
}
// get descendants joints
var joints = new List<VRM10SpringBoneJoint>();
GetJoints(transform.GetChild(0), joints);
// add jonits to after this
spring.Joints.AddRange(joints);
return;
}
}
}
UniGLTFLogger.Warning($"{this} is found in {root}");

@0b5vr 0b5vr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

兼ねCopilotの指摘に同意します。詳細は各コメントを参照ください。

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.

[VRMC_springBone_limit] Editor: AngleLimit UX and final Joint behavior

3 participants