diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 111 |
1 files changed, 73 insertions, 38 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index cae86801402..0a3c7827ed0 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -88,7 +88,7 @@ const EnumPropertyItem rna_enum_space_type_items[] = { {SPACE_EMPTY, "EMPTY", ICON_NONE, "Empty", ""}, /* General. */ - RNA_ENUM_ITEM_HEADING("General", NULL), + RNA_ENUM_ITEM_HEADING(N_("General"), NULL), {SPACE_VIEW3D, "VIEW_3D", ICON_VIEW3D, @@ -108,7 +108,7 @@ const EnumPropertyItem rna_enum_space_type_items[] = { {SPACE_CLIP, "CLIP_EDITOR", ICON_TRACKER, "Movie Clip Editor", "Motion tracking tools"}, /* Animation. */ - RNA_ENUM_ITEM_HEADING("Animation", NULL), + RNA_ENUM_ITEM_HEADING(N_("Animation"), NULL), #if 0 {SPACE_ACTION, "TIMELINE", @@ -125,7 +125,7 @@ const EnumPropertyItem rna_enum_space_type_items[] = { {SPACE_NLA, "NLA_EDITOR", ICON_NLA, "Nonlinear Animation", "Combine and layer Actions"}, /* Scripting. */ - RNA_ENUM_ITEM_HEADING("Scripting", NULL), + RNA_ENUM_ITEM_HEADING(N_("Scripting"), NULL), {SPACE_TEXT, "TEXT_EDITOR", ICON_TEXT, @@ -153,7 +153,7 @@ const EnumPropertyItem rna_enum_space_type_items[] = { "screen for general status information"}, /* Data. */ - RNA_ENUM_ITEM_HEADING("Data", NULL), + RNA_ENUM_ITEM_HEADING(N_("Data"), NULL), {SPACE_OUTLINER, "OUTLINER", ICON_OUTLINER, @@ -435,28 +435,31 @@ static const EnumPropertyItem rna_enum_studio_light_items[] = { }; static const EnumPropertyItem rna_enum_view3dshading_render_pass_type_items[] = { - RNA_ENUM_ITEM_HEADING("General", NULL), + RNA_ENUM_ITEM_HEADING(N_("General"), NULL), {EEVEE_RENDER_PASS_COMBINED, "COMBINED", 0, "Combined", ""}, {EEVEE_RENDER_PASS_EMIT, "EMISSION", 0, "Emission", ""}, {EEVEE_RENDER_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""}, {EEVEE_RENDER_PASS_AO, "AO", 0, "Ambient Occlusion", ""}, {EEVEE_RENDER_PASS_SHADOW, "SHADOW", 0, "Shadow", ""}, - RNA_ENUM_ITEM_HEADING("Light", NULL), + RNA_ENUM_ITEM_HEADING(N_("Light"), NULL), {EEVEE_RENDER_PASS_DIFFUSE_LIGHT, "DIFFUSE_LIGHT", 0, "Diffuse Light", ""}, {EEVEE_RENDER_PASS_DIFFUSE_COLOR, "DIFFUSE_COLOR", 0, "Diffuse Color", ""}, {EEVEE_RENDER_PASS_SPECULAR_LIGHT, "SPECULAR_LIGHT", 0, "Specular Light", ""}, {EEVEE_RENDER_PASS_SPECULAR_COLOR, "SPECULAR_COLOR", 0, "Specular Color", ""}, {EEVEE_RENDER_PASS_VOLUME_LIGHT, "VOLUME_LIGHT", 0, "Volume Light", ""}, - RNA_ENUM_ITEM_HEADING("Effects", NULL), + RNA_ENUM_ITEM_HEADING(N_("Effects"), NULL), {EEVEE_RENDER_PASS_BLOOM, "BLOOM", 0, "Bloom", ""}, - RNA_ENUM_ITEM_HEADING("Data", NULL), + RNA_ENUM_ITEM_HEADING(N_("Data"), NULL), {EEVEE_RENDER_PASS_NORMAL, "NORMAL", 0, "Normal", ""}, {EEVEE_RENDER_PASS_MIST, "MIST", 0, "Mist", ""}, + {EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT, "CryptoObject", 0, "CryptoObject", ""}, + {EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET, "CryptoAsset", 0, "CryptoAsset", ""}, + {EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL, "CryptoMaterial", 0, "CryptoMaterial", ""}, - RNA_ENUM_ITEM_HEADING("Shader AOV", NULL), + RNA_ENUM_ITEM_HEADING(N_("Shader AOV"), NULL), {EEVEE_RENDER_PASS_AOV, "AOV", 0, "AOV", ""}, {0, NULL, 0, NULL, NULL}, @@ -1100,7 +1103,7 @@ static bool rna_RegionView3D_is_orthographic_side_view_get(PointerRNA *ptr) return RV3D_VIEW_IS_AXIS(rv3d->view); } -static void rna_RegionView3D_is_orthographic_side_view_set(PointerRNA *ptr, int value) +static void rna_RegionView3D_is_orthographic_side_view_set(PointerRNA *ptr, bool value) { RegionView3D *rv3d = (RegionView3D *)(ptr->data); const bool was_axis_view = RV3D_VIEW_IS_AXIS(rv3d->view); @@ -1423,6 +1426,7 @@ static const EnumPropertyItem *rna_3DViewShading_render_pass_itemf(bContext *C, const bool bloom_enabled = scene->eevee.flag & SCE_EEVEE_BLOOM_ENABLED; const bool aov_available = BKE_view_layer_has_valid_aov(view_layer); + const bool eevee_next_active = STREQ(scene->r.engine, "BLENDER_EEVEE_NEXT"); int totitem = 0; EnumPropertyItem *result = NULL; @@ -1443,6 +1447,12 @@ static const EnumPropertyItem *rna_3DViewShading_render_pass_itemf(bContext *C, aov_template.value++; } } + else if (ELEM(item->value, + EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT, + EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET, + EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL) && + !eevee_next_active) { + } else if (!((!bloom_enabled && (item->value == EEVEE_RENDER_PASS_BLOOM || STREQ(item->name, "Effects"))) || (!aov_available && STREQ(item->name, "Shader AOV")))) { @@ -1519,7 +1529,7 @@ static void rna_SpaceView3D_use_local_collections_update(bContext *C, PointerRNA View3D *v3d = (View3D *)ptr->data; if (ED_view3d_local_collections_set(bmain, v3d)) { - BKE_layer_collection_local_sync(view_layer, v3d); + BKE_layer_collection_local_sync(scene, view_layer, v3d); DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); } } @@ -1609,7 +1619,7 @@ static void rna_SpaceImageEditor_mode_update(Main *bmain, Scene *scene, PointerR } } -static void rna_SpaceImageEditor_show_stereo_set(PointerRNA *ptr, int value) +static void rna_SpaceImageEditor_show_stereo_set(PointerRNA *ptr, bool value) { SpaceImage *sima = (SpaceImage *)(ptr->data); @@ -1663,8 +1673,10 @@ static bool rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr) Object *obedit = NULL; wmWindow *win = ED_screen_window_find(screen, G_MAIN->wm.first); if (win != NULL) { + Scene *scene = WM_window_get_active_scene(win); ViewLayer *view_layer = WM_window_get_active_view_layer(win); - obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + obedit = BKE_view_layer_edit_object_get(view_layer); } return ED_space_image_show_uvedit(sima, obedit); } @@ -1676,8 +1688,10 @@ static bool rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr) Object *obedit = NULL; wmWindow *win = ED_screen_window_find(screen, G_MAIN->wm.first); if (win != NULL) { + Scene *scene = WM_window_get_active_scene(win); ViewLayer *view_layer = WM_window_get_active_view_layer(win); - obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + obedit = BKE_view_layer_edit_object_get(view_layer); } return ED_space_image_check_show_maskedit(sima, obedit); } @@ -2174,10 +2188,12 @@ static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr) { SpaceAction *saction = (SpaceAction *)(ptr->data); + const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Main *bmain = CTX_data_main(C); - Object *obact = OBACT(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + Object *obact = BKE_view_layer_active_object_get(view_layer); if (obact == NULL) { return; } @@ -2249,8 +2265,10 @@ static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr) { SpaceAction *saction = (SpaceAction *)(ptr->data); ScrArea *area = CTX_wm_area(C); + const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *obact = OBACT(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + Object *obact = BKE_view_layer_active_object_get(view_layer); /* special exceptions for ShapeKey Editor mode */ if (saction->mode == SACTCONT_SHAPEKEY) { @@ -3478,9 +3496,9 @@ static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *m RNA_def_property_ui_text(prop, "Edge Display Type", "Display type for mask splines"); RNA_def_property_update(prop, noteflag, NULL); - prop = RNA_def_property(srna, "show_mask_smooth", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mask_info.draw_flag", MASK_DRAWFLAG_SMOOTH); - RNA_def_property_ui_text(prop, "Display Smooth Splines", ""); + prop = RNA_def_property(srna, "show_mask_spline", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mask_info.draw_flag", MASK_DRAWFLAG_SPLINE); + RNA_def_property_ui_text(prop, "Show Mask Spline", ""); RNA_def_property_update(prop, noteflag, NULL); prop = RNA_def_property(srna, "show_mask_overlay", PROP_BOOLEAN, PROP_NONE); @@ -3493,6 +3511,13 @@ static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *m RNA_def_property_enum_items(prop, overlay_mode_items); RNA_def_property_ui_text(prop, "Overlay Mode", "Overlay mode of rasterized mask"); RNA_def_property_update(prop, noteflag, NULL); + + prop = RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "mask_info.blend_factor"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_range(prop, 0, 1., 0.1, 1); + RNA_def_property_ui_text(prop, "Blending Factor", "Overlay blending factor of rasterized mask"); + RNA_def_property_update(prop, noteflag, NULL); } static void rna_def_space_image_uv(BlenderRNA *brna) @@ -3506,10 +3531,10 @@ static void rna_def_space_image_uv(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; - static const EnumPropertyItem pixel_snap_mode_items[] = { - {SI_PIXEL_SNAP_DISABLED, "DISABLED", 0, "Disabled", "Don't snap to pixels"}, - {SI_PIXEL_SNAP_CORNER, "CORNER", 0, "Corner", "Snap to pixel corners"}, - {SI_PIXEL_SNAP_CENTER, "CENTER", 0, "Center", "Snap to pixel centers"}, + static const EnumPropertyItem pixel_round_mode_items[] = { + {SI_PIXEL_ROUND_DISABLED, "DISABLED", 0, "Disabled", "Don't round to pixels"}, + {SI_PIXEL_ROUND_CORNER, "CORNER", 0, "Corner", "Round to pixel corners"}, + {SI_PIXEL_ROUND_CENTER, "CENTER", 0, "Center", "Round to pixel centers"}, {0, NULL, 0, NULL, NULL}, }; @@ -3539,6 +3564,7 @@ static void rna_def_space_image_uv(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch"); RNA_def_property_enum_items(prop, dt_uvstretch_items); RNA_def_property_ui_text(prop, "Display Stretch Type", "Type of stretch to display"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MESH); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE); @@ -3598,11 +3624,9 @@ static void rna_def_space_image_uv(BlenderRNA *brna) RNA_def_property_ui_text(prop, "UV Opacity", "Opacity of UV overlays"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); - /* TODO: move edge and face drawing options here from `G.f`. */ - - prop = RNA_def_property(srna, "pixel_snap_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, pixel_snap_mode_items); - RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixels while editing"); + prop = RNA_def_property(srna, "pixel_round_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, pixel_round_mode_items); + RNA_def_property_ui_text(prop, "Round to Pixels", "Round UVs to pixels while editing"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE); @@ -3972,6 +3996,7 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna) prop = RNA_def_property(srna, "cavity_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, cavity_type_items); RNA_def_property_ui_text(prop, "Cavity Type", "Way to display the cavity shading"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_EDITOR_VIEW3D); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, NULL); prop = RNA_def_property(srna, "curvature_ridge_factor", PROP_FLOAT, PROP_FACTOR); @@ -4192,6 +4217,14 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Shader AOV Name", "Name of the active Shader AOV"); RNA_def_property_flag(prop, PROP_HIDDEN); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "use_compositor", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SHADING_COMPOSITOR); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_boolean_default(prop, false); + RNA_def_property_ui_text( + prop, "Compositor", "Preview the compositor output inside the viewport"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, NULL); } static void rna_def_space_view3d_overlay(BlenderRNA *brna) @@ -4547,7 +4580,7 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_curve_display_handle_items); RNA_def_property_ui_text( prop, "Display Handles", "Limit the display of curve handles in edit mode"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); prop = RNA_def_property(srna, "show_curve_normals", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "overlay.edit_flag", V3D_OVERLAY_EDIT_CU_NORMALS); @@ -4720,6 +4753,13 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Opacity", "Vertex Paint mix factor"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); + + /* Developer Debug overlay */ + + prop = RNA_def_property(srna, "use_debug_freeze_view_culling", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "debug_flag", V3D_DEBUG_FREEZE_CULLING); + RNA_def_property_ui_text(prop, "Freeze Culling", "Freeze view culling bounds"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); } static void rna_def_space_view3d(BlenderRNA *brna) @@ -5291,6 +5331,7 @@ static void rna_def_space_image_overlay(BlenderRNA *brna) prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "overlay.flag", SI_OVERLAY_SHOW_OVERLAYS); RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like UV Maps and Metadata"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "show_grid_background", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "overlay.flag", SI_OVERLAY_SHOW_GRID_BACKGROUND); @@ -5893,7 +5934,7 @@ static void rna_def_space_text(BlenderRNA *brna) prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "lheight"); - RNA_def_property_range(prop, 8, 32); + RNA_def_property_range(prop, 1, 256); /* Large range since Hi-DPI scales down size. */ RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL); @@ -6387,7 +6428,7 @@ static void rna_def_space_console(BlenderRNA *brna) /* display */ prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */ RNA_def_property_int_sdna(prop, NULL, "lheight"); - RNA_def_property_range(prop, 8, 32); + RNA_def_property_range(prop, 1, 256); /* Large range since Hi-DPI scales down size. */ RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text"); RNA_def_property_update(prop, 0, "rna_SpaceConsole_rect_update"); @@ -6577,7 +6618,7 @@ static void rna_def_fileselect_params(BlenderRNA *brna) static const EnumPropertyItem display_size_items[] = { {64, "TINY", 0, "Tiny", ""}, {96, "SMALL", 0, "Small", ""}, - {128, "NORMAL", 0, "Regular", ""}, + {128, "NORMAL", 0, "Medium", ""}, {192, "LARGE", 0, "Large", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -7798,12 +7839,6 @@ static void rna_def_spreadsheet_row_filter(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Color Value", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SPREADSHEET, NULL); - prop = RNA_def_property(srna, "value_byte_color", PROP_INT, PROP_NONE); - RNA_def_property_array(prop, 4); - RNA_def_property_range(prop, 0, 255); - RNA_def_property_ui_text(prop, "Byte Color Value", ""); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SPREADSHEET, NULL); - prop = RNA_def_property(srna, "value_string", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Text Value", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SPREADSHEET, NULL); |