Reset SkinWrap by script?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 12 December 2008   #1
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()

Quote: 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!
__________________
The Lady and the Reaper, Oscar-nominated animated short, here
 
Old 12 December 2008   #2
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()
__________________
Disclaimer: My opinions are not those of my employer.


 
Old 12 December 2008   #3
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.
__________________
Tech-Artists.Org, a Community for Technical Artists

www.robg3d.com
 
Old 12 December 2008   #4
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
 
Old 12 December 2008   #5
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!
__________________
The Lady and the Reaper, Oscar-nominated animated short, here
 
Old 12 December 2008   #6
Originally Posted by IkerCLoN: 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

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...p/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..
 
Old 12 December 2008   #7
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:02 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.