View Full Version : can you override an maya command?
pixlix2 08-24-2008, 10:35 AM Hello everyone,
I'm wondering if it is possible to override an maya command like "setAttr". Something like a wrapper function called setAttr that contains some custom code and in the end calles mayas nativ setAttr function.
Any help would be great
thanks
|
|
damat
08-24-2008, 01:44 PM
why do you need that? Even if it's possible, it not recommended - this way you can ruin your scenes easily
trancor
08-24-2008, 05:11 PM
Yeah, why don't you do a global process that loads with maya, do something like global proc setAttrCustom(string $objs_Attr, int $setAttrValue )
Then just add your code before the "setAttr $objs_Attr $setAttrValue; " line in the end of the proc.
or setAttrCustom(string $obj, string $objs_Attr, int $setAttrValue )
setAttr ($obj+"."+$objs_Attr) $setAttrValue;
if you have some script automatically find the object vs the attribute.
But how ever you do it, I think that would work nicely. Get your custom script added to the command.
CGTalk Moderation
08-24-2008, 05:11 PM
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.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.