Notifications
Clear all

[Closed] Skin Mod Bones to CAT

Hi All,

I’m trying to write a script that will transfer the skin weights from a “bones” rigged character to an aligned CAT rig and I’m hitting a dead end. From what I can tell I need to have the new CAT bone in the vertex_bone_array of the vertex before I can actually set the weights using skinOps.[b][b]SetVertexWeights. However I can’t find a way to add the bone to the array in Maxscript. Am I missing something here. Is this even possible in Maxscript?

Thanks,
Rod
[/b][/b]

4 Replies

I think the easiest way to do that would be to save the skin to an env file and load it to a new skin modifier with all the CAT bones in it. you can rename the CAT bones to fit the exact name of the original bones.

skinops.setvertexweights works well. If the bone was not affecting the vertex, it will be added.

check this too: skinOps.ReplaceVertexWeights

TzMtN,

Trying to do this through Maxscript the Load Envelopes dialog comes up like normal but when applied the vertexes aren’t weighted correctly. The odd thing is that if you press the load button in the Advanced Parameters rollout and apply it from the same Load Envelopes dialog they are. Any answer for this?

lutteral,

I guess I’m missing something here. The skinops.setvertexweights syntax is

[left][b][b]skinOps.[/b][/b][b][b]SetVertexWeights[/b][/b] <Skin>  <vertex_integer> \
[/left]
 [left](  <vertex_bone_integer> | <vertex_bone_array> ) \
[/left]
 [left](  <weight_float> | <weight_array> )
[/left]

the vertex_bone_array is basically an array of the bones from the skin modifiers bone list that affect that vertex.

for example [b]vertex1[/b]_bone_array = #(1,7,8) where bones 1,7,8 are the boneID's in the skin modifier bone list.  So vertex_bone_integer of 2 is actually boneID 7.  So if you wanted to add weights to say boneID 4 you can't because there is no corresponding index into the [b]vertex1[/b]_bone_array.  

Is this not correct?  Can you get access to the vertices's vertex_bone_array?  If so how?

Thanks guys,
Rod

lutteral,

Hey looks like you were right it does add the bones. Nice if the docs indicated that. Also be nice if you could just access that vertex_bone_array directly and change the bones there. Maybe you can but I still haven’t found a way.

Thanks again,
Rod