PDA

View Full Version : Saving SkinWrap vertex data?


IkerCLoN
04-15-2009, 01:46 PM
Hi, folks! I'm working right now in the characters for our next film. Although we're switching to XSI, I still need to do some work with MAX. I have very tight deadlines, so I'm thinking new ways to accelerate my work while doing it. The other day, an animator did something that seemed to work quite right: he skin-wraped the mesh of a character to it's proxy-bones (bones with the volume of the sliced geometry), and the deformations on that mesh were quite good. I'm trying the same thing with another character and the methodology seems to work here also. So although I work pretty fast when skinning, this thing can be a time-saver when doing characters.

So, what's the problem? As you may notice, some weights need to be tweaked. In addition, I do want to convert that Skin Wrap to a Skin modifier for tweaking those weights, and because the scene would be not as heavy. But if the objects that drive the Skin Wrap have no Skin modifiers on them, the modifier cannot be converted.

Looking for a workaround, I found a function called 'OutputVertexData', that returns something like this:

-- execute this (120 is a random vertex index, just for showing)

$.modifiers[#Skin_Wrap].outputVertexData $ 120

-- listener prints this

Vertex 119
Number of weights 14
Weight 0.014151 Owner C_esbirro_Bone_LMM_Arm-Clavicle_BA
Weight 0.013723 Owner C_esbirro_Bone_LMM_Arm-Bend2_BA
Weight 0.000140 Owner C_esbirro_Bone_RMM_Arm-Bend3_BA
Weight 0.122346 Owner NULL
Weight 0.092635 Owner NULL
Weight 0.094604 Owner NULL
Weight 0.112520 Owner NULL
Weight 0.064497 Owner NULL
Weight 0.108302 Owner NULL
Weight 0.003063 Owner NULL
Weight 0.082769 Owner NULL
Weight 0.076085 Owner NULL
Weight 0.110882 Owner NULL
Weight 0.104285 Owner NULL
OK

... and I need all the bones affecting that vertex to work on a tool for copying those weights to an envASCII format.

I did not found anything related to this, just a forum from Poland (max3d.pl) where a guy asked the very same.

Any help? Thanks!!!

PEN
04-15-2009, 03:47 PM
Well you are going to have to write a script to read in this data and build the weight table in a skin modifier. Make sure when you are doing this that you turn off normalize weights and then turn it back on when you are done.

Can I ask why you are moving to XSI for this film?

PEN
04-15-2009, 03:48 PM
I should also mention that if you need me to do this for you just contact me using the email on my site.

IkerCLoN
04-15-2009, 05:00 PM
Hey, Paul, thanks for offering your services :-) But the problem is not on the tool itself, or on how to translate this data onto vertex weight table, but why that SkinWrap command does return NULL instead of the name of some bones. If it returned the name of all bones, I would have all the information that I need for building the data, as you told me. Sorry if my previous message did not look clear at all.

And the reason why we're moving to XSI... well, after one movie and several shortfilms the studio made that decission based on the fact that using MAX for a feature-film movie was a pain in the ass :-D There seems to be a lot of incompatibilities and issues when dealing with an entire production made under MAX. After comparing Maya and XSI, and considering we are not a big studio (around 50 people, and growing), it looks like XSI is best suited for our needs.

Personally, I've worked in two movies and in two shortfilms done entirely with MAX, and I needed some 'fresh air' ;)

IkerCLoN
04-16-2009, 09:12 AM
OK, since it seems the command is not returning what one might expect, I went to another way, so I could finally convert my skinWrap into a skin modifier. Thanks to César for pointing that out! I'll leave here the chunky-method so maybe some of you find it useful.

Normally, your rig will have two 'layers' as minimum: the mesh and the bones with the sliced geometry. Usually, one might attach that geometry to the bone. But doing this makes the system I told in the first post not to work.

What I did was skin each slice to its corresponding bone (all vertex are 1.0 to that bone, then). Then I skin-wrapped the mesh to those slices. And when clicking on 'Convert to Skin'... voilà! Because the objects (slices) that are deforming the mesh have their own skin modifier, and no warning appears when converting. You'll obtain a quite nice behaviour for the skin. Then tweak as needed.

It might look like a poor method, but if I need to focus on other things in a character, I can save sometime doing this. And works like a charm :-D

PEN
04-16-2009, 12:34 PM
That doesn't sound that clunky, looks like it will work well.

CGTalk Moderation
04-16-2009, 12:34 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.