Quantcast
Channel: How to feed a variable to a command's parameter? - Stack Overflow
Viewing all articles
Browse latest Browse all 2

How to feed a variable to a command's parameter?

$
0
0

I am super noob and I have been researching this all day to no avail.This is my quest : I want to iterate through a list of objects and connect one of their attributes to another object's attribute. For the sake of the example, let's say I want to feed in nurbsCircle's translate X into every other object's translate Y.

My attempt looks like this :

    import maya.cmds as cmdssel = cmds.ls(selection=True)for obj in sel:    cmds.connectAttr(nurbsCircle1 +'.tx', second +'.ty')

...but I don't know how to tell Maya the second term ("second") should be "every object in selection" instead of a fixed thing.

I got help from this :Maya python connect attributes of selection

I know this is probably dead simple. I hope someone can help me.

Hadriscus


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images