prettyh8machine
01-07-2004, 08:32 AM
Hi,
For a given object under a certrain group (e.g. Group1|object), I want to write an expression that needs to access the object's value on a certain frame. Im writing,
... = ` getAttr -t $previousTime $objectName`;
The prob is that getAttr shouldnt be used and it IS causing problems. Is there any alternative method to get an attributes value on a given time without using this command (instead accessing the object's attribute directly as should be used in expressions).
Secondly, since I dont know an alternative, when using getAttr, the $objectName should be Group1|object. That's fine but when I duplicate the objects (I need to do that), the new object's name is now Group2|object. So now the expression should have some mechanism to insert this name instead of using simple object.attribute format. I tried this:
getAttr $previousTime ".attribute";
and apparently it worked. But then again while playback, it starts giving error as it cant resolve the object to which .attribute is associated. Is there any way for the expression to find out whose object it (the expression) belongs to while running ?
Remember im doing all this thru a MEL script so I dont wanna edit each duplicated object's script manually.
Please help me.
Thanks
For a given object under a certrain group (e.g. Group1|object), I want to write an expression that needs to access the object's value on a certain frame. Im writing,
... = ` getAttr -t $previousTime $objectName`;
The prob is that getAttr shouldnt be used and it IS causing problems. Is there any alternative method to get an attributes value on a given time without using this command (instead accessing the object's attribute directly as should be used in expressions).
Secondly, since I dont know an alternative, when using getAttr, the $objectName should be Group1|object. That's fine but when I duplicate the objects (I need to do that), the new object's name is now Group2|object. So now the expression should have some mechanism to insert this name instead of using simple object.attribute format. I tried this:
getAttr $previousTime ".attribute";
and apparently it worked. But then again while playback, it starts giving error as it cant resolve the object to which .attribute is associated. Is there any way for the expression to find out whose object it (the expression) belongs to while running ?
Remember im doing all this thru a MEL script so I dont wanna edit each duplicated object's script manually.
Please help me.
Thanks
