[Bf-blender-cvs] [9cb2b9b523e] blender2.8: Drivers UI (Part of T55145) - Show datablock that driven property belongs to instead of only the property
Joshua Leung
noreply at git.blender.org
Wed May 23 16:33:04 CEST 2018
Commit: 9cb2b9b523ec73b8fab2d0d7785576e3ae9fb9f2
Author: Joshua Leung
Date: Wed May 23 16:31:59 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9cb2b9b523ec73b8fab2d0d7785576e3ae9fb9f2
Drivers UI (Part of T55145) - Show datablock that driven property belongs to instead of only the property
Otherwise, it's not clear where things are coming from.
FIXME: The icons for datablocks may not always be correct. It uses the
innermost struct's icon instead of the datablock's icon - e.g. Bone
vs Object/Armature. But, that may make more sense for users?
===================================================================
M source/blender/editors/interface/interface_handlers.c
M source/blender/editors/space_graph/graph_buttons.c
===================================================================
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index d597fde767f..1959821ecdd 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -6801,7 +6801,7 @@ static bool ui_but_menu(bContext *C, uiBut *but)
}
uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Open Drivers Editor"),
- ICON_NONE, "SCREEN_OT_drivers_editor_show");
+ ICON_DRIVER, "SCREEN_OT_drivers_editor_show");
}
/* Keying Sets */
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 670d1463162..cd3a8246b44 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -724,6 +724,7 @@ static void graph_panel_driven_property(const bContext *C, Panel *pa)
FCurve *fcu;
PointerRNA fcu_ptr;
uiLayout *layout = pa->layout;
+ uiLayout *row;
char name[256];
int icon = 0;
@@ -733,7 +734,7 @@ static void graph_panel_driven_property(const bContext *C, Panel *pa)
/* F-Curve pointer */
RNA_pointer_create(ale->id, &RNA_FCurve, fcu, &fcu_ptr);
- /* user-friendly 'name' for F-Curve */
+ /* get user-friendly 'name' for F-Curve */
if (ale->type == ANIMTYPE_FCURVE) {
/* get user-friendly name for F-Curve */
icon = getname_anim_fcurve(name, ale->id, fcu);
@@ -755,7 +756,18 @@ static void graph_panel_driven_property(const bContext *C, Panel *pa)
if (ale->type == ANIMTYPE_NLACURVE)
icon = ICON_NLA;
}
- uiItemL(layout, name, icon);
+
+ /* panel layout... */
+ row = uiLayoutRow(layout, true);
+ uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_LEFT);
+
+ /* -> user friendly 'name' for datablock that owns F-Curve */
+ /* XXX: Actually, we may need the datablock icons only... (e.g. right now will show bone for bone props) */
+ uiItemL(row, ale->id->name + 2, icon);
+
+ /* -> user friendly 'name' for F-Curve/driver target */
+ uiItemL(row, "", VICO_SMALL_TRI_RIGHT_VEC);
+ uiItemL(row, name, ICON_RNA);
MEM_freeN(ale);
}
More information about the Bf-blender-cvs
mailing list