feat: Implement Stickman Factory and Test Harness for runtime rigging
- Added StickmanFactory to load and instantiate .stk files into master_rig.tscn. - Created a Test Harness scene for debugging bone scales, vector drawing offsets, and IK limits. - Updated stk_rig_adapter to fit head bone and mount head shapes as full geometry. - Enhanced README and PROJECT documentation to reflect new features and usage. - Introduced UI elements for file selection and visual debugging in the Test Harness. - Refactored code to improve clarity and maintainability, including removal of unused functions.
This commit is contained in:
+33
@@ -341,6 +341,39 @@ Update Hand IK target default rests to match total arm length.
|
||||
|
||||
Replace default Line2D nodes under $Body/ or instantiate .stk vector shape nodes attached as children to their corresponding Bone2D / RemoteTransform2D paths.
|
||||
|
||||
## Stickman editor (Phase 9)
|
||||
|
||||
### Stickman factory
|
||||
We need to implement a static stickman factory that loads .stk files. (1.4)
|
||||
It should instantiate master_rig.tscn, resize all Bone2D bones dynamically according to the file's 'proportions', reposition IK targets, and mount custom vector objects(shapes) under $Body/
|
||||
|
||||
Proposed specs:
|
||||
Bone Adaptations:
|
||||
- Set $Skeleton2D/Torso/Head.position.y = -proportions.torso_length.
|
||||
- Set $Skeleton2D/Torso/LeftUpperArm.length = proportions.upper_arm_length.
|
||||
- Set $Skeleton2D/Torso/LeftUpperArm/LeftLowerArm.position.x = -proportions.upper_arm_length.
|
||||
- Set $Skeleton2D/Torso/RightUpperArm.length = proportions.upper_arm_length.
|
||||
- Set $Skeleton2D/Torso/RightUpperArm/RightLowerArm.position.x = proportions.upper_arm_length.
|
||||
- Set $Skeleton2D/Torso/LeftUpperLeg/LeftLowerLeg.position.y = proportions.upper_leg_length.
|
||||
- Set $Skeleton2D/Torso/RightUpperLeg/RightLowerLeg.position.y = proportions.upper_leg_length. IK Target Positions:Reposition $IK_Targets/Left_Hand and $IK_Targets/Right_Hand based on combined arm lengths.Reposition $IK_Targets/Left_Leg and $IK_Targets/Right_Leg to (upper_leg_length + lower_leg_length).Graphics Mount:
|
||||
- Clear default Line2D and script components on $Body/ subnodes.
|
||||
- For each body part, instantiate a drawing node that renders the .stk shape points offset by the part's "pivot" coordinate.
|
||||
|
||||
### Test harness scene
|
||||
We need a test harness that serves as a staging ground for debugging bone scales, vector drawing offsets, and IK limits in isolation.
|
||||
|
||||
#### What the Test Harness Should Include:
|
||||
- File Picker UI:
|
||||
A button opening a FileDialog (or quick-select buttons for test files like break_2.stk) to instantly spawn or swap characters at runtime.
|
||||
|
||||
- Visual Debug Overlay Toggles:
|
||||
Toggle Bone Visibility: Shows/hides Godot's Skeleton2D lines over the rendered .stk graphics so you can verify joint pivot alignment.
|
||||
|
||||
- Toggle IK Handles: Shows colored markers for hand and foot IK targets so you can click and drag them around.
|
||||
|
||||
- Interactive IK / Pose Dragging:
|
||||
Simple click-and-drag logic on the screen to pull hand/foot targets and watch the dynamic limb flexing in real time.
|
||||
|
||||
## Rules
|
||||
|
||||
1. Try to use standard Godot controls when applicable
|
||||
|
||||
Reference in New Issue
Block a user