PDA

View Full Version : Probably a simple Expression


dereksig
02-21-2011, 06:20 AM
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:blush:

dereksig
02-21-2011, 07:37 AM
Did a lot of reading and figured it out. Although I am still curious about peoples solutions to zippers.

ginodauri
02-21-2011, 08:26 AM
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.

CGTalk Moderation
02-21-2011, 08:26 AM
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.