Duplicate and Parent

could someone help create a simple script that
1) duplicates all objects in selection
2) parents duplicates to its original
3) if possible delete keyframes on the duplicate

thats all

any help is appreciated!thx

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Meghla Akash's picture

:)

Thanks a lot...It's really working..

Meghla Akash's picture

Thanks a lot..It's really

Thanks a lot..It's really working..:)

Garp's picture

Short version:

for obj in selection do (snapshot obj name:("DP_" + obj.name)).parent = obj

W DIGITAL's picture

woohoooooooo works great

woohoooooooo

works great Marcin

thx so much

MKlejnowski's picture

This should do the trick. I

This should do the trick. I also added the feature to select the new copies and gave them "DP_" in front of the name to know its the copy.

try(destroydialog MakeCopyRO)catch()
rollout MakeCopyRO "" width:160 height:40
(
	--RO
	button doBtn "Copy and Parent" pos:[8,8] width:144 height:24
 
	--EVENTS
	on doBtn pressed do
	(
		undo "Copy And Link" on
		(
			copyAr = #()
			for obj in selection do
			(
				copyObj = copy obj
				copyObj.parent = obj
				copyObj.name = ("DP_" + obj.name)
				deleteKeys copyObj #allKeys
				append copyAr copyObj
			)
			clearselection()
			select copyAr
		)
	)	
)
createDialog MakeCopyRO

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.