diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-10-09 22:56:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-10-09 22:56:02 +0400 |
commit | 475bc908be0a9f6133f96bd8d1f1f85914b4f5d3 (patch) | |
tree | f4e32fbf6d357fc5b955a5432fdd740bcdf071ea /source | |
parent | 18e3386ac51579313446c83280bae815d23d6a34 (diff) |
changed select grouped hooks functionality- just select the hooks that use the active object.
also speed up for select group, only find group status for unselected objects.
Updated the select group menu in 3 places, the space bar menu was out missing some other group options also.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/header_view3d.c | 2 | ||||
-rw-r--r-- | source/blender/src/space.c | 46 | ||||
-rw-r--r-- | source/blender/src/toolbox.c | 7 |
3 files changed, 22 insertions, 33 deletions
diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index f514c51a94f..e2e6f168112 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -761,6 +761,7 @@ void do_view3d_select_object_groupedmenu(void *arg, int event) case 5: /* Type */ case 6: /* Objects on Shared Layers */ case 7: /* Objects in Same Group */ + case 8: /* Object Hooks*/ select_object_grouped((short)event); break; } @@ -782,6 +783,7 @@ static uiBlock *view3d_select_object_groupedmenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects of Same Type|Shift G, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects on Shared Layers|Shift G, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects in Same Group|Shift G, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Hooks|Shift G, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 60); diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 36b5592099b..dd70ef4d74a 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -609,46 +609,30 @@ static void select_same_group(Object *ob) /* Select objects in the same group as if (!group || !ob) return; - for (base= FIRSTBASE; base; base= base->next) - if (object_in_group(base->object, group)) { + for (base= FIRSTBASE; base; base= base->next) { + if (!(base->flag & SELECT) && object_in_group(base->object, group)) { base->flag |= SELECT; base->object->flag |= SELECT; } + } } -static void select_same_hook(Object *ob) /* Select objects in the same group as the active */ +static void select_object_hooks(Object *ob) /* Select objects in the same group as the active */ { - Base *base, *base_to; + Base *base; ModifierData *md; HookModifierData *hmd; - int ok; + if (!ob) return; - for (base= FIRSTBASE; base; base= base->next) { - ok= 0; - /* check that this object has a hook modifier and is using the active object as its deformer */ - for (md = base->object->modifiers.first; md; md=md->next) { - if (md->type==eModifierType_Hook) { - hmd= (HookModifierData*) md; - if (hmd->object == ob) { - ok= 1; - break; - } - } - } - if (ok) { /* this means that ob us using the active object as a hook, so select other hooks */ - for (md = base->object->modifiers.first; md; md=md->next) { - if (md->type==eModifierType_Hook) { - hmd= (HookModifierData*) md; - if (hmd->object != ob) { - base_to= object_in_scene(hmd->object, G.scene); - if (base_to) { - base_to->flag |= SELECT; - base_to->object->flag |= SELECT; - } - } - } + for (md = ob->modifiers.first; md; md=md->next) { + if (md->type==eModifierType_Hook) { + hmd= (HookModifierData*) md; + if (hmd->object && !(hmd->object->flag & SELECT)) { + base= object_in_scene(hmd->object, G.scene); + base->flag |= SELECT; + base->object->flag |= SELECT; } } } @@ -700,7 +684,7 @@ void select_object_grouped(short nr) else if(nr==4) select_same_parent(OBACT); else if(nr==5) select_same_type(OBACT); else if(nr==7) select_same_group(OBACT); - else if(nr==8) select_same_hook(OBACT); + else if(nr==8) select_object_hooks(OBACT); @@ -726,7 +710,7 @@ static void select_object_grouped_menu(void) "Objects of Same Type%x5|" "Objects on Shared Layers%x6|" "Objects in Same Group%x7|" - "Hook Siblings (Deform Same Data)%x8|"); + "Object Hooks%x8|"); /* here we go */ diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index 2265ae46fcd..0a80e19a0fe 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -843,8 +843,11 @@ static TBitem tb_object_select_grouped[]= { { 0, "Children|Shift G, 1", 1, NULL}, { 0, "Immediate Children|Shift G, 2", 2, NULL}, { 0, "Parent|Shift G, 3", 3, NULL}, -{ 0, "Objects on Shared Layers|Shift G, 4", 4, NULL}, -{ 0, "Objects in Same Group|Shift G, 5", 5, NULL}, +{ 0, "Siblings (Shared Parent)|Shift G, 4", 4, NULL}, +{ 0, "Objects of Same Type|Shift G, 5", 5, NULL}, +{ 0, "Objects on Shared Layers|Shift G, 6", 6, NULL}, +{ 0, "Objects in Same Group|Shift G, 7", 7, NULL}, +{ 0, "Object Hooks|Shift G, 8", 8, NULL}, { -1, "", 0, do_view3d_select_object_groupedmenu}}; static TBitem tb_object_select[]= { |