Probably a simple Expression

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
  02 February 2011
Probably a simple Expression

So I am trying to connect a single float attribute with range 0-14 with 14 float attributes with range 0-1. The 0-14 drives the 0-1 successively so 0-1 of the driver is 0-1 of attribute 1, then 1-2 of the driver is 0-1 of attribute 2, then 2-3 drives 0-1 of att. 3 and so on... Its a zipper using wire deformer and a series of dropoff locators and their Envelope attribute. Tried using SDK but it crashes every time I load the wire. Any tips? I know about "if then" and "else" but thats about it
 
  02 February 2011
Nevermind

Did a lot of reading and figured it out. Although I am still curious about peoples solutions to zippers.
 
  02 February 2011
I like this "problems".

1.create locator name "main"
2.create 3 locators(locator0,locator1,locator2)
3.animate main locator from 0 to 3
4.run this procedure in script editor

import maya.cmds as mc
def test():
    mainAttr=mc.getAttr("main.ty")
    num=int(mainAttr)
    mc.setAttr("locator"+str(num)+".ty",mainAttr-num)


5.create expression "python("test()")"
6.press play

Most import thing here is to name things smart.

Last edited by ginodauri : 02 February 2011 at 09:38 AM.
 
  02 February 2011
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 12:20 AM.


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