<?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 Problem with AEassignTextureCB in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/problem-with-aeassigntexturecb/m-p/4152339#M16412</link>
    <description>Hi,&lt;BR /&gt;I have written s small &amp;amp;#40;and for sure dirty&amp;amp;#41; script to do some work on the actual selected material node.&lt;BR /&gt;Basically it creates a file node, connects it to the SpecularColor channel and then assigns a texturepath. That one is copied from the color file input and then altered with a suffix &amp;amp;#40;_a.tif instead of .tif&amp;amp;#41;&lt;BR /&gt;Just before the last command I get an error message: &lt;I&gt;Error: No object matches name: fileTextureName.fileHasAlpha&lt;/I&gt;&lt;BR /&gt;The file node is assgined just fine, the bitmap loads fine, but then something doesn´t work, so that the last line of code is not executed &amp;amp;#40;change of color gain&amp;amp;#41;.&lt;BR /&gt;&lt;BR /&gt;I also tried to remove the "image" from the AEassginTextureCB line, then I get the message "Wrong number of arguments on call toAEassginTextureCB".&lt;BR /&gt;And if I additonally remove the AE and use assignTextureCB, then the script runs till the end without warning, colorgain is changed, but: no bitmap is assigned.&lt;BR /&gt;&lt;BR /&gt;I would be glad if someone could tell me, what I am doing wrong.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Walli&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;string &amp;amp;#36;auswahl[] = `ls -long -selection`;&lt;BR /&gt;string &amp;amp;#36;auswahlen = &amp;amp;#36;auswahl+".specularColor";&lt;BR /&gt;string &amp;amp;#36;dateiauswahl = &amp;amp;#36;auswahl+"F";&lt;BR /&gt;select -r &amp;amp;#36;dateiauswahl;&lt;BR /&gt;string &amp;amp;#36;dateiname = `getAttr &amp;amp;#36;dateiauswahl.fileTextureName`;&lt;BR /&gt;string &amp;amp;#36;result = substituteAllString&amp;amp;#40;&amp;amp;#36;dateiname, ".tif", "_a.tif"&amp;amp;#41;&lt;BR /&gt;shadingNode -asTexture file;&lt;BR /&gt;string &amp;amp;#36;auswahlb[] = `ls -long -selection`;&lt;BR /&gt;string &amp;amp;#36;auswahlenb = &amp;amp;#36;auswahlb+".outColor";&lt;BR /&gt;&lt;BR /&gt;connectAttr -force &amp;amp;#36;auswahlenb &amp;amp;#36;auswahlen;&lt;BR /&gt;AEassignTextureCB  .fileTextureName &amp;amp;#36;result "image";&lt;BR /&gt;setAttr .colorGain -type double3 0.04958 0.04958 0.04958 ;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 May 2010 14:20:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-05-19T14:20:18Z</dc:date>
    <item>
      <title>Problem with AEassignTextureCB</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/problem-with-aeassigntexturecb/m-p/4152339#M16412</link>
      <description>Hi,&lt;BR /&gt;I have written s small &amp;amp;#40;and for sure dirty&amp;amp;#41; script to do some work on the actual selected material node.&lt;BR /&gt;Basically it creates a file node, connects it to the SpecularColor channel and then assigns a texturepath. That one is copied from the color file input and then altered with a suffix &amp;amp;#40;_a.tif instead of .tif&amp;amp;#41;&lt;BR /&gt;Just before the last command I get an error message: &lt;I&gt;Error: No object matches name: fileTextureName.fileHasAlpha&lt;/I&gt;&lt;BR /&gt;The file node is assgined just fine, the bitmap loads fine, but then something doesn´t work, so that the last line of code is not executed &amp;amp;#40;change of color gain&amp;amp;#41;.&lt;BR /&gt;&lt;BR /&gt;I also tried to remove the "image" from the AEassginTextureCB line, then I get the message "Wrong number of arguments on call toAEassginTextureCB".&lt;BR /&gt;And if I additonally remove the AE and use assignTextureCB, then the script runs till the end without warning, colorgain is changed, but: no bitmap is assigned.&lt;BR /&gt;&lt;BR /&gt;I would be glad if someone could tell me, what I am doing wrong.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Walli&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;string &amp;amp;#36;auswahl[] = `ls -long -selection`;&lt;BR /&gt;string &amp;amp;#36;auswahlen = &amp;amp;#36;auswahl+".specularColor";&lt;BR /&gt;string &amp;amp;#36;dateiauswahl = &amp;amp;#36;auswahl+"F";&lt;BR /&gt;select -r &amp;amp;#36;dateiauswahl;&lt;BR /&gt;string &amp;amp;#36;dateiname = `getAttr &amp;amp;#36;dateiauswahl.fileTextureName`;&lt;BR /&gt;string &amp;amp;#36;result = substituteAllString&amp;amp;#40;&amp;amp;#36;dateiname, ".tif", "_a.tif"&amp;amp;#41;&lt;BR /&gt;shadingNode -asTexture file;&lt;BR /&gt;string &amp;amp;#36;auswahlb[] = `ls -long -selection`;&lt;BR /&gt;string &amp;amp;#36;auswahlenb = &amp;amp;#36;auswahlb+".outColor";&lt;BR /&gt;&lt;BR /&gt;connectAttr -force &amp;amp;#36;auswahlenb &amp;amp;#36;auswahlen;&lt;BR /&gt;AEassignTextureCB  .fileTextureName &amp;amp;#36;result "image";&lt;BR /&gt;setAttr .colorGain -type double3 0.04958 0.04958 0.04958 ;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 May 2010 14:20:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/problem-with-aeassigntexturecb/m-p/4152339#M16412</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-19T14:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AEassignTextureCB</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/problem-with-aeassigntexturecb/m-p/4152340#M16413</link>
      <description>AEassignTextureCB expects the attribute to be provided as node.attr, not as .attr. It uses tokenize to figure out what the name of the node is by spiltting the tring whith the ".". Since there's nothing to split, it return the name of the attribute, not the node.&lt;BR /&gt;&lt;BR /&gt;The script should work is you use this instead: &lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;AEassignTextureCB  &amp;amp;#40;&amp;amp;#36;auswahlb+ ".fileTextureName"&amp;amp;#41; &amp;amp;#36;result "image";&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 May 2010 19:34:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/problem-with-aeassigntexturecb/m-p/4152340#M16413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-19T19:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AEassignTextureCB</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/problem-with-aeassigntexturecb/m-p/4152341#M16414</link>
      <description>thanks!&lt;BR /&gt;I also got another message, telling me better to use setAttr, exactly because of what you also mentioned.&lt;BR /&gt;&lt;BR /&gt;So with those hints I put together this script which seems to work fine. Thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;string &amp;amp;#36;auswahl[] = `ls -long -selection`;&lt;BR /&gt;string &amp;amp;#36;auswahlen = &amp;amp;#36;auswahl+".specularColor";&lt;BR /&gt;string &amp;amp;#36;dateiauswahl = &amp;amp;#36;auswahl+"F";&lt;BR /&gt;&lt;BR /&gt;select -r &amp;amp;#36;dateiauswahl;&lt;BR /&gt;string &amp;amp;#36;dateiname = `getAttr &amp;amp;#40;&amp;amp;#36;dateiauswahl + ".fileTextureName"&amp;amp;#41;`;&lt;BR /&gt;string &amp;amp;#36;result = substituteAllString&amp;amp;#40;&amp;amp;#36;dateiname, ".tif", "_a.tif"&amp;amp;#41;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;shadingNode -asTexture file;&lt;BR /&gt;string &amp;amp;#36;aktuell[] = `ls -long -selection`;&lt;BR /&gt;print "---";&lt;BR /&gt;print &amp;amp;#36;aktuell;&lt;BR /&gt;print "---";&lt;BR /&gt;setAttr &amp;amp;#40;&amp;amp;#36;aktuell+".fileTextureName"&amp;amp;#41; -type "string" &amp;amp;#36;result;&lt;BR /&gt;string &amp;amp;#36;auswahlb[] = `ls -long -selection`;&lt;BR /&gt;string &amp;amp;#36;auswahlenb = &amp;amp;#36;auswahlb+".outColor";&lt;BR /&gt;&lt;BR /&gt;connectAttr -force &amp;amp;#36;auswahlenb &amp;amp;#36;auswahlen;&lt;BR /&gt;&lt;BR /&gt;setAttr .colorGain -type double3 0.04958 0.04958 0.04958 ;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 May 2010 21:46:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/problem-with-aeassigntexturecb/m-p/4152341#M16414</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-19T21:46:55Z</dc:date>
    </item>
  </channel>
</rss>

