CGTalk > Software Specific Forums > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 12-01-2008, 04:50 PM   #1
IkerCLoN
Likes twisted bones
 
IkerCLoN's Avatar
portfolio
Iker J. de los Mozos
Character TD
Walt Disney Animation Studios
Los Angele, USA
 
Join Date: Dec 2002
Posts: 509
Reset SkinWrap by script?

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

Code:
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-01-2008, 07:07 PM   #2
eek
Fixer
 
eek's Avatar
portfolio
Charles Looker
Snr Technical Artist
Electronic Arts
Vancouver, Canada
 
Join Date: Feb 2002
Posts: 4,221
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-01-2008, 07:16 PM   #3
RobGalanakis
Frequenter
 
RobGalanakis's Avatar
portfolio
Rob Galanakis
Technical Animator
Bioware Austin
Austin, USA
 
Join Date: Nov 2005
Posts: 231
Send a message via MSN to RobGalanakis
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-02-2008, 02:36 AM   #4
ZeBoxx2
Lord of the posts
 
ZeBoxx2's Avatar
Richard Annema
Caustic Graphics / SplutterFish
Groningen, Netherlands
 
Join Date: Jul 2006
Posts: 1,461
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...

Code:
<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-02-2008, 08:31 AM   #5
IkerCLoN
Likes twisted bones
 
IkerCLoN's Avatar
portfolio
Iker J. de los Mozos
Character TD
Walt Disney Animation Studios
Los Angele, USA
 
Join Date: Dec 2002
Posts: 509
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-02-2008, 12:58 PM   #6
ZeBoxx2
Lord of the posts
 
ZeBoxx2's Avatar
Richard Annema
Caustic Graphics / SplutterFish
Groningen, Netherlands
 
Join Date: Jul 2006
Posts: 1,461
Quote:
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-02-2008, 12:58 PM   #7
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:09 PM.


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