<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem: Script adding prefix when creating Expression in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/problem-script-adding-prefix-when-creating-expression/m-p/4074615#M17067</link>
    <description>Hey Lavainia,&lt;BR /&gt;I just sent you an email with what I have so far.&lt;BR /&gt;&lt;BR /&gt;I just tested another thing concerning this. I added a print command to the script to pump out what the expression will be prior to creating it. So, in the script editor, it reads correctly when its printed, but the expression that is created is still jacked up. So there's something odd happening in the generation of the actual expression.</description>
    <pubDate>Mon, 13 Apr 2009 21:38:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-04-13T21:38:40Z</dc:date>
    <item>
      <title>Problem: Script adding prefix when creating Expression</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/problem-script-adding-prefix-when-creating-expression/m-p/4074613#M17065</link>
      <description>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. &lt;BR /&gt;&lt;BR /&gt;I have:&lt;BR /&gt;&lt;PRE&gt;$TCExpr = (`expression -q -s scriptName`);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;If I add in the following line to get:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;$TCExpr = (`expression -q -s scriptName`);&lt;BR /&gt;$TCExpr += ("\n  //float $treadControl = " + $treadControlAttr + ";");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;I get this added to the expression: &lt;BR /&gt;&lt;PRE&gt;float $treadControl = tread_ctrl_1.treadControl;&lt;/PRE&gt;&lt;BR /&gt;which is correct....&lt;BR /&gt;&lt;BR /&gt;BUT, if I take out the "//" in the above line, like such:&lt;BR /&gt;&lt;PRE&gt;$TCExpr += ("\n float $treadControl = " + $treadControlAttr + ";");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;I get this as the result:&lt;BR /&gt;&lt;PRE&gt;float $treadControl = trtread_ctrl_1.treadControl;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;*edit... &lt;BR /&gt;and now even stranger, if I explicitely state what the control is via:&lt;BR /&gt;&lt;PRE&gt;$TCExpr += ("\n  float $test = tread_ctrl_1.treadControl;");&lt;/PRE&gt;&lt;BR /&gt;It still adds the 'tr' prefix.</description>
      <pubDate>Sat, 11 Apr 2009 23:18:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/problem-script-adding-prefix-when-creating-expression/m-p/4074613#M17065</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-11T23:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: Script adding prefix when creating Expression</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/problem-script-adding-prefix-when-creating-expression/m-p/4074614#M17066</link>
      <description>possible to share your scene?&lt;BR /&gt;&lt;BR /&gt;upon testing this i don't get the tr prefix, so most likely it's coming from something that is in your scene that you are missing.</description>
      <pubDate>Mon, 13 Apr 2009 21:00:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/problem-script-adding-prefix-when-creating-expression/m-p/4074614#M17066</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-13T21:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: Script adding prefix when creating Expression</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/problem-script-adding-prefix-when-creating-expression/m-p/4074615#M17067</link>
      <description>Hey Lavainia,&lt;BR /&gt;I just sent you an email with what I have so far.&lt;BR /&gt;&lt;BR /&gt;I just tested another thing concerning this. I added a print command to the script to pump out what the expression will be prior to creating it. So, in the script editor, it reads correctly when its printed, but the expression that is created is still jacked up. So there's something odd happening in the generation of the actual expression.</description>
      <pubDate>Mon, 13 Apr 2009 21:38:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/problem-script-adding-prefix-when-creating-expression/m-p/4074615#M17067</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-13T21:38:40Z</dc:date>
    </item>
  </channel>
</rss>

