How do you select a Child object ?

I am writing a script that attaches values to a simple heirarchy of objects. It works fine when I select the root object but I don’t know how to refer to the child.

      import Blender
      import bpy
      obj=Blender.Object.Get("root")              ####  This works
      obj=Blender.Object.Get("root.child")     ###   This doesn't
     How can I call the child?
                                                            thanks

This question has been asked a few times before, there is no direct access in the blender python api, and there is no direct access in blender either. But you can build a list.


import Blender
          import bpy
          obj=Blender.Object.Get("root")              ####  This works
children = [ob for ob in bpy.data.objects if ob.parent == obj]

Thanks a lot for your help. I’ve got things working now…