Message 1 of 3
Problem: Script adding prefix when creating Expression
Not applicable
04-11-2009
04:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Okay... this is really screwing with my mind... I'm working on a script that will automatically generate an expression to control some objects in my scene. In my script, I can print the variable that I need and get the correct result, but whenever I try to add the variable to an existing string (what will be my expression) by typing $string += ........ it adds a 'tr' prefix to the variable, and I can't see why.
I have:
If I add in the following line to get:
I get this added to the expression:
which is correct....
BUT, if I take out the "//" in the above line, like such:
I get this as the result:
So, it adds a "tr" before the name of the object tread_ctrl. I can't figure out for the life of me where its getting that value from. Any help would be appreciated.
*edit...
and now even stranger, if I explicitely state what the control is via:
It still adds the 'tr' prefix.
I have:
$TCExpr = (`expression -q -s scriptName`);
If I add in the following line to get:
$TCExpr = (`expression -q -s scriptName`);
$TCExpr += ("\n //float $treadControl = " + $treadControlAttr + ";");
I get this added to the expression:
float $treadControl = tread_ctrl_1.treadControl;
which is correct....
BUT, if I take out the "//" in the above line, like such:
$TCExpr += ("\n float $treadControl = " + $treadControlAttr + ";");I get this as the result:
float $treadControl = trtread_ctrl_1.treadControl;
So, it adds a "tr" before the name of the object tread_ctrl. I can't figure out for the life of me where its getting that value from. Any help would be appreciated.
*edit...
and now even stranger, if I explicitely state what the control is via:
$TCExpr += ("\n float $test = tread_ctrl_1.treadControl;");It still adds the 'tr' prefix.