<?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: Format a material to a MS script? in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/format-a-material-to-a-ms-script/m-p/4585215#M16587</link>
    <description>&lt;P&gt;Why you not save the material as *.mat file? I mean to export the material as material library?&lt;/P&gt;&lt;P&gt;I don't know an easy way to get all props of the givven material. For example in diffuse slot you can have Cellular map, the Cell color can be Fallof map, the fallof map cen be.... and deeper and deeper.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2013 22:06:36 GMT</pubDate>
    <dc:creator>miauuuu</dc:creator>
    <dc:date>2013-11-01T22:06:36Z</dc:date>
    <item>
      <title>Format a material to a MS script?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/format-a-material-to-a-ms-script/m-p/4577647#M16586</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have got a script to write(format) a file from the material in the active slot.&lt;/P&gt;&lt;P&gt;This way I have material definitions which I can execute from other scripts&lt;/P&gt;&lt;P&gt;All good but my issue is I cant work out where to start to do it as a loop so I pick up all parametres.&amp;nbsp;&lt;SPAN&gt;I can do it one by one...but for obvious reasons this is very clumsy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;theMat_Diffuse = theMat.Diffuse&lt;BR /&gt;theMat_Diffuse = theMat_Diffuse as string&lt;BR /&gt;map_str1 = "meditMaterials" + "[" + current_slot + "]" +&amp;nbsp;&amp;nbsp;".Diffuse "+ "= " + theMat_Diffuse&lt;BR /&gt;format map_str1 to:mat_file&lt;BR /&gt;FORMAT INI_BREAK to:mat_file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;then I repeat it ...you can see the dumb ugly code attached- it aint pretty!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to loop &amp;amp; &amp;nbsp;pick up the properties and the value of the material and any maps without coding things so badly? I have spent hours trying to get a loop that will work and I am getting no where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2013 04:54:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/format-a-material-to-a-ms-script/m-p/4577647#M16586</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-31T04:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Format a material to a MS script?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/format-a-material-to-a-ms-script/m-p/4585215#M16587</link>
      <description>&lt;P&gt;Why you not save the material as *.mat file? I mean to export the material as material library?&lt;/P&gt;&lt;P&gt;I don't know an easy way to get all props of the givven material. For example in diffuse slot you can have Cellular map, the Cell color can be Fallof map, the fallof map cen be.... and deeper and deeper.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 22:06:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/format-a-material-to-a-ms-script/m-p/4585215#M16587</guid>
      <dc:creator>miauuuu</dc:creator>
      <dc:date>2013-11-01T22:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Format a material to a MS script?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/format-a-material-to-a-ms-script/m-p/4590393#M16588</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This topic was escalated to Salesforce.&lt;/P&gt;
&lt;P&gt;Do you still&amp;nbsp;need further assistance? Because one friend suggeted to save the material as *.mat file. Is this working for you?&lt;BR /&gt;As far I read you script, it is not bad.&lt;/P&gt;
&lt;P&gt;If you need to evaluate all materials in your scene, I think the scenematerials would be helpful&amp;nbsp;like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;for i=1 to scenematerials.count do&lt;BR /&gt;&amp;nbsp;(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;if (classof scenematerials[i] == Multimaterial ) then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for j=1 to scenematerials[i].numsubs do&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;function scenematerials[i][j]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;else if (classof scenematerials[i] == compositeMaterial ) then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for j=1 to matList.count do&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (matList[j] != undefined) then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;function matList[j]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;)&lt;BR /&gt;&amp;nbsp;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an old collada maxscript exporter. I can sent it for you, if you are interested in it.&lt;BR /&gt;Please let me know.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2013 05:57:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/format-a-material-to-a-ms-script/m-p/4590393#M16588</guid>
      <dc:creator>akira.kudo</dc:creator>
      <dc:date>2013-11-05T05:57:18Z</dc:date>
    </item>
  </channel>
</rss>

