Copy weight table


#1

I want to link the root bone to the skined mesh, but unfortunatelly 3ds max don´t let me do so, it shows some billsh*t about dependency loop. If I am linking the root bone to a mesh without skin and adding skin modifier after that there is no problem. However I don´t want to do all the skin weights from scratch. I tried something like this:

mySkin=myMesh.modifiers["skin"]
deleteModifier myMesh (myMesh.modifiers["skin"])
myBone.parent=myMesh
addModifier myMesh mySkin

The code can have a lot of errors, since I am writing from memory. After execution of this code the root bone is linked to mesh, but the weight table is mising, so I have to make it again from scratch. Is there a way to make a copy of the old weight table and apply it to the mesh again?


#2

Actually by giving this warning the MAX prevents you to do “bullsh*t”.


#3

Think yourself… the skin stores its local data initialized to hierarchy at the moment of the skin modifier been applied. Now you want to change it on-the-fly. Maybe you need to delete the current Skin and reapply it?


#4

Nah I was tallking exactly about delete the current Skin and reapply it. Unfortunatelly the weight table is geting lost, so when I reapply the skin it´s useles as al weight are mising.


#5

the way you try to reapply is wrong.

myMesh.modifiers["skin"]=undefined

it doesn’t make sense


#6

I already said that my code can have a lot of errors, as I was writing from memory and this line was defenetly wrong. I have fixed that line in my first post.


#7

Why would you need to link the root to the mesh, which is skinned to the root?
Seems more a case of you are trying to solve your problem incorrectly.


#8

Max could not ask this question, and therefore gave only politically correct warning :wink:


#9

I wouldn´t call it warning, as warnings can simply be ignored and unfortunately I can´t do it here.
The answer to the question why I need to link the root bone to the skined mesh is simple, the game engine wants it so. Also I see no problem in linking the root bone to the skined mesh, as I can link the root bone to the mesh befor it was skined and do all the skining stuff after that. I defenetly have never noticed any kind of loops when doing so. Even all animations worcked fine.
However I really don´t want to argue about all this stuff. All I need to know is if there is a way to copy the skin modifier from a mesh with the correspondin weight table? In some old thread here I read that Skin_Wrap modifier could be helpfull but there was no explanation how and after taking a look on documentation of Skin_Wrap modifier it makes no real sence for me, but that has nothing to say, as my maxscript knowledge is minimal.


#10

But how can I do that?


#11

You can copy skin modifier (or “modified object skin” if you take look where should be looking when animating), delete it, link whatever, than paste it to yours mesh…
Although that hierarchy make no sense in Max (actually no sense at all)

How could you expect to bring back skinning information with “empty” skin modifier!?


#12

Sorry but where exactly I should be looking for that “modified object skin”? Like mentioned, my maxscript knowledge is very low.
I gues by hierarchy make no sense in Max you mean that it makes no sence to link the root bone to the corresponding skined mesh, right? Like already said, not going argue about that, as considering max you seems to be right, as other users, that posted here, say the same, but at the end it doesn´t meter if it makes sence in max, as the game engine wants such hierarchy.


#13

What ever game engine you’re using that requires the root to be a child of the skinned mesh is probably not worth using.

If you want to continue down the path of sillyness, ignoring suggestions from people who have been doing this for a long time, then look at the skinOps methods:

http://help.autodesk.com/view/3DSMAX/2018/ENU/?guid=__files_GUID_0820AA26_920F_434D_A6BC_E8B6B57F54AC_htm

In particular, GetVertexWeight and SetVertexWeight.