<?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 Betreff: Reset object and remove mesh normals? in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911669#M1112</link>
    <description>&lt;P&gt;Now in the context of the improvements made to preserving specified normals in several modifiers, we should probably consider the work of the Welder as a bug and report it as a bug&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jul 2024 08:30:00 GMT</pubDate>
    <dc:creator>denisT.MaxDoctor</dc:creator>
    <dc:date>2024-07-22T08:30:00Z</dc:date>
    <item>
      <title>Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12740340#M1098</link>
      <description>&lt;P&gt;I have a script that I use to reset objects, so all transforms and normals are removed from a mesh.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been using the code snippet below in Max 2021, which works fine. But it doesn't seem to work in 2024, the explicit normals aren't removed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know of a foolproof way to remove mesh normals from a mesh, that ideally doesn't require me to be in the modify panel, so I could use it even if the Max interface isn't active.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, is there is another way to reset and object that I don't know of?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(
	local myArray = getCurrentSelection()
	for obj in myArray do (
		convertTo obj PolyMeshObject

		-- Adding a 'Mesh_Select' and disable it in rendering.
		local newMeshSelect = Mesh_Select()
		addModifier obj newMeshSelect
		newMeshSelect.enabledInRenders = false

		-- Add 2x Normal Modifiers on top.
		addModifier obj (Normalmodifier())
		addModifier obj (Normalmodifier())

		-- The method I would like to avoid using
		-- Requires the UI to be active in the Modify panel
		local newEditNormals = Edit_Normals()
		addModifier obj newEditNormals
		select obj
		local normCount = newEditNormals.EditNormalsMod.GetNumNormals()
		local normArray = #{ 1..normCount }
		newEditNormals.EditNormalsMod.SelLevel = #object -- Exit sub-object level
		newEditNormals.EditNormalsMod.Reset selection:normArray -- Edit Normals Reset

		-- ResetXForm with PreserverNormals off
		-- Doesn't seem to make a difference
		ResetXForm obj
		obj.modifiers[1].PreserveNormals = false

		convertTo obj PolyMeshObject

		-- Create an empty object and attach the 'obj'
		local tempSpline = line()
		convertTo tempSpline PolyMeshObject
		tempSpline.EditablePoly.attach obj tempSpline
		convertTo tempSpline PolyMeshObject
	)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 08:04:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12740340#M1098</guid>
      <dc:creator>KasperFilipsen</dc:creator>
      <dc:date>2024-04-29T08:04:25Z</dc:date>
    </item>
    <item>
      <title>Betreff: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12909540#M1099</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure I entirely understand your issue but the Edit_Normals modifier is the place to go for modifying normals, and ironically the Autodesk developers have gone to great lengths to make sure explicit normals do not get reset by the various modifiers, like in the old days where a "Turn to Poly" would recalculate all normals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code does multiple things but if I focus only on the normals aspect, this code snippet seems to do the job for me:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;fn resetNormals theNode = (
	local m = Edit_Normals()
	addModifier theNode m
	
	select theNode
	max modify mode
	
	local normCount = m.EditNormalsMod.GetNumNormals()
	m.EditNormalsMod.SetSelection #{1..normCount}
	m.EditNormalsMod.Reset()
	convertTo theNode Editable_Poly
)&lt;/LI-CODE&gt;
&lt;P&gt;... which is fairly similar to what you already have, but as you wrote in your message (and your code comment), this does indeed include to switch to Modify mode, with the object selected, which can be rather slow. But as far as I know that is a limitation of the Edit_Normals modifier.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 15:12:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12909540#M1099</guid>
      <dc:creator>MartinBeh</dc:creator>
      <dc:date>2024-07-20T15:12:00Z</dc:date>
    </item>
    <item>
      <title>Betreff: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12909553#M1100</link>
      <description>&lt;P&gt;Short update:&lt;/P&gt;
