diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-03 14:32:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-03 14:32:10 +0400 |
commit | 314a2758505aeba72e2c87f06c5a61c6ceb7773c (patch) | |
tree | ce598cd11bd9a212b7e19236647baac90ce00a52 /release | |
parent | 2f5735a9d4745f33e850a163248c6c18a1305f64 (diff) |
fix (actually nasty workaround), for groups incorrectly drawing in the object panel when the blend file has naming collisions with library data.
also minor style cleanup in bpy_rna.c
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_object.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 3c30f27f16b..4ce909d3645 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -159,7 +159,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel): def draw(self, context): layout = self.layout - ob = context.object + obj = context.object row = layout.row(align=True) row.operator("object.group_link", text="Add to Group") @@ -167,8 +167,13 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel): # XXX, this is bad practice, yes, I wrote it :( - campbell index = 0 + obj_name = obj.name for group in bpy.data.groups: - if ob.name in group.objects: + # XXX this is slow and stupid!, we need 2 checks, one thats fast + # and another that we can be sure its not a name collission + # from linked library data + group_objects = group.objects + if obj_name in group.objects and obj in group_objects[:]: col = layout.column(align=True) col.context_pointer_set("group", group) |