[Closed] Skin on multiple objects
Hi,
I am trying to make a script to help me with skinning;)
On a single object every thing works fine, i can select and modify vertices etc… no problem
But i can’t find a way to support correctly a skin modifier applyed on multiple objects…
Lets Say i have two planes :
$Plane01 : 4vertices
$Plane02 : 4vertices
And a single skin modifier applyed on these planes :
SkinMod = skin()
I was expecting that when i count the number of vertices with
skinops.GetNumberVertices SkinMod
i would get the result 4+4 =“8” but it returns “4”…
It seems to take only the first plane in account.
So when i try to select a vertice on the second plane :
skinops.selectvertices skinmod #(5)
As expected i get an error
When i do it by hand, in the skin modifier ui, i have the two planes selected and the skin modifier applyed to them, i select a vertice on plane01 and the macro listeners returns
skinops.selectvertices $plane01.modifiers(#skin) #(1)
And if i select a vertice on plane02 it returns :
skinops.selectvertices $plane01.modifiers(#skin) #(1)
The macro listener always return $Plane01.modifiers(#skin) as a pointer to the skin modifier… but how does it make the difference between vertex1 on $plane01 and vertex 1 on $plane02…
Is there some method to select the vertices on the second plane with maxscript ?
Thanks a lot for your help.
Nothing to do with it i still don’t find the correct code to select vertices on the second object affected by the skin modificator. Is there anyone who can help me or give me a clue ?
many thanks,
why are you doing this… (why do you want to have an instanced skin modifier on two different objects, why not have a skin modifier each)
what is it you are trying to achieve?
I have a character to skin with a lot lot objects on it. Each object are separate.
Putting a single skin modifier on all the object lets me skin everything together with the same skin modifier.
I found this weird too when I first ran into it. The way to get around it is to store your initial selection in a variable, cycle through the objects selecting each one individually, and then when you call vertex 1 on each object it will refer to vertex 1 of the currently selected object. When its all done, just reselect the original selection.
Feels a bit hacky, but its what works. You also have to make sure the skin modifier is currently active in the modifier panel. This is a bit of a pain if there are other modifiers above skin in the stack. Use “modPanel.getModifierIndex <node> <modifier>” and “modPanel.setCurrentObject < modifier | node | node_baseobject > [node:<node>] [ui:<boolean>]” when cycling through the nodes to set skin active if skin is not at the top of your stack.
Nice! it’s working fine with that method, many thanks Mathieson