<?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: MaxScript Create Section with Matrix3 transform in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9140572#M7450</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/822616"&gt;@leeminardi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Not sure if this is the issue as you would probably get an error message but your snippet shows:&lt;/P&gt;&lt;PRE&gt;[p4.x,p4.y.p4.z]&lt;/PRE&gt;&lt;P&gt;instead of (comma not period between p4.y and p4.z)&lt;/P&gt;&lt;PRE&gt;[p4.x,p4.y,p4.z]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;that's just a typo error. the script contains&lt;/P&gt;&lt;PRE&gt;[p4.x, p4.y, p4.z]&lt;/PRE&gt;&lt;P&gt;I am wondering if maybe I am missing some configurations or settings of MaxScript for the new MAX project because in the old MAX project, it works.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2019 05:13:07 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-11-12T05:13:07Z</dc:date>
    <item>
      <title>MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9138397#M7448</link>
      <description>&lt;P&gt;Good day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently porting an old MAX project to a new MAX project (in VS). Part of the code is a script to be run using ExecuteMAXScriptScript(). The MaxScript basically creates a section using matrix3. Here is the snippet of the script:&lt;/P&gt;&lt;PRE&gt;s = section transform:(matrix3 [p1.x,p1.y,p1.z] [p2.x,p2.y,p2.z] [p3.x,p3.y,p3.z] [p4.x,p4.y.p4.z])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now when I run the old MAX project containing this script, it creates the Section (I check this through the Scene Explorer) with certain dimensions, vertices, curves, etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My issue is when I run this using the new MAX project, it also creates the Section but when I check its Properties, the dimensions, vertices, etc are all set to 0. I am expecting the same output as the one from the old MAX project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also checked that ExecuteMAXScriptScript() returned true which shows that the script ran successfully. Before running the script, I also double check that p1 to p4 are non-zero values. Both projects are in VS2015 and both generated plugins are loaded and tested in 3dsMax 2019.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any leads regarding this issue would be very helpful. Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 02:07:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9138397#M7448</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-11T02:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9139220#M7449</link>
      <description>&lt;P&gt;Not sure if this is the issue as you would probably get an error message but your snippet shows:&lt;/P&gt;&lt;PRE&gt;[p4.x,p4.y.p4.z]&lt;/PRE&gt;&lt;P&gt;instead of (comma not period between p4.y and p4.z)&lt;/P&gt;&lt;PRE&gt;[p4.x,p4.y,p4.z]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 13:35:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9139220#M7449</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2019-11-11T13:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9140572#M7450</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/822616"&gt;@leeminardi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Not sure if this is the issue as you would probably get an error message but your snippet shows:&lt;/P&gt;&lt;PRE&gt;[p4.x,p4.y.p4.z]&lt;/PRE&gt;&lt;P&gt;instead of (comma not period between p4.y and p4.z)&lt;/P&gt;&lt;PRE&gt;[p4.x,p4.y,p4.z]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;that's just a typo error. the script contains&lt;/P&gt;&lt;PRE&gt;[p4.x, p4.y, p4.z]&lt;/PRE&gt;&lt;P&gt;I am wondering if maybe I am missing some configurations or settings of MaxScript for the new MAX project because in the old MAX project, it works.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 05:13:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9140572#M7450</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-12T05:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9143017#M7451</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I am currently porting an old MAX project to a new MAX project (in VS). Part of the code is a script to be run using ExecuteMAXScriptScript(). The MaxScript basically creates a section using matrix3. Here is the snippet of the script:&lt;/P&gt;&lt;PRE&gt;s = section transform:(matrix3 [p1.x,p1.y,p1.z] [p2.x,p2.y,p2.z] [p3.x,p3.y,p3.z] [p4.x,p4.y.p4.z])&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Just curious what is the reason for creating a Section instance via SDK in this such an intricate way?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 04:34:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9143017#M7451</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2019-11-13T04:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9143250#M7452</link>
      <description>&lt;P&gt;As I've mentioned, we are just porting an old project to a new one. We are actually not touching much of the way they implemented the MaxScript parts in the code. But I am guessing that this was implemented this way because of the Matrix3? It seems to be the only input data to use for creating the Section. I am not very familiar with MaxScript and if you have other simpler/better ways that this can be implemented, it would be of great help and would be tremendously appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am thinking if maybe I am missing some important configurations/setup needed for MaxScript in the new VS project? Because it&amp;nbsp;just seems weird that this script is working on the old VS project and not with the new VS project. Both project plugins (old and new) are loaded and tested in 3ds Max 2019.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 08:05:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9143250#M7452</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-13T08:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9143351#M7453</link>
      <description>&lt;P&gt;Of course, you can create an instance (and node) of the &lt;STRONG&gt;Section&lt;/STRONG&gt; object and set to node the transform you need. You do not need to call MaxScript to do this.&lt;/P&gt;&lt;P&gt;You can get the &lt;STRONG&gt;сlassid&lt;/STRONG&gt; of Section class by looking at the "&lt;STRONG&gt;section.cpp&lt;/STRONG&gt;" file from the SDK examples.&lt;/P&gt;&lt;P&gt;After you know the identifier, you can create a section object using &lt;STRONG&gt;CreateInstance&lt;/STRONG&gt;.&lt;BR /&gt;After that create the node using &lt;STRONG&gt;CreateObjectNode&lt;/STRONG&gt;, and then set the transformation of this node using &lt;STRONG&gt;SetNodeTM&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;That's all&lt;/STRONG&gt;&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>Wed, 13 Nov 2019 09:10:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9143351#M7453</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2019-11-13T09:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9145506#M7454</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1634609"&gt;@denisT.MaxDoctor&lt;/a&gt;&amp;nbsp;. Thank you for your suggestion. I tried it and this is what I came up with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Object* obj = static_cast&amp;lt;Object *&amp;gt; (CreateInstance(SHAPE_CLASS_ID), Class_ID(0x20b9236d, 0x66da18aa));
