Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Bantle <hairbat@yahoo.com>2007-04-19 23:47:51 +0400
committerGeoffrey Bantle <hairbat@yahoo.com>2007-04-19 23:47:51 +0400
commitf5a40315ca8c5f14623a09f8272417f65aaf6f6a (patch)
treed77876c25f8a844fe107f97b50145cc11abffb33
parent238ab042973f09b1177f918d2a3b2dda932ecbc1 (diff)
-> Keybindings for hiding objects
Small feature, added keybindings for setting the visibility restriction flags that were previously only accesible via the outliner HKEY Hides all selected SHIFT-HKEY Hides all unselected ALT-HKEY Shows all hidden
-rw-r--r--source/blender/include/BDR_editobject.h3
-rw-r--r--source/blender/src/editobject.c32
-rw-r--r--source/blender/src/space.c9
3 files changed, 42 insertions, 2 deletions
diff --git a/source/blender/include/BDR_editobject.h b/source/blender/include/BDR_editobject.h
index 9aa8072302e..31412a4fd0a 100644
--- a/source/blender/include/BDR_editobject.h
+++ b/source/blender/include/BDR_editobject.h
@@ -117,5 +117,8 @@ void add_hook(void);
void hook_select(struct HookModifierData *hmd);
int hook_getIndexArray(int *tot, int **indexar, char *name, float *cent_r);
+void hide_objects(int select);
+void show_objects(void);
+
#endif /* BDR_EDITOBJECT_H */
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c
index b65787fe687..2cb57faffd8 100644
--- a/source/blender/src/editobject.c
+++ b/source/blender/src/editobject.c
@@ -5455,3 +5455,35 @@ void hookmenu(void)
}
}
+void hide_objects(int select)
+{
+ Base *b;
+ int swap;
+ for(b = G.scene->base.first; b; b=b->next){
+ if(TESTBASE(b)==select){
+ b->flag &= ~SELECT;
+ b->object->restrictflag |= OB_RESTRICT_VIEW;
+ DAG_object_flush_update(G.scene, b->object, OB_RECALC_DATA);
+ }
+ }
+ G.scene->basact = NULL;
+ allqueue(REDRAWVIEW3D,0);
+ allqueue(REDRAWOOPS,0);
+ if(select) BIF_undo_push("Hide Selected Objects");
+ else if(select) BIF_undo_push("Hide Unselected Objects");
+}
+
+void show_objects(void)
+{
+ Base *b;
+ for(b = G.scene->base.first; b; b=b->next){
+ if((b->lay & G.vd->lay) && b->object->restrictflag & OB_RESTRICT_VIEW){
+ b->flag |= SELECT;
+ b->object->restrictflag &= ~OB_RESTRICT_VIEW;
+ DAG_object_flush_update(G.scene, b->object, OB_RECALC_DATA);
+ }
+ }
+ BIF_undo_push("Unhide Objects");
+ allqueue(REDRAWVIEW3D,0);
+ allqueue(REDRAWOOPS,0);
+}
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index c912284d152..af28b844b2d 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -1924,8 +1924,13 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
hide_unselected_pose_bones();
else if (G.qual==LR_ALTKEY)
show_all_pose_bones();
- } else {
- hookmenu();
+ }
+
+ else {
+ if(G.qual==LR_CTRLKEY)hookmenu();
+ else if(G.qual==LR_ALTKEY) show_objects();
+ else if(G.qual==LR_SHIFTKEY) hide_objects(0);
+ else hide_objects(1);
}
break;
case IKEY: