Xform broken via Maxscript

Xform broken via Maxscript

victorEFVH7
Enthusiast Enthusiast
1,051 Views
4 Replies
Message 1 of 5

Xform broken via Maxscript

victorEFVH7
Enthusiast
Enthusiast

Xform looks like its broken in 2023 when executed via maxscript. The smoothing groups / normals are destroyed and needs to be reset through a smoothing group modifier.

The xform utility works as it should but it looks like xform $ are broken.

Does anyone know the reason behind this as it used to work in previous releases such as 2018 and 2021? 

Attached image for reference

 

0 Likes
Accepted solutions (1)
1,052 Views
4 Replies
Replies (4)
Message 2 of 5

denisT.MaxDoctor
Advisor
Advisor

I don't understand what you do... do you call a maxscript method ResetXForm? Or you try to apply XForm modifier?

Show what you do. Post a sample scene... it will help too. 

My tests work as expected, and I can't reproduce the issue.

 

 

 

0 Likes
Message 3 of 5

victorEFVH7
Enthusiast
Enthusiast

I call a maxscript ResetXform, see the inserted gif.  Also attached a model of it (2020)

Apparently it "works" to collapse the stack and then the original smoothing /normal will appear. Collapse stack is ofc something that always should be done. 

ezgif-1-67545debc8.gif

 

0 Likes
Message 4 of 5

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

I have checked your file, and it looked like the object has specified (custom edited) normals. I don't know how it was done, but after that it was collapsed to Editable Poly. Anyway, the normals are specified, but not explicit, so any restructuring (rebuilding) of the mesh must reset the normals. This is what we see when we reset the XForm. To preserve the normals, we can first add an Edit_Normals modifier and make all normals explicit.

Here's what we need to do:

-- the object is expected to be selected
(
	the_node = $
	max modify mode
	edt_norms = Edit_Normals()
	addmodifier the_node edt_norms
	edt_norms.MakeExplicit selection:#{1..edt_norms.GetNumNormals()}
	resetxform the_node
	addmodifier the_node (smooth autosmooth:on)
	-- converttopoly the_node -- collapse the stack if necessary 
)

 

0 Likes
Message 5 of 5

victorEFVH7
Enthusiast
Enthusiast
Thanks for the explanation and solution.
0 Likes