ScriptSpot

Forum topic · Scripts Wanted

Duplicate and Parent

By W DIGITAL · 2012-08-15

Description

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 (7)

:)

Meghla Akash · 2012-08-19

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

Meghla Akash · 2012-08-19

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

Short version:

Garp · 2012-08-17

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

[quote]Short version:for obj

Graph · 2012-08-17

[quote]Short version:

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

[/quote]

lmao, you my friend.. ftw

MKlejnowski · 2012-08-17

Nice. I need to get into the habit of writing shorter code to speed things up.

W DIGITAL · 2012-08-16

woohoooooooo

works great Marcin

thx so much

MKlejnowski · 2012-08-16

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