<?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 set texmap_diffuse_multiplier = 0 for all scene materials? in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129062#M22918</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Finally looking into maxscript and need some pointers. &lt;BR /&gt;&lt;BR /&gt;I have a scene and I would like to globally change the diffuse multiplier to all materials in the scene to 0.&lt;BR /&gt;&lt;BR /&gt;The scene comprises of some multi/sub and VRay materials.&lt;BR /&gt;&lt;BR /&gt;I've used the following in the listner:&lt;BR /&gt;&lt;BR /&gt;for obj in sceneMaterials do&lt;BR /&gt;    texmap_diffuse_multiplier = 0&lt;BR /&gt;&lt;BR /&gt;it returns a "0" but nothing appears to change?&lt;BR /&gt;&lt;BR /&gt;Where am I going wrong?</description>
    <pubDate>Wed, 30 Dec 2009 12:55:28 GMT</pubDate>
    <dc:creator>SanyHuttler</dc:creator>
    <dc:date>2009-12-30T12:55:28Z</dc:date>
    <item>
      <title>set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129062#M22918</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Finally looking into maxscript and need some pointers. &lt;BR /&gt;&lt;BR /&gt;I have a scene and I would like to globally change the diffuse multiplier to all materials in the scene to 0.&lt;BR /&gt;&lt;BR /&gt;The scene comprises of some multi/sub and VRay materials.&lt;BR /&gt;&lt;BR /&gt;I've used the following in the listner:&lt;BR /&gt;&lt;BR /&gt;for obj in sceneMaterials do&lt;BR /&gt;    texmap_diffuse_multiplier = 0&lt;BR /&gt;&lt;BR /&gt;it returns a "0" but nothing appears to change?&lt;BR /&gt;&lt;BR /&gt;Where am I going wrong?</description>
      <pubDate>Wed, 30 Dec 2009 12:55:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129062#M22918</guid>
      <dc:creator>SanyHuttler</dc:creator>
      <dc:date>2009-12-30T12:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129063#M22919</link>
      <description>Well, for starters you haven't specifed the scene material you want to operate on.&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;for obj in scenematerials do&lt;BR /&gt;   obj.texmap_diffuse_multiplier = 0&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;Then there's that property &amp;amp;#40;texmap_diffuse_multiplier&amp;amp;#41; - it doesn't seem to exist anywhere in the Maxscript help &amp;amp;#40;it may be vray specific - I don't know because I don't have vray&amp;amp;#41;. I can't even see a "multiplier" value in the Material Editor &amp;amp;#40;standard/MR materials&amp;amp;#41; - where are you seeing it?&lt;BR /&gt;Beyond that, the above code won't work on a multi-sub material, you would have to detect that the scene material is a multi-sub then iterate over the sub materials.&lt;BR /&gt;&lt;BR /&gt;If you're just starting out with scripting you'd be hard pressed to find a more difficult area to jump into.</description>
      <pubDate>Wed, 30 Dec 2009 14:01:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129063#M22919</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-12-30T14:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129064#M22920</link>
      <description>Thanks.&lt;BR /&gt;&lt;BR /&gt;Yes it's VRay specific.&lt;BR /&gt;&lt;BR /&gt;The multi/Sub I can implement later that's not a problem I just wanted to initially get the multiplier working.&lt;BR /&gt;&lt;BR /&gt;I can get it working If I reference a material directly:&lt;BR /&gt;&lt;BR /&gt;meditMaterials.texmap_diffuse_multiplier = 0&lt;BR /&gt;&lt;BR /&gt;But couldn't get a work out how to apply this method to all materials in a scene.&lt;BR /&gt;&lt;BR /&gt;Should I be using an if statement to only affecet materials that have this property then?</description>
      <pubDate>Wed, 30 Dec 2009 14:10:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129064#M22920</guid>
      <dc:creator>SanyHuttler</dc:creator>
      <dc:date>2009-12-30T14:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129065#M22921</link>
      <description>SceneMaterials is an array, not a collection. Also, meditMaterials only contains the materials currently in the Material editor, not those in the scene.&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;for matNum = 1 to SceneMaterials.count do&lt;BR /&gt;   sceneMaterials.texmap_diffuse_multiplier = 0&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;That &lt;I&gt;should&lt;/I&gt; work, but I can't test it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Reading up on the sceneMaterials it is, actually, a collection. If the texmap_diffuse_multiplier is mapped, then the following &lt;I&gt;might&lt;/I&gt; work - you'll have to try it.&lt;BR /&gt;&lt;PRE&gt;sceneMaterials.texmap_diffuse_multiplier = 0 &lt;/PRE&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 30 Dec 2009 14:30:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129065#M22921</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-12-30T14:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129066#M22922</link>
      <description>Yes that is one I tried before posting but got the following error&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;-- Unknown property: "texmap_diffuse_multiplier" in #materialLibrary&amp;amp;#40;&amp;amp;#41;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;which is odd as I've tried this in a scene with only one Vray material and nothing else.&lt;BR /&gt;&lt;BR /&gt;Yet as I mentioned if I reference this material like so:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;meditMaterials.texmap_diffuse_multiplier = 0&lt;/PRE&gt; &lt;BR /&gt;&lt;BR /&gt;I get a "0" and it does set the multiplier to 0. &lt;BR /&gt;&lt;BR /&gt;Again trying the the following&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;for obj in sceneMaterials do&lt;BR /&gt;texmap_diffuse_multiplier = 0 &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;as I mentioned in the first post gives me no errors &amp;amp;#40; just the "0" again &amp;amp;#41; but nothing happens to my material &amp;amp;#40;incidentally this has the same effect regardless of the value&amp;amp;#41;.</description>
      <pubDate>Wed, 30 Dec 2009 14:51:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129066#M22922</guid>
      <dc:creator>SanyHuttler</dc:creator>
      <dc:date>2009-12-30T14:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129067#M22923</link>
      <description>In the last example you're still missing the object &amp;amp;#40;pun intended&amp;amp;#41;.&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;for obj in sceneMaterials do&lt;BR /&gt;   obj.texmap_diffuse_multiplier = 0&lt;BR /&gt;   ^^^&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;Did you try the other example I gave above &amp;amp;#40;the one with matNum in it&amp;amp;#41;?</description>
      <pubDate>Wed, 30 Dec 2009 15:20:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129067#M22923</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-12-30T15:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129068#M22924</link>
      <description>Very good...&lt;BR /&gt;&lt;BR /&gt;Yes tried and get:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;-- Unknown property: "texmap_diffuse_multiplier" in #materialLibrary&amp;amp;#40;&amp;amp;#41;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Dec 2009 15:26:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129068#M22924</guid>
      <dc:creator>SanyHuttler</dc:creator>
      <dc:date>2009-12-30T15:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129069#M22925</link>
      <description>Then I'm out of ideas. Both of the "for" constructs above work &amp;amp;#40;with different properties, obviously&amp;amp;#41; here on standard materials. The final, mapped, one doesn't, but it does if I create my own collection from the sceneMaterials. The following sets the Self Illumination value.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;myMats = for mat in sceneMaterials collect mat&lt;BR /&gt;myMats.selfIllumAmount = 50.0&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;The problem is that sceneMaterials is a "special" collection, not an ordinary one, with extra facilities &amp;amp;#40;it is actually a material library&amp;amp;#41; but it doesn't seem to have the normal properties associated with a collection. Creating your own collection may, therefore, be a way around the problem.&lt;BR /&gt;If it doesn't work then I don't know, because if the meditMaterials works then so should the sceneMaterials.&lt;BR /&gt;You could, I suppose, instance each material into the mat editor and then change the value there?&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;for mat in scenematerials do&lt;BR /&gt;   &amp;amp;#40;&lt;BR /&gt;   meditMaterials = mat&lt;BR /&gt;   meditMaterials.texmap_diffuse_multiplier = 0&lt;BR /&gt;   &amp;amp;#41;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Dec 2009 16:03:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129069#M22925</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-12-30T16:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129070#M22926</link>
      <description>Really appreciate your help. &lt;BR /&gt;When I try your:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;for mat in sceneMaterials do&lt;BR /&gt;   &amp;amp;#40;&lt;BR /&gt;   meditMaterials = mat&lt;BR /&gt;   meditMaterials.texmap_diffuse_multiplier = 0&lt;BR /&gt;   &amp;amp;#41; &lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;I get:&lt;BR /&gt;&lt;BR /&gt;-- Syntax error: at &amp;amp;#41;, expected &amp;lt;factor&amp;gt;&lt;BR /&gt;--  In line:    &amp;amp;#41; &lt;BR /&gt;&lt;BR /&gt;However this works:&lt;BR /&gt;&lt;PRE&gt;for mat in sceneMaterials do meditMaterials = mat&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;It doesn't work for me, am I missing something??</description>
      <pubDate>Wed, 30 Dec 2009 16:49:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129070#M22926</guid>
      <dc:creator>SanyHuttler</dc:creator>
      <dc:date>2009-12-30T16:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129071#M22927</link>
      <description>How are you running the script? If you're using the Listener - don't. Multi-line scripts &lt;I&gt;can&lt;/I&gt; be run there, but it's easier to use the proper Script Editor. Any errors will still be shown in the Listener, so have both open.&lt;BR /&gt;Just open the editor &amp;amp;#40;Maxscript | New Script&amp;amp;#41;, copy/paste the script in there and press Ctrl+E to run it. The Listener gets confused &amp;amp;#40;with multiple lines&amp;amp;#41; unless you a&amp;amp;#41; select all the lines then b&amp;amp;#41; execute them with the Enter key on the numeric keypad. The editor is much easier.</description>
      <pubDate>Wed, 30 Dec 2009 17:37:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129071#M22927</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-12-30T17:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129072#M22928</link>
      <description>Ahh... Right thanks wasn't selecting all lines, just pressing enter.&lt;BR /&gt;&lt;BR /&gt;Thanks again for all you input really useful.</description>
      <pubDate>Wed, 30 Dec 2009 17:40:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129072#M22928</guid>
      <dc:creator>SanyHuttler</dc:creator>
      <dc:date>2009-12-30T17:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129073#M22929</link>
      <description>&lt;PRE&gt;-- collect mat's with needed property&lt;BR /&gt;myMats = for mat in sceneMaterials where \ -- carriage line&lt;BR /&gt;hasProperty mat #texmap_diffuse_multiplier collect mat&lt;BR /&gt;-- if property is mapped&lt;BR /&gt;myMats.texmap_diffuse_multiplier = 0&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; Opss, i see you solve it :&amp;amp;#41;</description>
      <pubDate>Wed, 30 Dec 2009 17:42:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129073#M22929</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-30T17:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129074#M22930</link>
      <description>Works a treat thanks!</description>
      <pubDate>Wed, 30 Dec 2009 17:47:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129074#M22930</guid>
      <dc:creator>SanyHuttler</dc:creator>
      <dc:date>2009-12-30T17:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129075#M22931</link>
      <description>Late to the party again? &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;</description>
      <pubDate>Wed, 30 Dec 2009 17:50:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129075#M22931</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-12-30T17:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: set texmap_diffuse_multiplier = 0 for all scene materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129076#M22932</link>
      <description>I'm glad about that - was runnng out of ideas ;&amp;amp;#41;</description>
      <pubDate>Wed, 30 Dec 2009 17:51:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/set-texmap-diffuse-multiplier-0-for-all-scene-materials/m-p/4129076#M22932</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-12-30T17:51:31Z</dc:date>
    </item>
  </channel>
</rss>

