Commit: 4c673a6d483062d11a8673898f5be89318d4d9e1
Author: Nathan Craddock
Date:   Thu Aug 13 19:23:19 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rB4c673a6d483062d11a8673898f5be89318d4d9e1

Outliner: Expand modifier panels when clicked in outliner

With properties sync, it makes sense to expand the modifier in the
properties editor on click, otherwise it takes an additional click to
make modifications to the modifier.

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_select.c 
b/source/blender/editors/space_outliner/outliner_select.c
index 744fa808898..10af5c5fb64 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -27,12 +27,16 @@
 
 #include "DNA_armature_types.h"
 #include "DNA_collection_types.h"
+#include "DNA_constraint_types.h"
+#include "DNA_gpencil_modifier_types.h"
 #include "DNA_gpencil_types.h"
 #include "DNA_light_types.h"
 #include "DNA_material_types.h"
+#include "DNA_modifier_types.h"
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_sequence_types.h"
+#include "DNA_shader_fx_types.h"
 #include "DNA_world_types.h"
 
 #include "BLI_listbase.h"
@@ -1269,17 +1273,44 @@ static void outliner_set_properties_tab(bContext *C, 
TreeElement *te, TreeStoreE
           RNA_id_pointer_create(tselem->id, &ptr);
           ED_buttons_set_context(C, &ptr, BCONTEXT_CONSTRAINT);
         }
+
+        /* Expand the selected constraint in the properties editor. */
+        if (tselem->type != TSE_CONSTRAINT_BASE) {
+          bConstraint *con = te->directdata;
+          con->ui_expand_flag |= (1 << 0);
+        }
         break;
       }
       case TSE_MODIFIER_BASE:
       case TSE_MODIFIER:
         RNA_id_pointer_create(tselem->id, &ptr);
         ED_buttons_set_context(C, &ptr, BCONTEXT_MODIFIER);
+
+        if (tselem->type != TSE_MODIFIER_BASE) {
+          Object *ob = (Object *)tselem->id;
+
+          if (ob->type == OB_GPENCIL) {
+            GpencilModifierData *md = te->directdata;
+            md->ui_expand_flag |= (1 << 0);
+          }
+          else {
+            ModifierData *md = te->directdata;
+            md->ui_expand_flag |= (1 << 0);
+          }
+        }
+
+        // PropertyRNA *prop = RNA_struct_type_find_property(&RNA_Modifier, 
"show_expanded");
+        // RNA_property_boolean_set(&ptr, prop, true);
         break;
       case TSE_EFFECT_BASE:
       case TSE_EFFECT:
         RNA_id_pointer_create(tselem->id, &ptr);
         ED_buttons_set_context(C, &ptr, BCONTEXT_SHADERFX);
+
+        if (tselem->type != TSE_EFFECT_BASE) {
+          ShaderFxData *sfx = te->directdata;
+          sfx->ui_expand_flag |= (1 << 0);
+        }
         break;
       case TSE_BONE: {
         bArmature *arm = (bArmature *)tselem->id;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to