diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-03-22 18:41:37 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-03-22 18:41:37 +0300 |
commit | 18e2a5df1a1d0a279c39f09f00f2c3275748ce60 (patch) | |
tree | e181c410467c23e0102dd3fb45ccb410f9cec48c /source | |
parent | 47acd706fde992e1b4f940145724aae9bf896861 (diff) | |
parent | 69b327d8dcf91cccedf08b9a50c92d5b3922449b (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval.cc | 5 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_edit.c | 8 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_utils.c | 14 | ||||
-rw-r--r-- | source/blender/editors/include/ED_armature.h | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 2 |
5 files changed, 25 insertions, 6 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index a8fa73654a4..f3b45303e35 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -235,6 +235,7 @@ void deg_evaluate_on_refresh(EvaluationContext *eval_ctx, return; } const bool do_time_debug = ((G.debug & G_DEBUG_DEPSGRAPH_TIME) != 0); + const double start_time = do_time_debug ? PIL_check_seconds_timer() : 0; /* Set time for the current graph evaluation context. */ TimeSourceDepsNode *time_src = graph->find_time_source(); eval_ctx->depsgraph = (::Depsgraph *)graph; @@ -275,6 +276,10 @@ void deg_evaluate_on_refresh(EvaluationContext *eval_ctx, if (need_free_scheduler) { BLI_task_scheduler_free(task_scheduler); } + if (do_time_debug) { + printf("Depsgraph updated in %f seconds.\n", + PIL_check_seconds_timer() - start_time); + } } } // namespace DEG diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index 6c8779202e9..bb3c4164fc1 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -1458,8 +1458,9 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op)) if (ebone->flag & BONE_DONE) { copy_v3_v3(ebone->parent->tail, ebone->tail); ebone->parent->rad_tail = ebone->rad_tail; + SET_FLAG_FROM_TEST(ebone->parent->flag, ebone->flag & BONE_TIPSEL, BONE_TIPSEL); - ED_armature_edit_bone_remove(arm, ebone); + ED_armature_edit_bone_remove_ex(arm, ebone, false); changed = true; } } @@ -1468,10 +1469,9 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op)) for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { if (ebone->parent && ebone->parent->temp.ebone && - (ebone->flag & BONE_CONNECTED) == 0) + (ebone->flag & BONE_CONNECTED)) { - ebone->flag |= BONE_CONNECTED; - ebone->rad_head = ebone->parent->rad_head; + ebone->rad_head = ebone->parent->rad_tail; } } diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c index 23a49d282e1..eaff0b10a02 100644 --- a/source/blender/editors/armature/armature_utils.c +++ b/source/blender/editors/armature/armature_utils.c @@ -134,7 +134,10 @@ void bone_free(bArmature *arm, EditBone *bone) BLI_freelinkN(arm->edbo, bone); } -void ED_armature_edit_bone_remove(bArmature *arm, EditBone *exBone) +/** + * \param clear_connected: When false caller is responsible for keeping the flag in a valid state. + */ +void ED_armature_edit_bone_remove_ex(bArmature *arm, EditBone *exBone, bool clear_connected) { EditBone *curBone; @@ -142,13 +145,20 @@ void ED_armature_edit_bone_remove(bArmature *arm, EditBone *exBone) for (curBone = arm->edbo->first; curBone; curBone = curBone->next) { if (curBone->parent == exBone) { curBone->parent = exBone->parent; - curBone->flag &= ~BONE_CONNECTED; + if (clear_connected) { + curBone->flag &= ~BONE_CONNECTED; + } } } bone_free(arm, exBone); } +void ED_armature_edit_bone_remove(bArmature *arm, EditBone *exBone) +{ + ED_armature_edit_bone_remove_ex(arm, exBone, true); +} + bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebone_child) { for (ebone_child = ebone_child->parent; ebone_child; ebone_child = ebone_child->parent) { diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 51d8f8edb44..a35380ca547 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -156,6 +156,8 @@ void ED_armature_validate_active(struct bArmature *arm); EditBone *ED_armature_edit_bone_add_primitive(struct Object *obedit_arm, float length, bool view_aligned); EditBone *ED_armature_edit_bone_add(struct bArmature *arm, const char *name); + +void ED_armature_edit_bone_remove_ex(struct bArmature *arm, EditBone *exBone, bool clear_connected); void ED_armature_edit_bone_remove(struct bArmature *arm, EditBone *exBone); bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebone_child); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 06028cbc6c7..a173281b7d0 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -366,6 +366,8 @@ static void wm_block_confirm_quit_save(bContext *C, void *arg_block, void *UNUSE WM_operator_properties_create_ptr(&props_ptr, ot); RNA_boolean_set(&props_ptr, "exit", true); + /* No need for second confirmation popup. */ + RNA_boolean_set(&props_ptr, "check_existing", false); WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &props_ptr); WM_operator_properties_free(&props_ptr); } |