Notifications
Clear all

[Closed] SkinOps Function

I have a small script that creates a skin modifier and adds one bone. Now I want to weight all verts to that bone, but when I use the skinOps.GetNumberVertices in the script, it always returns 0. If I select that same object and run that command in the listner, it returns the correct number. Anyone know why this is?

Thanks,
Stev

2 Replies

Okay, I threw in a classOf(obj) and it worked. I’m still curious as to why this works though.

Sorry about the premature post.

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

classof() forces a reevaluation of the whole modifier stack to be able to returns the class on top of the stack. Thus it is a great and cheap way to make sure the stack is updated without having to perform expensive operations like reselecting the object etc.