&lt;P&gt;Here is a fast way to nuke all the normals. It might be a tiny bit dangerous if you have some geometry with unwelded vertices but otherwise it seems fast and does not need the Modify panel &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;fn killExplicitNormals theNode = (
	addModifier theNode (Vertex_Weld threshold:0.0)
	convertTo theNode Editable_Poly
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does that solve your problem?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 15:18:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12909553#M1100</guid>
      <dc:creator>MartinBeh</dc:creator>
      <dc:date>2024-07-20T15:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12910254#M1101</link>
      <description>&lt;P&gt;the Turn To Poly Modifier doesn't support (or never used to) expilicit normals so will remove them and as you're converting to editable poly anyway.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2024 07:09:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12910254#M1101</guid>
      <dc:creator>klvnk</dc:creator>
      <dc:date>2024-07-21T07:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12910258#M1102</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1794911"&gt;@klvnk&lt;/a&gt;&amp;nbsp; schrieb:&lt;BR /&gt;
&lt;P&gt;the Turn To Poly Modifier doesn't support (or never used to) expilicit normals so will remove them and as you're converting to editable poly anyway.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This works for older versions of 3ds Max but as far as I remember this was fixed with the newest releases of 3ds Max, so Turn To Poly (and most other modifiers) will not longer invalidate explicit normals.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2024 07:14:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12910258#M1102</guid>
      <dc:creator>MartinBeh</dc:creator>
      <dc:date>2024-07-21T07:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12910276#M1103</link>
      <description>&lt;P&gt;&lt;SPAN&gt;We know what you want to remove(reset) - transforms and specified normals. The question is, what do you want to keep? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2024 07:38:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12910276#M1103</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-21T07:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12910279#M1104</link>
      <description>&lt;P&gt;&lt;EM&gt;deleted&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2024 07:42:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12910279#M1104</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-21T07:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12910288#M1105</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;nbsp;but as far as I remember this was fixed with the newest releases of 3ds Max&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;looking at the source code between 2010 and 2025 there is no difference, but should be pretty easy to for someone with 2023/24/25 to&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;check. It still strips explicit normals in 2020 btw.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2024 08:04:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12910288#M1105</guid>
      <dc:creator>klvnk</dc:creator>
      <dc:date>2024-07-21T08:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911384#M1106</link>
      <description>&lt;P&gt;MAX 2023 ... the Turn to Poly preserves specified normal now. There is no option to reset&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 05:29:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911384#M1106</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-22T05:29:57Z</dc:date>
    </item>
    <item>
      <title>Betreff: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911387#M1107</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/369352"&gt;@MartinBeh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;fn killExplicitNormals theNode = (
	addModifier theNode (Vertex_Weld threshold:0.0)
	convertTo theNode Editable_Poly
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does that solve your problem?&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course, that can't be the solution. It just welds normals, which is no close to reset.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 05:34:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911387#M1107</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-22T05:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911437#M1108</link>
      <description>&lt;LI-CODE lang="general"&gt;g = (dotnetclass "autodesk.max.globalinterface").instance
inode = g.COREInterface14.GetINodeByHandle $.inode.handle
obj = (inode.EvalWorldState g.COREInterface.Time true).Obj
obj.Mesh__TriObject.ClearSpecifiedNormals()
update $&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 22 Jul 2024 06:03:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911437#M1108</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-22T06:03:22Z</dc:date>
    </item>
    <item>
      <title>Betreff: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911461#M1109</link>
      <description>&lt;P&gt;&lt;EM&gt;MAX 2023 ... the Turn to Poly preserves specified normal now. There is no option to reset&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;yeah looks like it's been added to the MNMesh&amp;nbsp;Copy assignment operator and AddTri i guess.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 06:18:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911461#M1109</guid>
      <dc:creator>klvnk</dc:creator>
      <dc:date>2024-07-22T06:18:02Z</dc:date>
    </item>
    <item>
      <title>Betreff: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911566#M1110</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; schrieb:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/369352"&gt;@MartinBeh&lt;/a&gt;&amp;nbsp;wrote:&lt;/BLOCKQUOTE&gt;
&lt;LI-CODE lang="general"&gt;fn killExplicitNormals theNode = (
	addModifier theNode (Vertex_Weld threshold:0.0)
	convertTo theNode Editable_Poly
)&lt;/LI-CODE&gt;
&lt;P&gt;Does that solve your problem?&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, that can't be the solution. It just welds normals, which is no close to reset.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir="ltr"&gt;Of course it is a hack, but I am not seeing it "welding normals", rather welding vertices (at zero distance threshold) and recomputing normals. And isn't that what is needed here?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mbreidt_0-1721632517136.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1389380iFE9851918F336A04/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mbreidt_0-1721632517136.png" alt="mbreidt_0-1721632517136.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mbreidt_1-1721633023965.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1389383i35D816DFBE391A92/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mbreidt_1-1721633023965.png" alt="mbreidt_1-1721633023965.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The result of "weld 0.0" looks identical to the result of the dotNet code you posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 07:26:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911566#M1110</guid>
      <dc:creator>MartinBeh</dc:creator>
      <dc:date>2024-07-22T07:26:02Z</dc:date>
    </item>
    <item>
      <title>Betreff: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911622#M1111</link>
      <description>&lt;P&gt;Well... It looks like your trick is working. To be safe, we can add “Don't Weld Sel Edges” and select them all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hadn't considered welding the vertices for obvious reasons, but I forgot about the “protection option” for the selected edges.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 08:09:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911622#M1111</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-22T08:09:44Z</dc:date>
    </item>
    <item>
      <title>Betreff: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911669#M1112</link>
      <description>&lt;P&gt;Now in the context of the improvements made to preserving specified normals in several modifiers, we should probably consider the work of the Welder as a bug and report it as a bug&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 08:30:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12911669#M1112</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-22T08:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Reset object and remove mesh normals?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12939307#M1113</link>
      <description>&lt;P&gt;I mainly want to just keep the mesh, the smoothing groups and the UV's, everything else should be disregarded.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 07:12:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/reset-object-and-remove-mesh-normals/m-p/12939307#M1113</guid>
      <dc:creator>KasperFilipsen</dc:creator>
      <dc:date>2024-08-06T07:12:33Z</dc:date>
    </item>
  </channel>
</rss>

