A "Make mulitlpe children" script

Dunno if anyone has made this before, but here it is.
You select the objects you want to parent, then pops up with a window so you can choose the parent from a list (for the clumsy people, you know who you are :P) the last chosen is handily at the top.
It doesn’t clear the relationships first though, so any parenting loops will bring up a blender error.


#!BPY
""" Registration info for Blender menus: 
Name: 'Make multiple children'
Blender: 234
Group: 'Object'
Tip: 'parent multiple objects at once'
"""
__author__ = "zenoscope"
__url__ = ("blender", "elysiun")
__version__ = "0.2"

# revision hist
# 0.01 - parent multiple kids
# 0.02 made this script so that you can choose from a list of
# objects to parent the others to?

import Blender
from Blender import Object, Draw,BGL

def make_list(oblist):	
	
	counter = 0
	list=list="Choose the parent%t"

	for ob in oblist:
		list = list + "|" + ob.name + "%x" + str(counter)
		counter = counter + 1
	
	ChangeThis=Draw.PupMenu(list,20)
	newParent=oblist.pop(ChangeThis)
	newParent.makeParent(oblist, 0, 0)

def parentSelected():
	global message
	oblist=Object.GetSelected()
	listLength=len(oblist)

	if listLength > 1:	
		make_list(oblist)
	#else:
		# Draw.PupMenu("You need to select stuff",1)

def event(evt, val):    # the function to handle input events
	Draw.Redraw(1)

def button_event(evt):  # the function to handle Draw Button events
	if evt == 1:
		parentSelected()	
	elif evt == 2:
		Draw.Exit()

def gui():              # the function to draw the screen
	global message
	BGL.glClearColor(0,0,1,1)
	BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
	BGL.glColor3f(0,1,0)

	Draw.Button("parent", 1, 10, 120, 80, 20,"append")
	Draw.Button("Quit", 2, 10, 10, 55, 20,"append")


Draw.Register(gui, event, button_event)  # registering the 3 callbacks
 

I’ve got a script that lets you assign the same texture to multiple objects as well, and might whip one up for changing attribs such as the drawtype, subsurf level, blah blah if i have the time and anyone is interested?

Would it be possible to add subsurf or some other modifier to multiple objects this way? I think that would be useful.

And voila, you have your own brood of littluns! Perfect for couples with fertility problems!
No, seriously, thanks for this - it’s always a nightmare adding many objects.

I don’t see the utility of this script :-?
Why don’t use the CTRL+P ?

BeBraw:
it would be possible to do this, i’ll have a go at it and hopefully have some more options added at the end of the week.

Caronte:
This script is for mostly clumsy people, like me, where the parent gets selected somewhere in the middle of a mess of objects and its impossible to ferret it out properly. Though ALT+P does do the same (without the list option)

I’ve got a script to assign a material to multiple ojects as well, I’ll add that and the subsurfs, plus name and axis display as well. Any other suggestions?

Select the parent is very easy, even if many objects overlap, because Blender have many select opctions.

i.e1: If you push CTRL before RMB, the selected object is the one with center nearest to mouse cursor.
i.e2: You can use SHIFT+F4 to select with comodity.

You can do that with CTRL+L %|

thanks, I diidn’t know about those shortcuts. thanks!