[Closed] Problem using skinOps.setVertexWeights
Hi! Thanks for all the posts everyone, this forum is a great resource.
Anyways, I have a problem that I bet someone here knows how to solve. In MaxScript I’m adding a skin modifier to a mesh, adding a bunch of bones, and then setting all the vertex weights.
The problem I have is that when I go to set the first vertex weight with skinOps.setVertexWeights, I get the error: [size=2]Runtime error: Exceeded the vertex count[/size]
[size=2][/size]
[size=2]In fact if I call skinOps.getNumberVertices before that it tells me there are 0 vertices. However after the exception if I call skinOps.getNumberVertices in the Listener it gives me the right number. As a hack I found that after adding the bones (with skinOps.addBone by the way) if I call skinOps.buttonAdd and have the user just cancel that dialog then getNumberVertices gives the right count and all works properly.[/size]
[size=2][/size]
[size=2]So is there some function I can call after adding the bones to get skinOps to update properly and see the right number of vertices so I can begin calling setVertexWeights?[/size]
[size=2][/size]
[size=2]Thanks for any help or tips!!
[/size]
Hi try to use the “ClassOf obj” , it´s a “hacky” way to force the stack update !
I saw something about this sometime ago! Go and search for older posts about “skin modifier”
See ya