Notifications
Clear all

[Closed] ID based skinwrap

I am trying to make an object follow the deformation of another exact copy of itself like skinwrap but not based on distance instead on vertex id

I am not sure what to do or even if it is doable.
My try(modified from another script):

plugin simpleMod ID_Deform
name:"ID_Deform"
classID:#(0x488f34ee, 0x28ce49d3)
version:1
(
	local obj = $
	
	parameters main rollout:params
	(
		PickedObj type:#node ui:btn1
	)
		rollout params "Parameters" width:162 height:142
	(
		fn meshTypeObj PickedObj = classof PickedObj == Editable_mesh or classof PickedObj == Editable_poly
			
		pickbutton btn3 "Pick Mesh" pos:[29,34] width:103 height:22 filter:meshTypeObj

		on btn1 picked PickedObj do
		(
			PickedObj=btn3.object
			update obj
		)
		
	)
 
	fn copypos obj1 obj2 = 
	(
		--vertnum=obj1.verts.count
		--for i =1 to vertnum do	
		--obj1.verts[1].pos =obj2.verts[1].pos
		
		
		vpos=obj2.verts[1].pos
		polyop.setVert obj1.modifiers[1] 1 vpos node:$
	)
	
	on map i p do
		(
			if PickedObj != undefined and isValidNode PickedObj do
			(
				p=copypos $ PickedObj
				--p=PickedObj.verts[i].pos
			)
			p
		)


)

4 Replies

Why wouldn’t you just use Morph for this?

I want the vertex to get the world position of its copy ,the vertex track the position using the id even if their pivots are not matching its like snapshot on every frame or a cache without a cache

you could use a Mesher object for this

I just discovered that mesher work for objects too ,thank you