Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_space.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 1,006 Lines • ▼ Show 20 Lines | if (shading->type == OB_MATERIAL || | ||||
| * active sculpt session needs to be recalculated. */ | * active sculpt session needs to be recalculated. */ | ||||
| for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { | for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { | ||||
| if (ob->sculpt) { | if (ob->sculpt) { | ||||
| DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Update Gpencil. */ | |||||
| rna_GPencil_update(bmain, scene, ptr); | |||||
| bScreen *screen = (bScreen *)ptr->owner_id; | bScreen *screen = (bScreen *)ptr->owner_id; | ||||
| for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { | for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { | ||||
| for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { | for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { | ||||
| if (sl->spacetype == SPACE_VIEW3D) { | if (sl->spacetype == SPACE_VIEW3D) { | ||||
| View3D *v3d = (View3D *)sl; | View3D *v3d = (View3D *)sl; | ||||
| if (&v3d->shading == shading) { | if (&v3d->shading == shading) { | ||||
| ED_view3d_shade_update(bmain, v3d, sa); | ED_view3d_shade_update(bmain, v3d, sa); | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 2,223 Lines • ▼ Show 20 Lines | static void rna_def_space_view3d_shading(BlenderRNA *brna) | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "color_type"); | RNA_def_property_enum_sdna(prop, NULL, "color_type"); | ||||
| RNA_def_property_enum_items(prop, rna_enum_shading_color_type_items); | RNA_def_property_enum_items(prop, rna_enum_shading_color_type_items); | ||||
| RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_View3DShading_color_type_itemf"); | RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_View3DShading_color_type_itemf"); | ||||
| RNA_def_property_ui_text(prop, "Color", "Color Type"); | RNA_def_property_ui_text(prop, "Color", "Color Type"); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| 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, "wireframe_color_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "wireframe_color_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "wire_color_type"); | RNA_def_property_enum_sdna(prop, NULL, "wire_color_type"); | ||||
| RNA_def_property_enum_items(prop, rna_enum_shading_color_type_items); | RNA_def_property_enum_items(prop, rna_enum_shading_color_type_items); | ||||
| RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_View3DShading_color_type_itemf"); | RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_View3DShading_color_type_itemf"); | ||||
| RNA_def_property_ui_text(prop, "Color", "Color Type"); | RNA_def_property_ui_text(prop, "Color", "Color Type"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| ▲ Show 20 Lines • Show All 469 Lines • ▼ Show 20 Lines | static void rna_def_space_view3d_overlay(BlenderRNA *brna) | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| /* grease pencil paper settings */ | /* grease pencil paper settings */ | ||||
| prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_ANNOTATION); | RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_ANNOTATION); | ||||
| RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view"); | RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| prop = RNA_def_property(srna, "use_gpencil_paper", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_gpencil_fade_objects", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_PAPER); | RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_FADE_OBJECTS); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, | prop, | ||||
| "Fade Objects", | "Fade Objects", | ||||
| "Fade all viewport objects with a full color layer to improve visibility"); | "Fade all viewport objects with a full color layer to improve visibility"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| prop = RNA_def_property(srna, "use_gpencil_grid", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_gpencil_grid", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_GRID); | RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_GRID); | ||||
| RNA_def_property_ui_text(prop, "Use Grid", "Display a grid over grease pencil paper"); | RNA_def_property_ui_text(prop, "Use Grid", "Display a grid over grease pencil paper"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| prop = RNA_def_property(srna, "use_gpencil_fade_layers", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_gpencil_fade_layers", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_FADE_NOACTIVE_LAYERS); | RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_FADE_NOACTIVE_LAYERS); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Fade Layers", "Toggle fading of Grease Pencil layers except the active one"); | prop, "Fade Layers", "Toggle fading of Grease Pencil layers except the active one"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | ||||
| prop = RNA_def_property(srna, "use_gpencil_fade_objects", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_gpencil_fade_gp_objects", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_FADE_NOACTIVE_GPENCIL); | RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_FADE_NOACTIVE_GPENCIL); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Fade Grease Pencil Objects", "Fade Grease Pencil Objects, except the active one"); | prop, "Fade Grease Pencil Objects", "Fade Grease Pencil Objects, except the active one"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | ||||
| prop = RNA_def_property(srna, "use_gpencil_show_directions", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_STROKE_DIRECTION); | |||||
| RNA_def_property_ui_text(prop, | |||||
| "Stroke Direction", | |||||
| "Show stroke drawing direction with a bigger green dot (start) " | |||||
| "and smaller red dot (end) points"); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "use_gpencil_show_material_name", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_MATERIAL_NAME); | |||||
| RNA_def_property_ui_text( | |||||
| prop, "Stroke Material Name", "Show material name assigned to each stroke"); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "gpencil_grid_opacity", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "gpencil_grid_opacity", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "overlay.gpencil_grid_opacity"); | RNA_def_property_float_sdna(prop, NULL, "overlay.gpencil_grid_opacity"); | ||||
| RNA_def_property_range(prop, 0.1f, 1.0f); | RNA_def_property_range(prop, 0.1f, 1.0f); | ||||
| RNA_def_property_ui_text(prop, "Opacity", "Canvas grid opacity"); | RNA_def_property_ui_text(prop, "Opacity", "Canvas grid opacity"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| /* Paper opacity factor */ | /* Paper opacity factor */ | ||||
| prop = RNA_def_property(srna, "gpencil_paper_opacity", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "gpencil_fade_objects", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "overlay.gpencil_paper_opacity"); | RNA_def_property_float_sdna(prop, NULL, "overlay.gpencil_paper_opacity"); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_ui_text(prop, "Opacity", "Fade factor"); | RNA_def_property_ui_text(prop, "Opacity", "Fade factor"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| /* Paper opacity factor */ | /* Paper opacity factor */ | ||||
| prop = RNA_def_property(srna, "gpencil_fade_layer", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "gpencil_fade_layer", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "overlay.gpencil_fade_layer"); | RNA_def_property_float_sdna(prop, NULL, "overlay.gpencil_fade_layer"); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_float_default(prop, 0.5f); | RNA_def_property_float_default(prop, 0.5f); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Opacity", "Fade layer opacity for Grease Pencil layers except the active one"); | prop, "Opacity", "Fade layer opacity for Grease Pencil layers except the active one"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | ||||
| /* show edit lines */ | /* show edit lines */ | ||||
| prop = RNA_def_property(srna, "use_gpencil_edit_lines", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_gpencil_edit_lines", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_EDIT_LINES); | RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_EDIT_LINES); | ||||
| RNA_def_property_ui_text(prop, "Show Edit Lines", "Show edit lines when editing strokes"); | RNA_def_property_ui_text(prop, "Show Edit Lines", "Show Edit Lines when editing strokes"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | ||||
| prop = RNA_def_property(srna, "use_gpencil_multiedit_line_only", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_gpencil_multiedit_line_only", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_MULTIEDIT_LINES); | RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_MULTIEDIT_LINES); | ||||
| RNA_def_property_ui_text(prop, "Lines Only", "Only show edit lines for additional frames"); | RNA_def_property_ui_text(prop, "Lines Only", "Show Edit Lines only in multiframe"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | ||||
| /* main grease pencil onion switch */ | /* main grease pencil onion switch */ | ||||
| prop = RNA_def_property(srna, "use_gpencil_onion_skin", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_gpencil_onion_skin", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_ONION_SKIN); | RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_ONION_SKIN); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Onion Skins", "Show ghosts of the keyframes before and after the current frame"); | prop, "Onion Skins", "Show ghosts of the keyframes before and after the current frame"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); | ||||
| /* vertex opacity */ | /* vertex opacity */ | ||||
| prop = RNA_def_property(srna, "vertex_opacity", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "vertex_opacity", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_sdna(prop, NULL, "vertex_opacity"); | RNA_def_property_float_sdna(prop, NULL, "vertex_opacity"); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_ui_text(prop, "Vertex Opacity", "Opacity for edit vertices"); | RNA_def_property_ui_text(prop, "Vertex Opacity", "Opacity for edit vertices"); | ||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_GPencil_update"); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_GPencil_update"); | ||||
| /* Vertex Paint opacity factor */ | |||||
| prop = RNA_def_property(srna, "gpencil_vertex_paint_opacity", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_sdna(prop, NULL, "overlay.gpencil_vertex_paint_opacity"); | |||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | |||||
| RNA_def_property_float_default(prop, 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"); | |||||
| } | } | ||||
| static void rna_def_space_view3d(BlenderRNA *brna) | static void rna_def_space_view3d(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem rv3d_persp_items[] = { | static const EnumPropertyItem rv3d_persp_items[] = { | ||||
| ▲ Show 20 Lines • Show All 2,619 Lines • Show Last 20 Lines | |||||