Notifications
Clear all

[Closed] Reset SkinWrap by script?

Hey, guys! I’m trying to push the button labelled ‘Reset’ from the SkinWrap modifier. In theory, the code is:

object.modifiers[#Skin_Wrap].meshDeformOps.reset()

Resest both the Strength and Scale values of the selected control vertices. Corresponds to pressing the “Reset” button.

… but this does not work for me. It does nothing at all. I tried to execute the code while being in the Modifiers Panel, with the object selected and so on… but the code seems not to work. I need to reset by script for one little tool I’m working on.

Any clue? Ops, I’m working with MAX 2009 32-bit. Thanks!

5 Replies
 eek

is the modifiers panel open through script? The only way i got stuff working through the skin_wrap is by using the object directly with :

$.modifiers[#Skin_Wrap].meshDeformOps.reset()

I’ve always have had lots of problems with skin wrap and scripting. I tried this in 2k8, doesn’t seem to work either. I think it is just broken.

no luck here either… could push the button via uiaccessor, but seems to me it’s simpler to just re-set the values (strength and scale) via the appropriate calls directly. Not as ‘nice’ as a single reset, but has the same result and shouldn’t take much longer to execute…


<mod>.meshDeformOps.setLocalStr 1.0
<mod>.meshDeformOps.setLocalScale 1 1.0
<mod>.meshDeformOps.setLocalScale 2 1.0
<mod>.meshDeformOps.setLocalScale 3 1.0

Thanks for answering, guys

What I’m trying to achieve is the same effect that pushing the RESET button, and that means the geometry coming back to its previous shape before deformation. I want the object to appear the same way it is when turning off the modifier. Clicking on the button works perfectly, but can’t do anything by script.

Richard, since the values for Local Strength and Local Scale are not modified, your code does not seem to do anything. So maybe I’m missing something or the RESET button does something more than reseting those values… I’ll read about the UIAccesor

Thanks again!

D’oh… that’s all that buttom seemed to do – go fig… then again, the UI not updating properly should have been an indication of something ack!-worthy going on.

For the UIAccessor stuff, try beginnin with this thread:
http://forums.cgsociety.org/archive/index.php/t-647906.html

There’s code in there that deals with finding a rollout by name, and getting a control out of that… easy enough to adapt to find that control by its label (Reset) rather than the control type, and push it – or using UIAccessor.pressButtonByName. If you do get stuck, just drop a line here…