Notifications
Clear all

[Closed] EditablePoly viewport update after Undo operation

Hi.
Is there any convenient way to update Editable Poly object look after the undo operation?

In this example I had to modify vert position in order it to update (uncomment to see the diffirence), but this hack doesn’t seem to work in 2017 max.
Without this hack Undo operation successfully reverts all the changes made to face mtl IDs, but viewport keeps showing me wrong materials unless I do something with mesh.

delete objects
gc()
seed 12345
mm = Multimaterial()
for i=1 to 10 do mm.materialList[i] = Standardmaterial diffuse:(random red (random green blue))

geo = GeoSphere segments:5
convertToPoly geo
geo.material = mm

gc()
try (destroydialog X ) catch ()
rollout X "" (

	button setMtlIDs "set mtl ids" width:150
	
	on setMtlIDs pressed do undo "MtlIDs" on
	(
		for f=1 to polyop.getNumFaces geo do
		(
			polyop.setFaceMatID geo f (random 1 10)
		)

		--polyop.setVert geo 1 (polyop.getVert geo 1)
		
		redrawViews()
	)

)
createDialog X
3 Replies

Try:

polyop.setvertselection geo (polyop.getvertselection geo)

or

polyop.propagateflags geo #vertex 0 #vertex 0
polyop.setVert geo 1 (polyop.getVert geo 1)

Not works in max 2018 and max2019. But

both works in max 2018/2019.

Thank you very much, guys!