Original Post
I use 3ds max 9 and its scripting language to export models into my custom file format. So far, everything is working great but I have one annoying problem: I can't seem to retrieve the weights for the (mesh) vertices.
-- write out bone count
bone_count = skinops.getnumberbones mesh.modifiers[#skin]
vertex_count = mesh.numverts --getnumvertices
for i = 1 to vertex_count do
-- loop through all mesh vertices in this mesh
(
for bone = 1 to bone_count do
-- loop through all bones in this mesh
(
skinops.getvertexweight mesh.modifiers[#skin] i bone
)
)
On the skinops.getvertexweight line it tells me that it requires the skin modifier to be selected. Is that really true? If so, I'll have to figure out a way to make the script do this automatically I guess (which I haven't been able to so far) - however, if I manually select the skin modifier and then run the script, it actually complains:
-- Runtime error: Exceeded the vertex weight list countSkin:Skin
I start to wonder whether this is the correct approach to do this at all. I'm pretty new to MAXscript so please do go easy on me in case this is a redundant or trivial question. I have found cgtalk.com to be the most active MAXscript community but didn't get an answer over there, hopefully there are some people here who can. Thanks ahead of time. [Edited by - d h k on April 29, 2010 7:04:00 AM]