diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-04 18:37:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-04 18:37:22 +0300 |
commit | 589b2b4ca8af8a3b260c0dd33ddfdb0cc8ee8376 (patch) | |
tree | b4dd33f0e15d4e0e5d47e6f667ebe9d81f1b456f /release/scripts/modules | |
parent | 61a8f370f547e9b39ada252b285b09a3aa92b42d (diff) |
object.group_users, object.scene_users
utility functions to find the groups and scenes this object is used in.
button to set the group location from the cursor (UI is horrible but not any nice place to add?)
smarp project would fail if there were linked meshes in the scene, made ID.tag ignore the library, so you can tag linked data since its only for tools to use.
normalize the vertex normal before setting and use inline vector functions.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpy_types.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index d890882b77c..2a757f83208 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -46,6 +46,19 @@ class Object(bpy_types.ID): import bpy return [child for child in bpy.data.objects if child.parent == self] + @property + def group_users(self): + """The groups this object is in""" + import bpy + name = self.name + return [group for group in bpy.data.groups if name in group.objects] + + @property + def scene_users(self): + """The scenes this object is in""" + import bpy + name = self.name + return [scene for scene in bpy.data.scenes if name in scene.objects] class _GenericBone: """ |