ob.getChilren() often requested for 2.4x api, notice this is only 1 line of python.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 28 Oct 2009 09:39:16 +0000 (09:39 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 28 Oct 2009 09:39:16 +0000 (09:39 +0000)
release/scripts/modules/bpy_ext/Object.py [new file with mode: 0644]
release/scripts/modules/bpy_ext/__init__.py [new file with mode: 0644]
source/blender/python/intern/bpy_interface.c

diff --git a/release/scripts/modules/bpy_ext/Object.py b/release/scripts/modules/bpy_ext/Object.py
new file mode 100644 (file)
index 0000000..a842318
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+class_obj = bpy.types.Object
+
+class_obj.getChildren = lambda ob: [child for child in bpy.data.objects if child.parent == ob]
\ No newline at end of file
diff --git a/release/scripts/modules/bpy_ext/__init__.py b/release/scripts/modules/bpy_ext/__init__.py
new file mode 100644 (file)
index 0000000..a20a5ff
--- /dev/null
@@ -0,0 +1 @@
+import bpy_ext.Object
index 095bfab45c4055dab7b033030c9fe02afd842661..53c0d591437ed1c61b63a45946d452d79a0f2517 100644 (file)
@@ -200,6 +200,7 @@ static void bpy_init_modules( void )
                
                bpy_import_test("bpy_ops"); /* adds its self to bpy.ops */
                bpy_import_test("bpy_sys"); /* adds its self to bpy.sys */
+               bpy_import_test("bpy_ext"); /* extensions to our existing types */
        }
        
        /* stand alone utility modules not related to blender directly */