Search - User list
Full Version: How to delete a joint and move any weights to the parent
Root » Technical Discussion » How to delete a joint and move any weights to the parent
mrpdean
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
danfitz82
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
  • 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
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.


mrpdean
Thank you very much both of you for answering.

I will look closely at both solutions to learn from them.

P.S. it's a Daz character, not a metahuman
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.



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!
Jonathan de Blok
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' )
mrpdean
Thanks Jonathan. I've sent you a PM.
Jonathan de Blok
mrpdean
Thanks Jonathan. I've sent you a PM.

Thx, fixed HDA attached! Setting the 'final joint' to '@name=head' results in this:

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.
Jonathan de Blok
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
mrpdean
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
mrpdean
It looks like there are still some edge-cases where verts are left with weights that don't add up to 1.

I'll try to debug it.
mrpdean
Okay, I think I've been able to fix it by changing 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;
noc2
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...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB