Notifications
Clear all

[Closed] Create dummy by object, link object to dummy

I remember a thread on here probably in the last few weeks, the question was how to do the following:

You have a scene with a bunch of objects.
Create a dummy for each object, centered in the objects position.
The dummy is named “Object name + dummy”
The original object is parented to its new dummy.

The script was setup to do this in an array, but I can’t seem to find that thread. If anyone knows where it is or could generate this script I would appreciate it.

4 Replies

It shouldn’t be that difficult. Try something like this:

--Loop through selection and created dummy at object center and parent to dummy
for obj in 1 to selection.count do (
	dummyObj = Dummy() --create your dummy; set parameters using Dummy boxsize:[10,10,10]
	dummyObj.pos = selection[obj].center -- move dummy to object center
	selection[obj].parent = dummyObj --parent object to dummy
)

-Eric

My snippet for you:


 		fn Grouping List:(getcurrentselection()) pts:#() =
 		(
 			if (List != undefined) and (List.count >= 1) do
 			(
 				for nodes in List do
 				(
 					pt = point name:(nodes.name + "_GRP") size:10 Box:off cross:off axistripod:on centermarker:off constantscreensize:off drawontop:off
 						pt.wirecolor = yellow
 						pt.transform = nodes.transform
 						pt.parent = nodes.parent
 						nodes.parent = pt
 					
 					append pts pt
 					pt.baseobject = pts[1].baseobject
 				)
 			)
 			
 			print pts
 			
 		)
 

hope it helps

very helpful script, thanks guys, and thanks for posting the question D

Yes this has helped a lot, thanks!