[Closed] Problem with Skin Modifier
Hey Guys, I have this problem that I can’t figure out. Basically I’ve written a script to Save/Load Skin Weights. I’ve got it saving them fine but am having a few problems importing them back in.
I first add a Skin Modifier to the object and then put that into a variable as shown below;
addModifier TargetMesh (Skin())
SkinMod = TargetMesh.modifiers[#Skin]
modPanel.setCurrentObject SkinMod
I then loop through all the verts adding the weights through arrays.
SkinOps.ReplaceVertexWeights SkinMod i BoneIDArray WeightArray
However, I keep getting the following error:
Runtime error: Exceeded the vertex countSkin:Skin
Now, I can get the code to run by adding the skin modifier manually and then running the script after taking out the line:
addModifier TargetMesh (Skin())
However, I would like the script to add the modifier. I think the problem lies with the modifier stack but I can’t figure out why.
The Modifier stack only contains a mesh object and a skin modifier (when added).
I’m running Max 8.
Thanks,
-sheefy
Ok I kind of figured it out.
I made a scene with a sphere, called $Sphere01, and a point, $Point01, and ran this script and it works.
(
addModifier $ (Skin())
skinmod = $.modifiers[#skin]
modpanel.setCurrentObject skinmod
format ">Before>%
" (skinops.getNumberVertices skinMod)
skinops.addBone skinMod $point01 1
completeRedraw ()
format ">After>%
" (skinops.getNumberVertices skinMod)
)
You’ll notice that before adding the bone and completely redrawing the scene the vertex count is 0 and after it accurately represents the count.
I hope this helps.
Thanks Keith! I would have never figured that out by myself. Much Appreciated.