diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-04-02 18:51:44 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-04-02 18:51:44 +0300 |
commit | 1d365374e81a6ba402858e48acd9adadf54b7b92 (patch) | |
tree | 14fbcd877f7a1835a687aa9a58156539eab2e9aa /source/blender/editors | |
parent | 96de11c2c67e332dc0d303210fd1fddbb532c5ca (diff) | |
parent | 4c2b79a1d5a6302c96b9be6aa1e4dc2bab50e414 (diff) |
Merge branch 'blender2.7'
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 59 |
1 files changed, 6 insertions, 53 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 213c9df4b29..0bb1497a74e 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -27,6 +27,7 @@ #include "MEM_guardedalloc.h" #include "DNA_cachefile_types.h" +#include "DNA_constraint_types.h" #include "DNA_node_types.h" #include "DNA_scene_types.h" #include "DNA_object_types.h" @@ -50,8 +51,10 @@ #include "BLF_api.h" #include "BLT_translation.h" +#include "BKE_action.h" #include "BKE_colorband.h" #include "BKE_colortools.h" +#include "BKE_constraint.h" #include "BKE_context.h" #include "BKE_global.h" #include "BKE_gpencil_modifier.h" @@ -1938,55 +1941,6 @@ void uiTemplateOperatorRedoProperties(uiLayout *layout, const bContext *C) /************************ Constraint Template *************************/ -#include "DNA_constraint_types.h" - -#include "BKE_action.h" -#include "BKE_constraint.h" - -#define B_CONSTRAINT_TEST 5 -// #define B_CONSTRAINT_CHANGETARGET 6 - -static void do_constraint_panels(bContext *C, void *ob_pt, int event) -{ - Object *ob = (Object *)ob_pt; - - switch (event) { - case B_CONSTRAINT_TEST: - break; /* no handling */ -#if 0 /* UNUSED */ - case B_CONSTRAINT_CHANGETARGET: - { - Main *bmain = CTX_data_main(C); - if (ob->pose) { - BKE_pose_tag_recalc(bmain, ob->pose); /* checks & sorts pose channels */ - } - DEG_relations_tag_update(bmain); - break; - } -#endif - default: - break; - } - - /* note: RNA updates now call this, commenting else it gets called twice. - * if there are problems because of this, then rna needs changed update functions. */ -#if 0 - object_test_constraints(ob); - if (ob->pose) { - BKE_pose_update_constraint_flags(ob->pose); - } -#endif - - if (ob->type == OB_ARMATURE) { - DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY | ID_RECALC_TRANSFORM); - } - else { - DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); - } - - WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, ob); -} - static void constraint_active_func(bContext *UNUSED(C), void *ob_v, void *con_v) { ED_object_constraint_set_active(ob_v, con_v); @@ -2024,7 +1978,6 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) /* unless button has own callback, it adds this callback to button */ block = uiLayoutGetBlock(layout); - UI_block_func_handle_set(block, do_constraint_panels, ob); UI_block_func_set(block, constraint_active_func, ob, con); RNA_pointer_create(&ob->id, &RNA_Constraint, con, &ptr); @@ -2044,7 +1997,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) UI_block_emboss_set(block, UI_EMBOSS); /* name */ - uiDefBut(block, UI_BTYPE_LABEL, B_CONSTRAINT_TEST, typestr, + uiDefBut(block, UI_BTYPE_LABEL, 0, typestr, xco + 0.5f * UI_UNIT_X, yco, 5 * UI_UNIT_X, 0.9f * UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, ""); if (con->flag & CONSTRAINT_DISABLE) { @@ -2066,9 +2019,9 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) /* draw a ghost icon (for proxy) and also a lock beside it, * to show that constraint is "proxy locked" */ - uiDefIconBut(block, UI_BTYPE_BUT, B_CONSTRAINT_TEST, ICON_GHOST_ENABLED, xco + 12.2f * UI_UNIT_X, yco, 0.95f * UI_UNIT_X, 0.95f * UI_UNIT_Y, + uiDefIconBut(block, UI_BTYPE_BUT, 0, ICON_GHOST_ENABLED, xco + 12.2f * UI_UNIT_X, yco, 0.95f * UI_UNIT_X, 0.95f * UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Proxy Protected")); - uiDefIconBut(block, UI_BTYPE_BUT, B_CONSTRAINT_TEST, ICON_LOCKED, xco + 13.1f * UI_UNIT_X, yco, 0.95f * UI_UNIT_X, 0.95f * UI_UNIT_Y, + uiDefIconBut(block, UI_BTYPE_BUT, 0, ICON_LOCKED, xco + 13.1f * UI_UNIT_X, yco, 0.95f * UI_UNIT_X, 0.95f * UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Proxy Protected")); UI_block_emboss_set(block, UI_EMBOSS); |