Notifications
Clear all

[Closed] copy edit poly modifier to another

hello, i need some help here.

I wanted to copy edit poly modifier to another object.
The EditPoly have modified vertex.

with maxscript, the modified information wont come to the new object.
with my hand, right click the editpoly > copy > select new object > paste , it works.

anyone know about this strange thing?
I crowed around the web but, couldnt figure it out.
heres my script:

function editPolyMerge mTargetFile= (

	select $*mdl*cloth --select object specified
	baseObj = $

	-- execute Merge
	mergeFlag = false
	mergeFlag = mergeMAXFile mTargetFile #($.name) #select #mergeDups #useSceneMtlDups #neverReparent quiet:on

	select $*mdl*cloth
	mergeObj = undefined
	if(mergeFlag == true) then (
		mergeObj = $selection[2]
	) else (
		print ("Merge Failed : " + mTargetFile as string )
		--messagebox("Merge Failed")title:"Merge Dialog"
		return 0
	)

	-- get Target Edit_Poly 
	targetModifier = undefined
	for m in mergeObj.modifiers where (classof m) == Edit_Poly do (
		targetModifier = copy m
		exit
	)

	-- get Index modifier
	index = 0
	for m in baseObj.modifiers do (
		index += 1
		if	(classof m) == Edit_Poly then (
			exit
		)
	)

	-- add
	addModifier baseObj targetModifier before:index

	delete mergeObj
)

thanx.

3 Replies
 PEN

I think that I asked this about 12 years ago. It doesn’t work the same and I don’t really know why. What you need to do is get the changes and reapply them. Never tried it my self so I don’t really know the best way to go about that.

1 Reply
(@lonerobot)
Joined: 1 year ago

Posts: 0

I’m showing my age but I remember when you asked it Paul.

I have always used either the morpher approach or copy/paste verts in Graphite tools to get around this.

thank you, PEN.

The fact is, maxscript doesnt support copy editPoly modifier to another with edit information.
I heard some skin modifier is same too, and cant copy with script.

So, the way I do is,

use animation curve for verts position copy.

OR

cache the position difference between, editPoly ON and OFF, then transfer to copied modifier.

OR

use morph etc…

thanks for the help!!