<?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: How can I use ai user data in operators ? in Arnold for Maya Forum</title>
    <link>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039579#M4326</link>
    <description>&lt;P&gt;Thanks for your answer,&lt;/P&gt;&lt;P&gt;So if I understand well there is no way that user data can control or override shader assignation  ?&lt;/P&gt;&lt;P&gt;I am exporting a forest from Houdini as ass file, But I am doing my rendering in Maya.&lt;/P&gt;&lt;P&gt;I know is possible to separate shaders and shapes in different ass files as long as shapes have the correct assignation. &lt;/P&gt;&lt;P&gt;I wanted to go that way but I failed to generate the assignations only based on attributes.&lt;/P&gt;&lt;P&gt;It doesn't work if Arnold can not find the shaders in Houdini ...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;May be there is a trick to assign non existing shaders ?&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jul 2020 19:08:01 GMT</pubDate>
    <dc:creator>idizdar</dc:creator>
    <dc:date>2020-07-13T19:08:01Z</dc:date>
    <item>
      <title>How can I use ai user data in operators ?</title>
      <link>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039577#M4324</link>
      <description>&lt;P&gt;Is it possible to inject user data string for example in a operator ?&lt;/P&gt;&lt;P&gt;I want to assign shaders based on a user data string.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 17:30:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039577#M4324</guid>
      <dc:creator>idizdar</dc:creator>
      <dc:date>2020-07-13T17:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use ai user data in operators ?</title>
      <link>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039578#M4325</link>
      <description>&lt;P&gt;EDIT: See Orn's answer. You can use user data values in assignment expressions.&lt;/P&gt;&lt;P&gt;I was thinking about control flow based on user data, sorry.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You want the operator to assign shaders based on user data that is already in the scene?&lt;/P&gt;&lt;P&gt;There's no way to do that.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;A &lt;STRONG&gt;set_parameter&lt;/STRONG&gt; operator can create user data on shapes. You add a custom assignment, where you specify the &lt;STRONG&gt;string &lt;/STRONG&gt;type. Then in the shading tree you could get that user data and do different things based on the value.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 18:28:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039578#M4325</guid>
      <dc:creator>Stephen.Blair</dc:creator>
      <dc:date>2020-07-13T18:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use ai user data in operators ?</title>
      <link>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039579#M4326</link>
      <description>&lt;P&gt;Thanks for your answer,&lt;/P&gt;&lt;P&gt;So if I understand well there is no way that user data can control or override shader assignation  ?&lt;/P&gt;&lt;P&gt;I am exporting a forest from Houdini as ass file, But I am doing my rendering in Maya.&lt;/P&gt;&lt;P&gt;I know is possible to separate shaders and shapes in different ass files as long as shapes have the correct assignation. &lt;/P&gt;&lt;P&gt;I wanted to go that way but I failed to generate the assignations only based on attributes.&lt;/P&gt;&lt;P&gt;It doesn't work if Arnold can not find the shaders in Houdini ...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;May be there is a trick to assign non existing shaders ?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 19:08:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039579#M4326</guid>
      <dc:creator>idizdar</dc:creator>
      <dc:date>2020-07-13T19:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use ai user data in operators ?</title>
      <link>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039580#M4327</link>
      <description>&lt;P&gt;You can use the user data shaders to control an aiSwitch shader.&lt;/P&gt;&lt;P&gt;set_parameter operators can assign existing shaders.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 19:59:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039580#M4327</guid>
      <dc:creator>Stephen.Blair</dc:creator>
      <dc:date>2020-07-13T19:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use ai user data in operators ?</title>
      <link>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039581#M4328</link>
      <description>&lt;P&gt;You should be able to use user parameters to drive the shader assignment. Let me provide a couple of examples that might be of use.&lt;/P&gt;&lt;P&gt;Let's say you've exported some geo with some user data from Houdini to an .ass file (see &lt;EM&gt;standin&lt;/EM&gt;&lt;EM&gt;.ass&lt;/EM&gt; attached below as a trivial example).&lt;/P&gt;&lt;P&gt;Then depending on your preferred workflow, you can set things up in different ways to utilise the user data. I'll provide 2 examples below which uses the &lt;EM&gt;set_parameter&lt;/EM&gt; operator and attached standin file (just 3 spheres with some arbitrary user data).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Here, we assign a &lt;EM&gt;green&lt;/EM&gt; shader to spheres that have particular string and velocity user properties&lt;/P&gt;&lt;PRE&gt;selection "sphere*.(my_string == 'make_me_green' and my_speed &amp;gt; 4.0)"
assignment "shader = 'green'"
&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;sphere2&lt;/EM&gt; in &lt;EM&gt;standin.ass&lt;/EM&gt; matches this criteria so it'll be assigned the green shader.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Example 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You can also use the user data directly in the assignment. &lt;EM&gt;sphere1&lt;/EM&gt; and &lt;EM&gt;sphere3&lt;/EM&gt; have a &lt;EM&gt;my_shader_name&lt;/EM&gt; user data with the values &lt;EM&gt;red&lt;/EM&gt; and &lt;EM&gt;blue&lt;/EM&gt;, respectively.&lt;/P&gt;&lt;P&gt;Here, the selection matches all spheres where the &lt;EM&gt;my_shader_name&lt;/EM&gt; user data exists, and the assignment assigns the shader using the user data value as the shader name.&lt;/P&gt;&lt;PRE&gt;selection "sphere*.(my_shader_name)"
assignment "shader = my_shader_name"
&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;The expected render and .ass files are attached and it should be easy to replicate in Maya using a standin. Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.arnoldrenderer.com/storage/attachments/7696-standin.ass" target="_blank"&gt;standin.ass&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.arnoldrenderer.com/storage/attachments/7697-test.ass" target="_blank"&gt;test.ass&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.arnoldrenderer.com/storage/attachments/7698-test.png" target="_blank"&gt;test.png&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 11:26:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039581#M4328</guid>
      <dc:creator>orn.gunnarsson</dc:creator>
      <dc:date>2020-07-14T11:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use ai user data in operators ?</title>
      <link>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039582#M4329</link>
      <description>&lt;P&gt;Thanks &lt;STRONG&gt;Orn !&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;That is really good to know that Arnold can handle such things.&lt;/P&gt;&lt;P&gt;The problem now is that I d'ont have the same result as you in Maya.&lt;/P&gt;&lt;P&gt;I import you &lt;STRONG&gt;test.ass&lt;/STRONG&gt; in Maya it render well but I get only the green sphere shaded, not the red and blue.&lt;/P&gt;&lt;P&gt;Seams to be it don't understand your &lt;STRONG&gt;assign_stuff &lt;/STRONG&gt;operator.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Any idea to make it work in Maya ?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 10:18:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039582#M4329</guid>
      <dc:creator>idizdar</dc:creator>
      <dc:date>2020-08-07T10:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use ai user data in operators ?</title>
      <link>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039583#M4330</link>
      <description>&lt;P&gt;How do you "set directly" ? You are using setAttr, not the Attribute Editor?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 13:05:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/arnold-for-maya-forum/how-can-i-use-ai-user-data-in-operators/m-p/11039583#M4330</guid>
      <dc:creator>Stephen.Blair</dc:creator>
      <dc:date>2020-08-07T13:05:55Z</dc:date>
    </item>
  </channel>
</rss>

