diff options
author | YimingWu <xp8110@outlook.com> | 2019-07-04 05:46:15 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2019-07-04 05:46:15 +0300 |
commit | 5ddcffa17c2492d7a2676bcbce0fb46a3cd5a161 (patch) | |
tree | 7fbdb355efa33cf2e0d9034159d9ab84281c2dad /source/blender/editors | |
parent | adab7242d415bbc8d5b74874814817f38d540337 (diff) | |
parent | c252fe7a32ab56f1bb052b083e7ceaec0bd5a49f (diff) |
Merge branch 'master' into soc-2019-npr
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 3 | ||||
-rw-r--r-- | source/blender/editors/object/object_transform.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/workspace_edit.c | 64 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 15 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 13 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_unwrap_ops.c | 1 |
7 files changed, 33 insertions, 69 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index f98a3248e76..6f0319223e0 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -534,6 +534,9 @@ static int edbm_delete_exec(bContext *C, wmOperator *op) EDBM_flag_disable_all(em, BM_ELEM_SELECT); EDBM_update_generic(em, true, true); + + DEG_id_tag_update(obedit->data, ID_RECALC_SELECT); + WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); } MEM_freeN(objects); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 394fea2cf27..2425b5dd2f7 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -475,6 +475,10 @@ static void ignore_parent_tx(Main *bmain, Depsgraph *depsgraph, Scene *scene, Ob invert_m4_m4(ob_child->parentinv, workob.obmat); /* Copy result of BKE_object_apply_mat4(). */ BKE_object_transform_copy(ob_child, ob_child_eval); + /* Tag for update. + * This is because parent matrix did change, so in theory the child object might now be + * evaluated to a different location in another editing context. */ + DEG_id_tag_update(&ob_child->id, ID_RECALC_TRANSFORM); } } } diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c index f4138dd7847..61b737589c8 100644 --- a/source/blender/editors/screen/workspace_edit.c +++ b/source/blender/editors/screen/workspace_edit.c @@ -331,30 +331,6 @@ static void WORKSPACE_OT_delete(wmOperatorType *ot) ot->exec = workspace_delete_exec; } -static bool workspace_append_activate_poll(bContext *C) -{ - wmOperatorType *ot = WM_operatortype_find("WM_OT_append", false); - return WM_operator_poll(C, ot); -} - -static int workspace_append(bContext *C, const char *directory, const char *idname) -{ - wmOperatorType *ot = WM_operatortype_find("WM_OT_append", false); - PointerRNA opptr; - int retval; - - WM_operator_properties_create_ptr(&opptr, ot); - RNA_string_set(&opptr, "directory", directory); - RNA_string_set(&opptr, "filename", idname); - RNA_boolean_set(&opptr, "autoselect", false); - - retval = WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &opptr); - - WM_operator_properties_free(&opptr); - - return retval; -} - static int workspace_append_activate_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); @@ -367,23 +343,20 @@ static int workspace_append_activate_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "idname", idname); RNA_string_get(op->ptr, "filepath", filepath); - if (workspace_append(C, filepath, idname) != OPERATOR_CANCELLED) { - WorkSpace *appended_workspace = BLI_findstring( - &bmain->workspaces, idname, offsetof(ID, name) + 2); - BLI_assert(appended_workspace != NULL); + WorkSpace *appended_workspace = (WorkSpace *)WM_file_append_datablock( + C, filepath, ID_WS, idname); - if (appended_workspace) { - /* Set defaults. */ - BLO_update_defaults_workspace(appended_workspace, NULL); + if (appended_workspace) { + /* Set defaults. */ + BLO_update_defaults_workspace(appended_workspace, NULL); - /* Reorder to last position. */ - BKE_id_reorder(&bmain->workspaces, &appended_workspace->id, NULL, true); + /* Reorder to last position. */ + BKE_id_reorder(&bmain->workspaces, &appended_workspace->id, NULL, true); - /* Changing workspace changes context. Do delayed! */ - WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_SET, appended_workspace); + /* Changing workspace changes context. Do delayed! */ + WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_SET, appended_workspace); - return OPERATOR_FINISHED; - } + return OPERATOR_FINISHED; } return OPERATOR_CANCELLED; @@ -398,7 +371,6 @@ static void WORKSPACE_OT_append_activate(wmOperatorType *ot) /* api callbacks */ ot->exec = workspace_append_activate_exec; - ot->poll = workspace_append_activate_poll; RNA_def_string(ot->srna, "idname", @@ -449,25 +421,21 @@ static void workspace_append_button(uiLayout *layout, { const ID *id = (ID *)workspace; PointerRNA opptr; - char lib_path[FILE_MAX_LIBEXTRA]; const char *filepath = from_main->name; if (strlen(filepath) == 0) { filepath = BLO_EMBEDDED_STARTUP_BLEND; } - BLI_path_join(lib_path, sizeof(lib_path), filepath, BKE_idcode_to_name(GS(id->name)), NULL); - BLI_assert(STREQ(ot_append->idname, "WORKSPACE_OT_append_activate")); uiItemFullO_ptr( layout, ot_append, workspace->id.name + 2, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &opptr); RNA_string_set(&opptr, "idname", id->name + 2); - RNA_string_set(&opptr, "filepath", lib_path); + RNA_string_set(&opptr, "filepath", filepath); } -static void workspace_add_menu(bContext *C, uiLayout *layout, void *template_v) +static void workspace_add_menu(bContext *UNUSED(C), uiLayout *layout, void *template_v) { - Main *bmain = CTX_data_main(C); const char *app_template = template_v; bool has_startup_items = false; @@ -479,10 +447,6 @@ static void workspace_add_menu(bContext *C, uiLayout *layout, void *template_v) for (WorkSpace *workspace = startup_config->workspaces.first; workspace; workspace = workspace->id.next) { uiLayout *row = uiLayoutRow(layout, false); - if (BLI_findstring(&bmain->workspaces, workspace->id.name, offsetof(ID, name))) { - uiLayoutSetActive(row, false); - } - workspace_append_button(row, ot_append, workspace, startup_config->main); has_startup_items = true; } @@ -506,10 +470,6 @@ static void workspace_add_menu(bContext *C, uiLayout *layout, void *template_v) } uiLayout *row = uiLayoutRow(layout, false); - if (BLI_findstring(&bmain->workspaces, workspace->id.name, offsetof(ID, name))) { - uiLayoutSetActive(row, false); - } - workspace_append_button(row, ot_append, workspace, builtin_config->main); } } diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 22900ee3787..7c4f9f1d95b 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -617,6 +617,8 @@ static void viewRedrawForce(const bContext *C, TransInfo *t) } else if (t->spacetype == SPACE_SEQ) { WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, NULL); + /* Keyframes on strips has been moved, so make sure related editos are informed. */ + WM_event_add_notifier(C, NC_ANIMATION, NULL); } else if (t->spacetype == SPACE_IMAGE) { if (t->options & CTX_MASK) { diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 1ed0d5e9221..95c2f088e5d 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2935,11 +2935,16 @@ static void VertsToTransData(TransInfo *t, } else if (t->mode == TFM_SKIN_RESIZE) { MVertSkin *vs = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MVERT_SKIN); - /* skin node size */ - td->ext = tx; - copy_v3_v3(tx->isize, vs->radius); - tx->size = vs->radius; - td->val = vs->radius; + if (vs) { + /* skin node size */ + td->ext = tx; + copy_v3_v3(tx->isize, vs->radius); + tx->size = vs->radius; + td->val = vs->radius; + } + else { + td->flag |= TD_SKIP; + } } else if (t->mode == TFM_SHRINKFATTEN) { td->ext = tx; diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index f028f2dc506..e038a2bf79e 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -33,6 +33,7 @@ #include "BKE_global.h" #include "BKE_report.h" #include "BKE_editmesh.h" +#include "BKE_layer.h" #include "BKE_scene.h" #include "RNA_access.h" @@ -754,16 +755,6 @@ static void TRANSFORM_OT_resize(struct wmOperatorType *ot) P_OPTIONS | P_GPENCIL_EDIT | P_CENTER); } -static bool skin_resize_poll(bContext *C) -{ - struct Object *obedit = CTX_data_edit_object(C); - if (obedit && obedit->type == OB_MESH) { - BMEditMesh *em = BKE_editmesh_from_object(obedit); - return (em && CustomData_has_layer(&em->bm->vdata, CD_MVERT_SKIN)); - } - return 0; -} - static void TRANSFORM_OT_skin_resize(struct wmOperatorType *ot) { /* identifiers */ @@ -777,7 +768,7 @@ static void TRANSFORM_OT_skin_resize(struct wmOperatorType *ot) ot->exec = transform_exec; ot->modal = transform_modal; ot->cancel = transform_cancel; - ot->poll = skin_resize_poll; + ot->poll = ED_operator_screenactive; ot->poll_property = transform_poll_property; RNA_def_float_vector( diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 14cdb674698..a42a6eba3ff 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -2282,7 +2282,6 @@ static void uvedit_unwrap_cube_project(BMesh *bm, * component, but clusters all together around the center of map. */ BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) { - /* tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */ if (use_select && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) { continue; } |