<?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: Reading text files in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125190#M23110</link>
    <description>It's getting a bit big to keep posting inline, so I attached the script instead.&lt;BR /&gt;&lt;BR /&gt;It does work, though I've not done all the attributes and I've not addressed the "compound" section at all.&lt;BR /&gt;&lt;BR /&gt;A few things to note.&lt;BR /&gt;&lt;BR /&gt;Try to give variables names which represent their contents. Your original "colname" isn't a name - it's a FileStream value returned from openFile, so I changed it to "colStream".&lt;BR /&gt;&lt;BR /&gt;Be careful choosing variable names - "line" is the constructor for an Editable Spline object, I renamed it to "inputLine".&lt;BR /&gt;&lt;BR /&gt;You can't test the incoming lines like you were, unless the value, "mass" for example, is at the beginning of the line. "   abc" does not equal "abc". The filterString function splits the "words" on a line into array elements making life a lot easier.&lt;P&gt;&lt;A class="migr-att-link" href="http://area.autodesk.com/userdata/forum/i/import_file.ms.zip" target="_blank"&gt;import_file.ms.zip&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 29 Nov 2009 17:03:48 GMT</pubDate>
    <dc:creator>Steve_Curley</dc:creator>
    <dc:date>2009-11-29T17:03:48Z</dc:date>
    <item>
      <title>Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125186#M23106</link>
      <description>Hello there! I need some help with reading some text files with maxscript, as I don't know how to do this. This is the structure of the file I want to read:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;attributes {&lt;BR /&gt;atrib1 float;&lt;BR /&gt;atrib2 float;&lt;BR /&gt;etc...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;compound {&lt;BR /&gt;        sphere {&lt;BR /&gt;                centre 0 0 0;&lt;BR /&gt;                radius .15&lt;BR /&gt;        }&lt;BR /&gt;}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;I got to this part where I don't know how to read the different atributes&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;on imp pressed do &amp;amp;#40;&lt;BR /&gt; colopenname = getOpenFileName caption:"Open file" types:"file &amp;amp;#40;*.tcol&amp;amp;#41;|*.tcol|"&lt;BR /&gt; colname = openfile colopenname&lt;BR /&gt; if colname != undefined do&lt;BR /&gt; &amp;amp;#40;&lt;BR /&gt; while not eof colname do&lt;BR /&gt;     &amp;amp;#40;&lt;BR /&gt;         line = readLine colname --We start reading the file&lt;BR /&gt;         if line == "TCOL1.0" do&lt;BR /&gt;         &amp;amp;#40;&lt;BR /&gt;             format "TCOL 1.0\nStarted TCOL import\nName: %\n" colopenname to:listener&lt;BR /&gt;         continue&lt;BR /&gt;         &amp;amp;#41;&lt;BR /&gt; &lt;BR /&gt; line = readLine colname&lt;BR /&gt;         if line == "attributes {" do&lt;BR /&gt;         &amp;amp;#40;&lt;BR /&gt;             format "Importing atributes\n" to:listener&lt;BR /&gt; continue&lt;BR /&gt; if line == "mass" do &amp;amp;#40;&lt;BR /&gt; massv = args as float&lt;BR /&gt; smass.value massv&lt;BR /&gt; format "Mass: %\n" massv to:listener&lt;BR /&gt; continue&lt;BR /&gt; &amp;amp;#41;&lt;BR /&gt;         continue&lt;BR /&gt;         &amp;amp;#41;&lt;BR /&gt; &lt;BR /&gt;         if line == "}" do &lt;BR /&gt;         &amp;amp;#40;&lt;BR /&gt;             format "Finish\n" to:listener &lt;BR /&gt;             continue&lt;BR /&gt;         &amp;amp;#41;&lt;BR /&gt; &amp;amp;#41;&lt;BR /&gt; &amp;amp;#41; &lt;BR /&gt; &amp;amp;#41;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;I can't get it to load one of the attributes &amp;amp;#40;mass for example&amp;amp;#41;. I hope you can help me, or point me in the good direction!</description>
      <pubDate>Sun, 29 Nov 2009 12:38:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125186#M23106</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-11-29T12:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125187#M23107</link>
      <description>It would help if you provided the whole of the import file. You're testing for a "TCOL" line which isn't shown, referencing "Mass" which isn't shown and using Args  which isn't defined in the provided code.&lt;BR /&gt;&lt;BR /&gt;I hope it's the forum which has messed with the layout of that code because it's difficult to read as-is. Consistent indentation helps enormously in cases like this.&lt;BR /&gt;&lt;BR /&gt;First off, assuming that the "TCOL" line is at the beginning of the import file, then that code cannot work.&lt;BR /&gt;You read a line, test for "TCOL" and if true jump to the while statement &amp;amp;#40;because of the continue&amp;amp;#41;.&lt;BR /&gt;That reads the next line, the test for "TCOL" fails, the next line of code reads another line from the file, thus skipping the "Attributes" line entirely.&lt;BR /&gt;&lt;BR /&gt;Assuming it ever found an "Attributes" line, it prints the attribute text then goes around the loop &amp;amp;#40;continue&amp;amp;#41; - there seems to be a missing closing parenthesis after that continue, which consistent indentation shows up quite clearly. Syntactically the "if line == "mass"" is contained within the "if line == "atributes"" &amp;amp;#40;because of the missing "&amp;amp;#41;" &amp;amp;#41;and so can never execute &amp;amp;#40;the continue kicks it back to the while loop&amp;amp;#41;. Effectively you have a "statement cannot be reached" error &amp;amp;#40;though MXS doesn't report that kind of error&amp;amp;#41;.&lt;BR /&gt;&lt;BR /&gt;There also seems to be an erroneous continue and &amp;amp;#41; after the "Mass" block - in that position you are terminating the loop - the entire code will cycle to EOF and the "if line == "&amp;amp;#41;"" will never get executed &amp;amp;#40;with a line from the file, only after an EOF&amp;amp;#41;.&lt;BR /&gt;&lt;BR /&gt;This is what I &lt;I&gt;think&lt;/I&gt; it should look like, but without the whole import file I'm just guessing at some things.&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;on imp pressed do&lt;BR /&gt;   &amp;amp;#40;&lt;BR /&gt;   colopenname = getOpenFileName caption:"Open file" types:"file &amp;amp;#40;*.tcol&amp;amp;#41;|*.tcol|"&lt;BR /&gt;   colname = openfile colopenname&lt;BR /&gt;   if colname != undefined do&lt;BR /&gt;      &amp;amp;#40;&lt;BR /&gt;      while not eof colname do&lt;BR /&gt;         &amp;amp;#40;&lt;BR /&gt;         line = readLine colname --We start reading the file&lt;BR /&gt;         if line == "TCOL1.0" do&lt;BR /&gt;            &amp;amp;#40;&lt;BR /&gt;            format "TCOL 1.0\nStarted TCOL import\nName: %\n" colopenname to:listener&lt;BR /&gt;            continue&lt;BR /&gt;            &amp;amp;#41;&lt;BR /&gt; &lt;BR /&gt;--       this line should not be here &lt;BR /&gt;--       line = readLine colname&lt;BR /&gt;         if line == "attributes {" do&lt;BR /&gt;            &amp;amp;#40;&lt;BR /&gt;            format "Importing atributes\n" to:listener&lt;BR /&gt;            continue&lt;BR /&gt;            &amp;amp;#41; -- this line is missing&lt;BR /&gt;            &lt;BR /&gt;         if line == "mass" do&lt;BR /&gt;            &amp;amp;#40;&lt;BR /&gt;            massv = args as float -- what is args ????&lt;BR /&gt;            smass.value massv -- ???&lt;BR /&gt;            format "Mass: %\n" massv to:listener&lt;BR /&gt;            continue&lt;BR /&gt;            &amp;amp;#41;&lt;BR /&gt;&lt;BR /&gt;--         continue -- i don't know what this is doing here '&lt;BR /&gt;--         &amp;amp;#41; -- this would terminate the while loop&lt;BR /&gt; &lt;BR /&gt;         if line == "}" do &lt;BR /&gt;            &amp;amp;#40;&lt;BR /&gt;            format "Finish\n" to:listener &lt;BR /&gt;            continue&lt;BR /&gt;            &amp;amp;#41;&lt;BR /&gt; &lt;BR /&gt;         &amp;amp;#41; -- this ends the While loop&lt;BR /&gt;      &amp;amp;#41; -- this ends the "if colname" test&lt;BR /&gt;   &amp;amp;#41; -- this ends the function&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Nov 2009 13:51:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125187#M23107</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-11-29T13:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125188#M23108</link>
      <description>Right, first of all, thank you for posting! &lt;BR /&gt;&lt;BR /&gt;By the import file, you mean one example of the file I want to import, right? Here is one:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;TCOL1.0&lt;BR /&gt;&lt;BR /&gt;attributes {&lt;BR /&gt;        mass 100;&lt;BR /&gt;        friction 0.15;&lt;BR /&gt;        linear_damping 0;&lt;BR /&gt;        angular_damping 0.1;&lt;BR /&gt;        linear_sleep_threshold 0.1;&lt;BR /&gt;        angular_sleep_threshold 0.1;&lt;BR /&gt;        ccd_motion_threshold 0.5;&lt;BR /&gt;        ccd_swept_sphere_radius 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;compound {&lt;BR /&gt;        sphere {&lt;BR /&gt;                centre 0 0 0;&lt;BR /&gt;                radius 0.5;&lt;BR /&gt;        }&lt;BR /&gt;}&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;This is just a simple example, there can be different primitives in the compound &amp;amp;#40;box, cones, etc&amp;amp;#41; and also there is a triangle mesh involved &amp;amp;#40;with a number of vertex and faces, but i'm leaving that... need first to be able to import the easy thing&amp;amp;#41;&lt;BR /&gt;&lt;BR /&gt;I wasn't sure about how to do that &amp;amp;#40;I'm nowhere near a programmer, just trying to learn and supposing things&amp;amp;#41;. So let me explain my idea &amp;amp;#40;that I know now that is wrong, heh..&amp;amp;#41;&lt;BR /&gt;&lt;BR /&gt;the script would read the file, if it found the 'attributes' line then it would find attributes, for example 'mass' &amp;amp;#40;there are more attributes, I just wanted to try with one&amp;amp;#41; and change a spinner value with the float of the file, and continue to other lines. &lt;BR /&gt;&lt;BR /&gt;Again, thank you!</description>
      <pubDate>Sun, 29 Nov 2009 14:59:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125188#M23108</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-11-29T14:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125189#M23109</link>
      <description>A few questions.&lt;BR /&gt;&lt;BR /&gt;Which version of Max? Just in case it makes any difference to the coding &amp;amp;#40;it can do, sometimes&amp;amp;#41;.&lt;BR /&gt;&lt;BR /&gt;Are the Attributes fixed? i.e. are there always the same number of them and do they always have the same names?&lt;BR /&gt;&lt;BR /&gt;Is the format of that file fixed? It would be a lot easier to code if we knew the object type &lt;I&gt;before&lt;/I&gt; finding the attributes - especially if different objects have different &amp;amp;#40;names and number of&amp;amp;#41; atttributes.</description>
      <pubDate>Sun, 29 Nov 2009 16:13:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125189#M23109</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-11-29T16:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125190#M23110</link>
      <description>It's getting a bit big to keep posting inline, so I attached the script instead.&lt;BR /&gt;&lt;BR /&gt;It does work, though I've not done all the attributes and I've not addressed the "compound" section at all.&lt;BR /&gt;&lt;BR /&gt;A few things to note.&lt;BR /&gt;&lt;BR /&gt;Try to give variables names which represent their contents. Your original "colname" isn't a name - it's a FileStream value returned from openFile, so I changed it to "colStream".&lt;BR /&gt;&lt;BR /&gt;Be careful choosing variable names - "line" is the constructor for an Editable Spline object, I renamed it to "inputLine".&lt;BR /&gt;&lt;BR /&gt;You can't test the incoming lines like you were, unless the value, "mass" for example, is at the beginning of the line. "   abc" does not equal "abc". The filterString function splits the "words" on a line into array elements making life a lot easier.&lt;P&gt;&lt;A class="migr-att-link" href="http://area.autodesk.com/userdata/forum/i/import_file.ms.zip" target="_blank"&gt;import_file.ms.zip&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Nov 2009 17:03:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125190#M23110</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-11-29T17:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125191#M23111</link>
      <description>3D Max 2009, and I guess 2010 in the future.&lt;BR /&gt;&lt;BR /&gt;The attributes are fixed, yeah&lt;BR /&gt;&lt;BR /&gt;About the format, I'm not sure if you understood how the file works, but the attributes are global for the file. This file is a collision file, that can have primitives and triangular meshes, the attributes are global for the file.&lt;BR /&gt;&lt;BR /&gt;while thinking how to make the script, I didn't know how to save the attributes, normally I would use the properties of the object but as the file is usually made of more than one object, I think without going to complex you can't save the attributes, so I only want them to import and change the spinners.&lt;BR /&gt;&lt;BR /&gt;Edit: thank you! I understand all you posted from this second post :&amp;amp;#41; I'm going to try the script when I can. thank you, again :&amp;amp;#41;&lt;BR /&gt;&lt;BR /&gt;Edit2: Now that I've read your script, I understand it and got it to work :&amp;amp;#41; The next problem is with the compound part, as when if it finds, for example, a sphere, inside the next brace there will be its properties &amp;amp;#40;coordinates, radius..&amp;amp;#41;... I'm not sure how to make that work &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;</description>
      <pubDate>Sun, 29 Nov 2009 17:21:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125191#M23111</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-11-29T17:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125192#M23112</link>
      <description>Anyone can help with the compounds? I'm stuck at how to make it read the attributes of a primitive inside a brace &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Also, another part that I need to read is a triangle mesh, an array of vertex and faces, here is a simple one, a plane:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;trimesh {&lt;BR /&gt;    vertexes {&lt;BR /&gt;        -690.66  345.33 0;&lt;BR /&gt;         690.66  345.33 0;&lt;BR /&gt;        -690.66 -345.33 0;&lt;BR /&gt;         690.66 -345.33 0;&lt;BR /&gt;    }&lt;BR /&gt;    faces {&lt;BR /&gt;        0 1 3 0x0;&lt;BR /&gt;        0 3 2 0x0;&lt;BR /&gt;    }&lt;BR /&gt;}&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 Dec 2009 11:37:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125192#M23112</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-06T11:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125193#M23113</link>
      <description>Firstly, this is a rather ambitious project if you aren't fully conversant with Maxscript in particular, and programming in general. Reading strings/values from files is a fairly basic procedure, creating &amp;amp;#40;presumably&amp;amp;#41; a mesh object from the vertices/faces read from the file is less basic. It is, however, covered fairly well in the Maxscript help &amp;amp;#40;as are most things&amp;amp;#41; - I assume that's what you want to do - create objects based on the file data?&lt;BR /&gt;&lt;BR /&gt;There are problems with your current import file - the vertex numbers &amp;amp;#40;for the faces&amp;amp;#41; are 0 based, but Max requires them to be 1 based.&lt;BR /&gt;0 3 2 must be 1 4 3. This would be best corrected in whatever created the file, or it could be accounted for by the script, but one or the other needs to be done. I cheated and changed the file ;&amp;amp;#41;&lt;BR /&gt;Also, I don't know what the "0x0"s are doing there - I ignored them.&lt;BR /&gt;&lt;BR /&gt;You could deal with other object types in their own routines as I've done for the TriMesh.&lt;BR /&gt;&lt;BR /&gt;Note. There may well be, probably are, better ways to do all this but you need someone with more MXS experience than I have to tell you what they are.&lt;P&gt;&lt;A class="migr-att-link" href="http://area.autodesk.com/userdata/forum/i/import_file_v2.zip" target="_blank"&gt;import_file_v2.zip&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2009 16:03:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125193#M23113</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-12-06T16:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125194#M23114</link>
      <description>Right, thanks. I'm aware of the ambition of this script, but I needed it for a project and I decided to try and get it to work, seems like I'm near finishing it with your help, hehe.&lt;BR /&gt;&lt;BR /&gt;I found the help in the maxscript about writting and exporting data after I read your post - my bad, I should have looked better. I was aware there was help on creating objects using vertexes and faces array, but nothing about reading them.&lt;BR /&gt;&lt;BR /&gt;About the vertex number problem, I solved it by just adding +1 to every vertex, I think that should do the work :&amp;amp;#41;&lt;BR /&gt;&lt;BR /&gt;I've finished almost everything, but there is a small problem now, with exporting the trimesh. I followed the How to example and got it to work, but the problem is that it is following a different syntax than the file I use, for example:&lt;BR /&gt;&lt;BR /&gt;Should be, for the vertexes&lt;BR /&gt;&lt;BR /&gt;0.254432 0.237778 0.368192;&lt;BR /&gt;but It exports&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;and with faces:&lt;BR /&gt;&lt;BR /&gt;0 1 2 0x2;&lt;BR /&gt; 0x2;&lt;BR /&gt;&lt;BR /&gt;I don't know what to search for, or how is that called.&lt;BR /&gt;&lt;BR /&gt;Another two small thing, first how could I check if a selected object is a editable poly or a mesh? and second, though this is more of a bonus, how could I do commented out lines such as /* to */ &amp;amp;#40;different lines&amp;amp;#41;?</description>
      <pubDate>Mon, 07 Dec 2009 17:18:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125194#M23114</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-07T17:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125195#M23115</link>
      <description>The  format is a point3 value - it could be read using the readValue statement, but that will mess up the existing routines somewhat. &lt;BR /&gt;If you look up the mesh constructor it needs "vertices: faces:" which is why the sample code writes them out that way.&lt;BR /&gt;&lt;BR /&gt;As for the comments, if they are on lines on their own like&lt;BR /&gt;/*&lt;BR /&gt;line&lt;BR /&gt;line&lt;BR /&gt;*/&lt;BR /&gt;Then treat it like any other entity - when you find the opening one call a function which does nothing but read lines until it finds the close of it.&lt;BR /&gt;&lt;BR /&gt;For the geometry type, use the "classof" function.</description>
      <pubDate>Mon, 07 Dec 2009 18:59:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125195#M23115</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-12-07T18:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125196#M23116</link>
      <description>Ignore the 0x2, they are the materials IDs set in hex, I'm not thinking in supporting them by now&lt;BR /&gt;&lt;BR /&gt;Edit. I got how to do the vertex, but I'm not sure how to write out the face's vertex order as 0 0 0; instead of ;&lt;BR /&gt;&lt;BR /&gt;Right, I got the classof function. I was using it for the objects, but I didn't know Editable_poly was a class itself. &lt;BR /&gt;&lt;BR /&gt;another small thing... a If statement can have two possibilities: If Classof == editable_mesh or editable_poly ?</description>
      <pubDate>Mon, 07 Dec 2009 19:39:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125196#M23116</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-07T19:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125197#M23117</link>
      <description>Just write them out without the square brackets. They are coming out that way &amp;amp;#40;in the How To code&amp;amp;#41; because it is printing the vertex position as a single point3 value. To print them separately, get the point3 value then print the x, y and z portions separately.&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;format "%, %, %;\n" vert.x vert.y vert.z&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Not quite - yes you can test 2 things in an if, but not without calling the function twice &amp;amp;#40;unless you assign it to a variable&amp;amp;#41;.&lt;BR /&gt;&lt;PRE&gt; if &amp;amp;#40;classof object == Editable_Mesh or classof object == Editable_Poly&amp;amp;#41; then... &lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Dec 2009 19:55:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125197#M23117</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-12-07T19:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125198#M23118</link>
      <description>Right, I finished the script, thanks again. I'm adding now another function where I need to access the property of a material assigned to face. I've done it with the primitives easily, but I can't find how to get the material name of a face, only its ID... trying searching the maxscript help and only found results about the ID &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;</description>
      <pubDate>Mon, 14 Dec 2009 17:41:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125198#M23118</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-14T17:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reading text files</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125199#M23119</link>
      <description>The Material ID &amp;amp;#40;of a poly&amp;amp;#41; is an index into an array which contains an index into the array of sub-materials which form a Multi SubObject Material. No, that isn't gibberish - it is "double-indexed". This is because MatID 3 doesn't have to be the third sub-material in the list &amp;amp;#40;as an example&amp;amp;#41;.&lt;BR /&gt;You can see the effect of this in the image - ID3 is not the 3rd in the list, but the 6th.&lt;P&gt;&lt;IMG class="migr-att-link" src="http://area.autodesk.com/userdata/forum/m/multisubindexes_1.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2009 19:41:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reading-text-files/m-p/4125199#M23119</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2009-12-14T19:41:50Z</dc:date>
    </item>
  </channel>
</rss>

