INNER CODE UNIT · Python
get_scene_root_objects
VITA-Group/Diffusion4D · rendering/blender.py:374
def get_scene_root_objects() -> Generator[bpy.types.Object, None, None]:
"""Returns all root objects in the scene.
Yields:
Generator[bpy.types.Object, None, None]: Generator of all root objects in the
scene.
"""
for obj in bpy.context.scene.objects.values():
if not obj.parent:
yield obj
def get_scene_meshes() -> Generator[bpy.types.Object, None, None]:
"""Returns all meshes in the scene.
Yields:
Generator[bpy.types.Object, None, None]: Generator of all meshes in the scene.
"""