[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48145] trunk/blender/source/blender/ editors/space_outliner/outliner_draw.c: workarond for outliner group object selection trick - which is so slow it had to be disabled .

Campbell Barton ideasman42 at gmail.com
Thu Jun 21 01:21:41 CEST 2012


Revision: 48145
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48145
Author:   campbellbarton
Date:     2012-06-20 23:21:36 +0000 (Wed, 20 Jun 2012)
Log Message:
-----------
workarond for outliner group object selection trick - which is so slow it had to be disabled. Now use the first object of the group, which isn't great but is at least usable.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_outliner/outliner_draw.c

Modified: trunk/blender/source/blender/editors/space_outliner/outliner_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_draw.c	2012-06-20 22:57:05 UTC (rev 48144)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_draw.c	2012-06-20 23:21:36 UTC (rev 48145)
@@ -202,26 +202,39 @@
 {
 	GroupObject *gob;
 
+#ifdef USE_GROUP_SELECT
 	for (gob = gr->gobject.first; gob; gob = gob->next) {
 		if ((gob->ob->restrictflag & flag) == 0)
 			return 0;
 	}
-
 	return 1;
+#else
+	/* weak but fast */
+	if ((gob = gr->gobject.first))
+		if ((gob->ob->restrictflag & flag) == 0)
+			return 0;
+	return 1;
+#endif
 }
 
-#ifdef USE_GROUP_SELECT
 static int group_select_flag(Group *gr)
 {
 	GroupObject *gob;
 
+#ifdef USE_GROUP_SELECT
 	for (gob = gr->gobject.first; gob; gob = gob->next)
 		if ((gob->ob->flag & SELECT))
 			return 1;
 
 	return 0;
+#else
+	/* weak but fast */
+	if ((gob = gr->gobject.first))
+		if (gob->ob->flag & SELECT)
+			return 1;
+	return 0;
+#endif
 }
-#endif
 
 void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag)
 {	
@@ -428,25 +441,15 @@
 				
 				uiBlockSetEmboss(block, UI_EMBOSSN);
 
-#ifndef USE_GROUP_SELECT
-				restrict_bool = FALSE;
-#endif
-
-#ifdef USE_GROUP_SELECT
 				restrict_bool = group_restrict_flag(gr, OB_RESTRICT_VIEW);
-#endif
 				bt = uiDefIconBut(block, ICONTOG, 0, restrict_bool ? ICON_RESTRICT_VIEW_ON : ICON_RESTRICT_VIEW_OFF, (int)ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX, (int)te->ys, UI_UNIT_X - 1, UI_UNIT_Y - 1, NULL, 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
 				uiButSetFunc(bt, restrictbutton_gr_restrict_view, scene, gr);
 
-#ifdef USE_GROUP_SELECT
 				restrict_bool = group_restrict_flag(gr, OB_RESTRICT_SELECT);
-#endif
 				bt = uiDefIconBut(block, ICONTOG, 0, restrict_bool ? ICON_RESTRICT_SELECT_ON : ICON_RESTRICT_SELECT_OFF, (int)ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX, (int)te->ys, UI_UNIT_X - 1, UI_UNIT_Y - 1, NULL, 0, 0, 0, 0, "Restrict/Allow selection in the 3D View");
 				uiButSetFunc(bt, restrictbutton_gr_restrict_select, scene, gr);
 
-#ifdef USE_GROUP_SELECT
 				restrict_bool = group_restrict_flag(gr, OB_RESTRICT_RENDER);
-#endif
 				bt = uiDefIconBut(block, ICONTOG, 0, restrict_bool ? ICON_RESTRICT_RENDER_ON : ICON_RESTRICT_RENDER_OFF, (int)ar->v2d.cur.xmax - OL_TOG_RESTRICT_RENDERX, (int)te->ys, UI_UNIT_X - 1, UI_UNIT_Y - 1, NULL, 0, 0, 0, 0, "Restrict/Allow renderability");
 				uiButSetFunc(bt, restrictbutton_gr_restrict_render, scene, gr);
 
@@ -1289,7 +1292,6 @@
 				}
 			}
 			else if (te->idcode == ID_GR) {
-#ifdef USE_GROUP_SELECT
 				Group *gr = (Group *)tselem->id;
 				if (group_select_flag(gr)) {
 					char col[4];
@@ -1299,7 +1301,6 @@
 					
 					active = 2;
 				}
-#endif
 			}
 			else if (te->idcode == ID_OB) {
 				Object *ob = (Object *)tselem->id;




More information about the Bf-blender-cvs mailing list