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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-04-25 06:20:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-04-25 06:20:55 +0400
commit13b1fbd665f3e20780844469a9704ecb2008a996 (patch)
tree68c6f8c2692cb6506526a4bd9a0224ce053dfeec /source
parent0c7e145dcedaf3e22abaead61c1b1cb431a7da0a (diff)
made blender take hidden objects into account in more situations.
Ctrl+RMB used to select a hidden object as well as "Select Grouped -> Parent" Also made OOps and data browser check for hidden objects. Added a countall to hide/unhide objects.
Diffstat (limited to 'source')
-rw-r--r--source/blender/include/blendef.h2
-rw-r--r--source/blender/src/editobject.c2
-rw-r--r--source/blender/src/editoops.c6
-rw-r--r--source/blender/src/editview.c11
-rw-r--r--source/blender/src/filesel.c4
-rw-r--r--source/blender/src/space.c2
6 files changed, 13 insertions, 14 deletions
diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h
index 4b36aea88a8..70c16fd5df9 100644
--- a/source/blender/include/blendef.h
+++ b/source/blender/include/blendef.h
@@ -97,7 +97,7 @@
#define TESTBASE(base) ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0) )
#define TESTBASELIB(base) ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0))
-#define BASE_SELECTABLE(base) ((base->lay & G.vd->lay) && !(base->object->restrictflag & OB_RESTRICT_SELECT) && !(base->object->restrictflag & OB_RESTRICT_VIEW))
+#define BASE_SELECTABLE(base) ((base->lay & G.vd->lay) && (base->object->restrictflag & (OB_RESTRICT_SELECT|OB_RESTRICT_VIEW))==0)
#define FIRSTBASE G.scene->base.first
#define LASTBASE G.scene->base.last
#define BASACT (G.scene->basact)
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c
index 5e859501b6a..3fdf7425e39 100644
--- a/source/blender/src/editobject.c
+++ b/source/blender/src/editobject.c
@@ -5477,6 +5477,7 @@ void hide_objects(int select)
DAG_scene_sort(G.scene);
allqueue(REDRAWVIEW3D,0);
allqueue(REDRAWOOPS,0);
+ countall();
}
}
@@ -5497,5 +5498,6 @@ void show_objects(void)
DAG_scene_sort(G.scene);
allqueue(REDRAWVIEW3D,0);
allqueue(REDRAWOOPS,0);
+ countall();
}
}
diff --git a/source/blender/src/editoops.c b/source/blender/src/editoops.c
index 8b1f96e3569..bdfd3216d7a 100644
--- a/source/blender/src/editoops.c
+++ b/source/blender/src/editoops.c
@@ -103,8 +103,10 @@ static void oops_to_select_objects(void)
if(oops->hide==0) {
if(oops->type==ID_OB) {
ob= (Object *)oops->id;
- if(oops->flag & SELECT) ob->flag |= SELECT;
- else ob->flag &= ~SELECT;
+ if ((ob->flag & OB_RESTRICT_VIEW)==0) {
+ if(oops->flag & SELECT) ob->flag |= SELECT;
+ else ob->flag &= ~SELECT;
+ }
}
}
oops= oops->next;
diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c
index 232a69979bd..086abbaa7a4 100644
--- a/source/blender/src/editview.c
+++ b/source/blender/src/editview.c
@@ -1183,10 +1183,7 @@ static Base *mouse_select_menu(unsigned int *buffer, int hits, short *mval)
char str[32];
for(base=FIRSTBASE; base; base= base->next) {
- if(base->lay & G.vd->lay &&
- (base->object->restrictflag & OB_RESTRICT_SELECT)==0 &&
- (base->object->restrictflag & OB_RESTRICT_VIEW)==0
- ) {
+ if BASE_SELECTABLE(base) {
baseList[baseCount] = NULL;
/* two selection methods, the CTRL select uses max dist of 15 */
@@ -1304,9 +1301,7 @@ void mouse_select(void)
else {
base= startbase;
while(base) {
-
- if(base->lay & G.vd->lay) {
-
+ if BASE_SELECTABLE(base) {
project_short(base->object->obmat[3], &base->sx);
temp= abs(base->sx -mval[0]) + abs(base->sy -mval[1]);
@@ -1453,7 +1448,7 @@ void mouse_select(void)
select_base_v3d(basact, BA_SELECT);
}
/* also prevent making it active on mouse selection */
- else if (!(basact->object->restrictflag & OB_RESTRICT_SELECT)) {
+ else if BASE_SELECTABLE(basact) {
oldbasact= BASACT;
BASACT= basact;
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c
index 91c629dda75..025ee86e563 100644
--- a/source/blender/src/filesel.c
+++ b/source/blender/src/filesel.c
@@ -2519,7 +2519,7 @@ static void filesel_select_objects(SpaceFile *sfile)
ob= (Object *)sfile->filelist[a].poin;
- if(ob) {
+ if(ob && (ob->flag & OB_RESTRICT_VIEW)==0) {
if(sfile->filelist[a].flags & ACTIVE) ob->flag |= SELECT;
else ob->flag &= ~SELECT;
}
@@ -2561,7 +2561,7 @@ static void active_file_object(SpaceFile *sfile)
ob= (Object *)sfile->filelist[sfile->act].poin;
- if(ob) {
+ if(ob && (ob->flag & OB_RESTRICT_VIEW)==0) {
set_active_object(ob);
if(BASACT && BASACT->object==ob) {
BASACT->flag |= SELECT;
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index af28b844b2d..9c822e45db9 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -699,7 +699,7 @@ static short select_parent(void) /* Makes parent active and de-selected OBACT */
if(base==startbase) break;
}
/* can be NULL if parent in other scene */
- if(basact) {
+ if(basact && BASE_SELECTABLE(basact)) {
oldbasact = BASACT;
BASACT = basact;
basact->flag |= SELECT;