[Bf-blender-cvs] [24976dd] master: Outliner: Toggle restrict buttons only for selectable child objects

Julian Eisel noreply at git.blender.org
Sat Feb 14 21:56:49 CET 2015


Commit: 24976dd29d16ffc176ad0f87246fa98a1da31ccc
Author: Julian Eisel
Date:   Sat Feb 14 21:54:31 2015 +0100
Branches: master
https://developer.blender.org/rB24976dd29d16ffc176ad0f87246fa98a1da31ccc

Outliner: Toggle restrict buttons only for selectable child objects

D404 by @rupp with minor edits by me.

===================================================================

M	source/blender/editors/space_outliner/outliner_draw.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 3aaa116..0766587 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -176,16 +176,20 @@ static void restrictbutton_recursive_child(bContext *C, Scene *scene, Object *ob
 {
 	Main *bmain = CTX_data_main(C);
 	Object *ob;
+
 	for (ob = bmain->object.first; ob; ob = ob->id.next) {
 		if (BKE_object_is_child_recursive(ob_parent, ob)) {
-			if (state) {
-				ob->restrictflag |= flag;
-				if (deselect) {
-					ED_base_object_select(BKE_scene_base_find(scene, ob), BA_DESELECT);
+			/* only do if child object is selectable */
+			if ((flag == OB_RESTRICT_SELECT) || (ob->restrictflag & OB_RESTRICT_SELECT) == 0) {
+				if (state) {
+					ob->restrictflag |= flag;
+					if (deselect) {
+						ED_base_object_select(BKE_scene_base_find(scene, ob), BA_DESELECT);
+					}
+				}
+				else {
+					ob->restrictflag &= ~flag;
 				}
-			}
-			else {
-				ob->restrictflag &= ~flag;
 			}
 
 			if (rnapropname) {




More information about the Bf-blender-cvs mailing list