INode* s = GetCOREInterface()-&amp;gt;CreateObjectNode(obj);
s-&amp;gt;SetNodeTM(GetCOREInterface()-&amp;gt;GetTime(), inputMatrix);&lt;/PRE&gt;&lt;P&gt;I used the code above in the new VS project and checked the created node through the Scene Explorer. It still has zero values for its properties (dimensions, vertices, curves, etc). I also used the code above in the old VS project and it created the node with expected properties (non-zero values).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on this observation, I believe I may be missing some initialization or configuration or setup for this section creation. But I already checked the old VS project and it contains/shows no initialization part for the section creation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any tips on where these values are usually tweaked/initialized when created as an object?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 04:20:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9145506#M7454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-14T04:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9145718#M7455</link>
      <description>&lt;P&gt;you do everything right. it remains only to set the length and width (and any other parameters that you need). so, find parameter block and use &lt;STRONG&gt;SetValue&lt;/STRONG&gt;... it needs ID. You can use &lt;STRONG&gt;NameToIndex&lt;/STRONG&gt; and &lt;STRONG&gt;IndexToID &lt;/STRONG&gt;to get parameter ID by name&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 07:51:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9145718#M7455</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2019-11-14T07:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9146960#M7456</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1634609"&gt;@denisT.MaxDoctor&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Just curious what is the reason for creating a Section instance via SDK in this such an intricate way?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It saves a lot of development time, as you otherwise would have to write a lot of C++ code for the same feature. Some MXS code lines usually need hundreds of C++ code lines. For complex tasks and when execution time does not matter, I use this approach as well. And you don't need a C++ expert. With C++ you can also better protect your MXS code.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 16:06:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9146960#M7456</guid>
      <dc:creator>A012255</dc:creator>
      <dc:date>2019-11-14T16:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9148177#M7457</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1634609"&gt;@denisT.MaxDoctor&lt;/a&gt;&amp;nbsp;. Unfortunately, there are no more parameter blocks to be used as input.&lt;/P&gt;&lt;PRE&gt;Object* obj = static_cast&amp;lt;Object *&amp;gt; (CreateInstance(SHAPE_CLASS_ID), Class_ID(0x20b9236d, 0x66da18aa));
INode* s = GetCOREInterface()-&amp;gt;CreateObjectNode(obj);
s-&amp;gt;SetNodeTM(GetCOREInterface()-&amp;gt;GetTime(), inputMatrix);&lt;/PRE&gt;&lt;P&gt;This same snippet, when built and compiled in the OLD VS project, automatically generates non-zero values for the properties (length, width, vertices, curves, etc) but when built and compiled in the NEW VS project, generates zero values for the properties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it expected that the generated node by this snippet only will have zero values for the properties? Because if it is the expected behavior, then I must really be missing some setting/initialization for object creation in the NEW VS project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already scoured/traced the code flow and cannot find any files/methods which explicitly set the values of the created object's properties (dimensions, faces, curves, vertices, etc).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any tip on where the created object's properties are usually set on in a C++ Max Utility project? I might have missed some locations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 06:33:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9148177#M7457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-15T06:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9148298#M7458</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any tip on where the created object's properties are usually set on in a C++ Max Utility project? I might have missed some locations.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;As DenisT already wrote: search for SetValue()..&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 08:05:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9148298#M7458</guid>
      <dc:creator>istan</dc:creator>
      <dc:date>2019-11-15T08:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: MaxScript Create Section with Matrix3 transform</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9148346#M7459</link>
      <description>&lt;P&gt;Section is an old Object and as many old objects it is based on IParamBlock...&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a dirty code how to make a Section node and set name, transform, width, and length:&lt;/P&gt;&lt;PRE&gt;INode* CreateSectionShapeNode(MSTR name, Matrix3 transform, float length, float width)
{
	Object* obj = (Object*)CreateInstance(SHAPE_CLASS_ID, Class_ID(0x20b9236d, 0x66da18aa));
	TimeValue t = MAXScript_time();

	ReferenceTarget* refobj = obj-&amp;gt;GetReference(1);
	if (refobj &amp;amp;&amp;amp; refobj-&amp;gt;SuperClassID() == PARAMETER_BLOCK_CLASS_ID) 
	{
		IParamBlock* pb = (IParamBlock*)refobj;
		pb-&amp;gt;SetValue(0, t, length);  //PB_LENGTH
		pb-&amp;gt;SetValue(1, t, width); //PB_WIDTH
	}

	INode* node = GetCOREInterface7()-&amp;gt;CreateObjectNode(obj, name);
	node-&amp;gt;SetNodeTM(t, transform);

	obj-&amp;gt;NotifyDependents(FOREVER,PART_ALL,REFMSG_CHANGE); 

	return node;
}&lt;/PRE&gt;&lt;P&gt;it shows all basic and necessary steps to make a Section. Use it as a quick test&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 08:45:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-create-section-with-matrix3-transform/m-p/9148346#M7459</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2019-11-15T08:45:20Z</dc:date>
    </item>
  </channel>
</rss>

