Help with reparenting bone to a different bone script
I am working on a script to change the Daz skeleton to match that of the Unreal Engine mannequin.
It's a request I have seen around the Daz forums and a personal scripting challenge I set for myself.
Even if the results aren't perfect its a goal and a project to learn more about Daz Studio scripting.
I have the bones I need renamed, relabeled, or removed. When bones are removed Daz Studio automatically reparents the remaining bones just fine.
What I'm stuck on is that in the Unreal Engine mannequin rig both the Shoulder Twist bone and the Forearm Bend bone are parented to the Shoulder Bend bone.
So I am trying to find a way to script reparenting the Forearm Bend to the Shoulder Bend bone
I have the script selecting the bone I need reparented, and using the triggerAction (DzJEReparentBoneAction) I do get the "Select an Item" pop up menu.
I am not sure how to script selecting a bone in that menu or how to "hit" Accept.
Maybe there is a easier way?
Below are the results with the script so far:
Comments
Can you not work with http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/node_dz#a_1ad98abb9f272a04d7c2895f24893b3120 and http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/node_dz#a_1a7b9c1d95bc8ef79f1b368a81d11950ab ? I must admit I've not tried this with bones in a skeleton
Thanks Richard,
It looks like a few of those might do the trick.
When I first read through them I didn't see anything specific for set.Parent or ReParent so I headed down a rabbit hole finding another way.
I will give them a try.
Wouldn't you know it... it was right at the top of the list - addNodeChild.
I thought that meant it was adding a bone and making it a child of the target bone, not just adding an existing bone as a child node.
Thanks again.