diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-01-28 01:04:17 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-01-28 01:04:17 +0300 |
commit | b6ac95145cf616a36e58c846e7fccbf7ccc69faa (patch) | |
tree | 916ec4c6900dbe1709002dcb41c2ceebdf983b67 /source/blender/editors | |
parent | 79c90bd49fafd050883161798a45427d60ffd0ed (diff) | |
parent | da848b7440ab8878b350f764dfbf70729e43021d (diff) |
Merge branch 'master' into temp-gpu-image-enginetemp-gpu-image-engine
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_context_menu.c | 14 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/io/io_usd.c | 55 | ||||
-rw-r--r-- | source/blender/editors/object/object_data_transfer.c | 15 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_select.cc | 21 |
6 files changed, 105 insertions, 16 deletions
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index 190b2d12ed9..dd5ce118d5f 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -809,12 +809,18 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev else { if (is_array_component) { ot = WM_operatortype_find("UI_OT_override_type_set_button", false); - uiItemFullO_ptr( - layout, ot, "Define Overrides", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr); + uiItemFullO_ptr(layout, + ot, + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Define Overrides"), + ICON_NONE, + NULL, + WM_OP_INVOKE_DEFAULT, + 0, + &op_ptr); RNA_boolean_set(&op_ptr, "all", true); uiItemFullO_ptr(layout, ot, - "Define Single Override", + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Define Single Override"), ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, @@ -825,7 +831,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev else { uiItemFullO(layout, "UI_OT_override_type_set_button", - "Define Override", + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Define Override"), ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index f7424066ad8..33c6e382f50 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -597,6 +597,9 @@ static int override_type_set_button_exec(bContext *C, wmOperator *op) opop->operation = operation; } + /* Outliner e.g. has to be aware of this change. */ + WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL); + return operator_button_property_finish(C, &ptr, prop); } @@ -714,6 +717,9 @@ static int override_remove_button_exec(bContext *C, wmOperator *op) } } + /* Outliner e.g. has to be aware of this change. */ + WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL); + return operator_button_property_finish(C, &ptr, prop); } diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c index 4e2ccea36ab..49d60ede277 100644 --- a/source/blender/editors/io/io_usd.c +++ b/source/blender/editors/io/io_usd.c @@ -131,6 +131,11 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op) const bool use_instancing = RNA_boolean_get(op->ptr, "use_instancing"); const bool evaluation_mode = RNA_enum_get(op->ptr, "evaluation_mode"); + const bool generate_preview_surface = RNA_boolean_get(op->ptr, "generate_preview_surface"); + const bool export_textures = RNA_boolean_get(op->ptr, "export_textures"); + const bool overwrite_textures = RNA_boolean_get(op->ptr, "overwrite_textures"); + const bool relative_texture_paths = RNA_boolean_get(op->ptr, "relative_texture_paths"); + struct USDExportParams params = { export_animation, export_hair, @@ -141,6 +146,10 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op) visible_objects_only, use_instancing, evaluation_mode, + generate_preview_surface, + export_textures, + overwrite_textures, + relative_texture_paths, }; bool ok = USD_export(C, filename, ¶ms, as_background_job); @@ -173,6 +182,26 @@ static void wm_usd_export_draw(bContext *UNUSED(C), wmOperator *op) uiItemR(col, ptr, "evaluation_mode", 0, NULL, ICON_NONE); box = uiLayoutBox(layout); + col = uiLayoutColumnWithHeading(box, true, IFACE_("Materials")); + uiItemR(col, ptr, "generate_preview_surface", 0, NULL, ICON_NONE); + const bool export_mtl = RNA_boolean_get(ptr, "export_materials"); + uiLayoutSetActive(col, export_mtl); + + uiLayout *row = uiLayoutRow(col, true); + uiItemR(row, ptr, "export_textures", 0, NULL, ICON_NONE); + const bool preview = RNA_boolean_get(ptr, "generate_preview_surface"); + uiLayoutSetActive(row, export_mtl && preview); + + row = uiLayoutRow(col, true); + uiItemR(row, ptr, "overwrite_textures", 0, NULL, ICON_NONE); + const bool export_tex = RNA_boolean_get(ptr, "export_textures"); + uiLayoutSetActive(row, export_mtl && preview && export_tex); + + row = uiLayoutRow(col, true); + uiItemR(row, ptr, "relative_texture_paths", 0, NULL, ICON_NONE); + uiLayoutSetActive(row, export_mtl && preview); + + box = uiLayoutBox(layout); uiItemL(box, IFACE_("Experimental"), ICON_NONE); uiItemR(box, ptr, "use_instancing", 0, NULL, ICON_NONE); } @@ -249,6 +278,32 @@ void WM_OT_usd_export(struct wmOperatorType *ot) "Use Settings for", "Determines visibility of objects, modifier settings, and other areas where there " "are different settings for viewport and rendering"); + + RNA_def_boolean(ot->srna, + "generate_preview_surface", + true, + "To USD Preview Surface", + "Generate an approximate USD Preview Surface shader " + "representation of a Principled BSDF node network"); + + RNA_def_boolean(ot->srna, + "export_textures", + true, + "Export Textures", + "If exporting materials, export textures referenced by material nodes " + "to a 'textures' directory in the same directory as the USD file"); + + RNA_def_boolean(ot->srna, + "overwrite_textures", + false, + "Overwrite Textures", + "Allow overwriting existing texture files when exporting textures"); + + RNA_def_boolean(ot->srna, + "relative_texture_paths", + true, + "Relative Texture Paths", + "Make texture asset paths relative to the USD file"); } /* ====== USD Import ====== */ diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 49149a5152f..595822de1e7 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -603,6 +603,20 @@ static bool data_transfer_poll_property(const bContext *UNUSED(C), return true; } +static char *data_transfer_get_description(bContext *UNUSED(C), + wmOperatorType *UNUSED(ot), + PointerRNA *ptr) +{ + const bool reverse_transfer = RNA_boolean_get(ptr, "use_reverse_transfer"); + + if (reverse_transfer) { + return BLI_strdup( + "Transfer data layer(s) (weights, edge sharp, etc.) from selected meshes to active one"); + } + + return NULL; +} + void OBJECT_OT_data_transfer(wmOperatorType *ot) { PropertyRNA *prop; @@ -619,6 +633,7 @@ void OBJECT_OT_data_transfer(wmOperatorType *ot) ot->invoke = WM_menu_invoke; ot->exec = data_transfer_exec; ot->check = data_transfer_check; + ot->get_description = data_transfer_get_description; /* Flags. */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 38d0a044cb4..a38a5165c8c 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1976,8 +1976,14 @@ static void move_to_collection_menu_create(bContext *C, uiLayout *layout, void * RNA_int_set(&menu->ptr, "collection_index", menu->index); RNA_boolean_set(&menu->ptr, "is_new", true); - uiItemFullO_ptr( - layout, menu->ot, "New Collection", ICON_ADD, menu->ptr.data, WM_OP_INVOKE_DEFAULT, 0, NULL); + uiItemFullO_ptr(layout, + menu->ot, + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "New Collection"), + ICON_ADD, + menu->ptr.data, + WM_OP_INVOKE_DEFAULT, + 0, + NULL); uiItemS(layout); diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc index 3ff8b9e973f..ebb4e529b04 100644 --- a/source/blender/editors/space_outliner/outliner_select.cc +++ b/source/blender/editors/space_outliner/outliner_select.cc @@ -1611,8 +1611,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C, if (!(te = outliner_find_item_at_y(space_outliner, &space_outliner->tree, view_mval[1]))) { if (deselect_all) { - outliner_flag_set(&space_outliner->tree, TSE_SELECTED, false); - changed = true; + changed |= outliner_flag_set(&space_outliner->tree, TSE_SELECTED, false); } } /* Don't allow toggle on scene collection */ @@ -1660,17 +1659,19 @@ static int outliner_item_do_activate_from_cursor(bContext *C, changed = true; } - if (changed) { - if (rebuild_tree) { - ED_region_tag_redraw(region); - } - else { - ED_region_tag_redraw_no_rebuild(region); - } + if (!changed) { + return OPERATOR_CANCELLED; + } - ED_outliner_select_sync_from_outliner(C, space_outliner); + if (rebuild_tree) { + ED_region_tag_redraw(region); + } + else { + ED_region_tag_redraw_no_rebuild(region); } + ED_outliner_select_sync_from_outliner(C, space_outliner); + return OPERATOR_FINISHED; } |