How to delete a joint and move any weights to the parent
3815 13 2-
- mrpdean
- Member
- 80 posts
- Joined: 4月 2019
- オフライン
I have a KineFx character with many facial bones on the skeleton. The character was imported from another application.
I'm trying to work out how I can delete these facial bones and move all of the skin weights from the deleted joints to the "head" joint, so that those parts of the skin continue to follow the head when the skeleton is animated.
So far I've been neck deep in vex code trying to figure out how to do this but have had no success yet.
Does anyone know how this might be done?
Is there a simpler way that I'm completely missing?
Thanks
I'm trying to work out how I can delete these facial bones and move all of the skin weights from the deleted joints to the "head" joint, so that those parts of the skin continue to follow the head when the skeleton is animated.
So far I've been neck deep in vex code trying to figure out how to do this but have had no success yet.
Does anyone know how this might be done?
Is there a simpler way that I'm completely missing?
Thanks
Edited by mrpdean - 2023年6月6日 03:57:21
-
- danfitz82
- Member
- 52 posts
- Joined: 1月 2017
- オフライン
You need a "Capture Attribute Unpack" to access the weights in vex, then tweak your weights, and finally use "Capture Attribute Pack" to set the weights back to be usable for deformations.
After unpacking the capture attributes you'll have
In this case you just need the integer array to figure out if the weight belongs to a joint you're deleting, and replace that index with the joint you'd like to replace with.
I've attached an example, I've just used a string test to see if it's a joint to replace, but you could set a point group on your joints and refer to that in the second input of the wrangle.
This could be tidier - it doesn't check if there's more than one weight entry for each joint after replacing.
After unpacking the capture attributes you'll have
- a detail attribute array of joint names
- two arrays on each point - an integer array of indices you can use to refer back to the detail joint names array, and a matching weights array
In this case you just need the integer array to figure out if the weight belongs to a joint you're deleting, and replace that index with the joint you'd like to replace with.
I've attached an example, I've just used a string test to see if it's a joint to replace, but you could set a point group on your joints and refer to that in the second input of the wrangle.
This could be tidier - it doesn't check if there's more than one weight entry for each joint after replacing.
-
- Jonathan de Blok
- Member
- 293 posts
- Joined: 7月 2013
- オフライン
Guessing you fbx'ed a metaHuman into Houdini 
Anyways, I got a nice HDA that does exactly this, attached it to this post. The 'final joint' parm will be the joint that has it's children removed and their weights transferred to the final joint.
And you can specify additional joints to remove, their weights will be transferred to the final joint as well.
In the screen shot you see the original skeleton (red),the new one (green) and the deformed mesh using the reduced skeleton.


Anyways, I got a nice HDA that does exactly this, attached it to this post. The 'final joint' parm will be the joint that has it's children removed and their weights transferred to the final joint.
And you can specify additional joints to remove, their weights will be transferred to the final joint as well.
In the screen shot you see the original skeleton (red),the new one (green) and the deformed mesh using the reduced skeleton.
Edited by Jonathan de Blok - 2023年6月6日 16:10:01
More code, less clicks.
-
- mrpdean
- Member
- 80 posts
- Joined: 4月 2019
- オフライン
-
- mrpdean
- Member
- 80 posts
- Joined: 4月 2019
- オフライン
Hi Jonathan, your HDA is almost working perfectly for me but for some reason, seemingly random points are failing to get their weights transferred.

Do you know why this might be happing.
If I select just the "final joint" every joint except the final joint gets deleted.
I'll keep digging through the HDA to see if I can work it out myself.
Thanks!
Do you know why this might be happing.
If I select just the "final joint" every joint except the final joint gets deleted.
I'll keep digging through the HDA to see if I can work it out myself.
Thanks!
Edited by mrpdean - 2023年6月7日 06:43:05
-
- Jonathan de Blok
- Member
- 293 posts
- Joined: 7月 2013
- オフライン
mrpdean
Hi Jonathan, your HDA is almost working perfectly for me but for some reason, seemingly random points are failing to get their weights transferred.Image Not Found
Do you know why this might be happing.
If I select just the "final joint" every joint except the final joint gets deleted.
I'll keep digging through the HDA to see if I can work it out myself.
Thanks!
Ahh can you send me the exported daz character? The HDA is part of a toolkit I'm developing and like to squash any bugs that didn't show up in my testing set.
(hence the 'kpat' in the HDA name, it stands for 'KineFX Procedural Toolkit' )
Edited by Jonathan de Blok - 2023年6月7日 08:39:42
More code, less clicks.
-
- mrpdean
- Member
- 80 posts
- Joined: 4月 2019
- オフライン
-
- Jonathan de Blok
- Member
- 293 posts
- Joined: 7月 2013
- オフライン
-
- mrpdean
- Member
- 80 posts
- Joined: 4月 2019
- オフライン
-
- Jonathan de Blok
- Member
- 293 posts
- Joined: 7月 2013
- オフライン
mrpdean
Thank you so much Jonathan.
Can confirm it's working perfectly now
Is there anywhere I can follow your work on the KineFX Procedural Toolkit?
There is definitely a need for KineFx tools like this one.
Thanks again.
Great, no problem! About KPAT, I'll make sure to post here when it's released, have to make few video tutorials so it all makes sense to other people besides me as well
More code, less clicks.
-
- mrpdean
- Member
- 80 posts
- Joined: 4月 2019
- オフライン
Hi Jonathan,
I thought I'd mention this because you said that you wanted to squash any possible bugs with the KineFX Procedural Toolkit.
When I delete the finger joints on my character, I'm getting some unusual results.
I don't know if this is a "bug" or if it's just the nature of deleting joints and shifting all the weights to the parent, in this example the final joint was "@name=hand_r"

It looks odd to me that there is a sharp difference between the weights of a few vertices, for example as you can see on the top of the wrist.
Thanks
I thought I'd mention this because you said that you wanted to squash any possible bugs with the KineFX Procedural Toolkit.
When I delete the finger joints on my character, I'm getting some unusual results.
I don't know if this is a "bug" or if it's just the nature of deleting joints and shifting all the weights to the parent, in this example the final joint was "@name=hand_r"
It looks odd to me that there is a sharp difference between the weights of a few vertices, for example as you can see on the top of the wrist.
Thanks
Edited by mrpdean - 2023年7月19日 03:45:38
-
- mrpdean
- Member
- 80 posts
- Joined: 4月 2019
- オフライン
-
- mrpdean
- Member
- 80 posts
- Joined: 4月 2019
- オフライン
Okay, I think I've been able to fix it by changing this
to this
//new root already weighted, add weights of removed joints f[]@boneCapture_data[int(headindex)]=w;
to this
//new root already weighted, add weights of removed joints f[]@boneCapture_data[int(headindex)]+=w;
Edited by mrpdean - 2023年7月19日 08:01:33
-
- noc2
- Member
- 24 posts
- Joined: 5月 2016
- オフライン
It is interesting to see that there are no low-level node to deal with such an issue in Houdini while there are low-level nodes to remedy or deal with many contingencies that can otherwise be handled with many lines of Vex code. I would submit an RFE toward such an end but I really doubt that it would even be considered...
-
- Quick Links



