<?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 GetPoint from trimesh in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/getpoint-from-trimesh/m-p/6043798#M14765</link>
    <description>&lt;P&gt;For the life of me i can't figure this out. Could someone help me out here. All i want to do is loop through a node and collect the vertex positions. However it keeps crashing 3ds max. Why is this?&lt;/P&gt;&lt;P&gt;The line causing the crash is &lt;STRONG&gt;Point3 pt = triObj-&amp;gt;GetPoint(vtx)&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;not sure why though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void TestModifier::ModifyObject(TimeValue t, ModContext &amp;amp;mc, ObjectState *os, INode *node) 
{
	Object* obj = os-&amp;gt;obj;

	if(!obj-&amp;gt;CanConvertToType(triObjectClassID))
        return;

	TriObject *triObj = (TriObject *) obj-&amp;gt;ConvertToType(t,triObjectClassID);

	// Go through the faces and print vertex position
    for (int i=0; i&amp;lt;triObj-&amp;gt;mesh.numFaces; i++) {

        for (int j=0; j&amp;lt;3; j++) {
            int vtx = triObj-&amp;gt;mesh.faces[i].getVert(j);
			Point3 pt = triObj-&amp;gt;GetPoint(vtx);
			ScriptPrint(_T("Vert Pos: %\n"), pt);
            ScriptPrint(_T("Vert Index: %d\n"), vtx);
        }
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Feb 2016 17:37:17 GMT</pubDate>
    <dc:creator>JokerMartini23</dc:creator>
    <dc:date>2016-02-17T17:37:17Z</dc:date>
    <item>
      <title>GetPoint from trimesh</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/getpoint-from-trimesh/m-p/6043798#M14765</link>
      <description>&lt;P&gt;For the life of me i can't figure this out. Could someone help me out here. All i want to do is loop through a node and collect the vertex positions. However it keeps crashing 3ds max. Why is this?&lt;/P&gt;&lt;P&gt;The line causing the crash is &lt;STRONG&gt;Point3 pt = triObj-&amp;gt;GetPoint(vtx)&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;not sure why though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void TestModifier::ModifyObject(TimeValue t, ModContext &amp;amp;mc, ObjectState *os, INode *node) 
{
	Object* obj = os-&amp;gt;obj;

	if(!obj-&amp;gt;CanConvertToType(triObjectClassID))
        return;

	TriObject *triObj = (TriObject *) obj-&amp;gt;ConvertToType(t,triObjectClassID);

	// Go through the faces and print vertex position
    for (int i=0; i&amp;lt;triObj-&amp;gt;mesh.numFaces; i++) {

        for (int j=0; j&amp;lt;3; j++) {
            int vtx = triObj-&amp;gt;mesh.faces[i].getVert(j);
			Point3 pt = triObj-&amp;gt;GetPoint(vtx);
			ScriptPrint(_T("Vert Pos: %\n"), pt);
            ScriptPrint(_T("Vert Index: %d\n"), vtx);
        }
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 17:37:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/getpoint-from-trimesh/m-p/6043798#M14765</guid>
      <dc:creator>JokerMartini23</dc:creator>
      <dc:date>2016-02-17T17:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: GetPoint from trimesh</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/getpoint-from-trimesh/m-p/6044420#M14766</link>
      <description>&lt;P&gt;What line does it crash on? &amp;nbsp;When a C++ plugin crashes, having a debugger attached will normally tell you all you need to know to understand why its crashing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code as posted looks fine, I can't see (from a very cursory inspection)&amp;nbsp;why&amp;nbsp;it would fail.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 22:59:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/getpoint-from-trimesh/m-p/6044420#M14766</guid>
      <dc:creator>Stephen_Taylor</dc:creator>
      <dc:date>2016-02-17T22:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: GetPoint from trimesh</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/getpoint-from-trimesh/m-p/6044427#M14767</link>
      <description>&lt;P&gt;Oops - didn't read the question quite well enough.&lt;BR /&gt;&lt;BR /&gt;The reason its seems most likely to be because of an invalid index. What is the value of vtx at this line of code?&lt;BR /&gt;&lt;BR /&gt;Note that the GetPoint function isn't really setup to be used like this. If you iterate through the faces you will process some verts multiple times (faces share verts). Just iterate from 0 -&amp;gt; NumPoints and you will process each vert once.&lt;BR /&gt;&lt;BR /&gt;Also - you mixing functions for a deformable object with functions for mesh processing. That should work, a mesh is a deformable object, but they aren't&amp;nbsp;really the same concept. If you are going to work with the mesh, just access verts directly off the mesh. If your using the functions for deformers, just use the functions for deformers.&lt;BR /&gt;&lt;BR /&gt;Hope that helps!&lt;BR /&gt;Steve&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 23:08:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/getpoint-from-trimesh/m-p/6044427#M14767</guid>
      <dc:creator>Stephen_Taylor</dc:creator>
      <dc:date>2016-02-17T23:08:26Z</dc:date>
    </item>
  </channel>
</rss>

