How to get a list of an object's children?


If I have an object “obj” how can I get a list of it’s children?

I notice that the object class has a “parent” property, I was hoping for a “children” property too, which would have been a list (potentially empty) of the objects children.

Sorry for the probably noobish question but I looked through google, the forum search and the python api reference index and couldn’t find the answer. Maybe I missed something obvious.

Thanks in advance.

import bpy 
def getChildren(myObject): 
    children = [] 
    for ob in 
        if ob.parent == myObject: 
    return children 
#then if you have an object you find it's children by 
myObject =['Cube'] 
children = getChildren(myObject) 
for c in children: 

Wow awesome : ) Thanks alot!

Thanks for that answer, it helped me alot.
I just want to give an advise from what i learned while scripting with Blender.
There is not really a need to loop through all to get the children of a given object.
If the object has children the children are already stored in a collection inside the object.
you can get it like this:

lets say your object is a cube.
myObject = Cube

you can do:
for child in myObject.children:
#or do what you need to do with the child object…