Notifications
Clear all

[Closed] Move verts in Edit_Poly modifier without selecting them?

I’m trying to find a way to move verts in an Edit_Poly modifier, but the only way I know how to do that is by selecting them and then moving the selection. The problem with this is that it requires the script to switch the sub object mode to verts and then back to whatever the user had selected afterwards, which is very slow. Here’s what I’m doing:

holdSub = subobjectLevel
subobjectLevel = 1
vertToMove = 4
newPos = [0,0,0]
modFullName = modpanel.getCurrentObject()
modFullName.setSelection #Vertex #{}
modFullName.Select #Vertex #{vertToMove}
curPos = modFullName.GetVertex vertToMove
newOffset = (newPos - curPos)
modFullName.MoveSelection newOffset
modFullName.Commit()
subobjectLevel = holdSub

Is there a better/faster way to do this?

3 Replies

The modify panel should be open. The subobjectlevel is not important.
How to calcualte new pos ayou already know.

(
	max modify mode
	subobjcetlevel = 0
	
	epObj = selection[1]
	
	EditPolyMod.SetVert epObj.Edit_Poly #{63} [0,0,0] node:epObj
	epObj.modifiers[#Edit_Poly].Commit()
)

The method above works only in 3dsMax localized in english.
This should wokrs on all “languages”:

(
	max modify mode
	subobjcetlevel = 0
	
	epObj = selection[1]
	obj = modPanel.getcurrentobject()
	
	obj.setVert #{63} [0,0,0] node:epObj
)

Thanks for the help miauu! Problem solved.
Also, I had no idea some parts of Maxscript had issues with different localisations like that.

I also did not know until I faced the problem.