Notifications
Clear all
[Closed] Create dummy by object, link object to dummy
Jan 28, 2010 9:05 pm
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
Jan 28, 2010 9:05 pm
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
Jan 28, 2010 9:05 pm
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
Jan 28, 2010 9:05 pm
very helpful script, thanks guys, and thanks for posting the question D