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 452 Lines • ▼ Show 20 Lines | |||||
| # include "BLI_path_util.h" | # include "BLI_path_util.h" | ||||
| # include "BLI_string.h" | # include "BLI_string.h" | ||||
| # include "BKE_animsys.h" | # include "BKE_animsys.h" | ||||
| # include "BKE_brush.h" | # include "BKE_brush.h" | ||||
| # include "BKE_colortools.h" | # include "BKE_colortools.h" | ||||
| # include "BKE_context.h" | # include "BKE_context.h" | ||||
| # include "BKE_idprop.h" | |||||
| # include "BKE_layer.h" | # include "BKE_layer.h" | ||||
| # include "BKE_global.h" | # include "BKE_global.h" | ||||
| # include "BKE_nla.h" | # include "BKE_nla.h" | ||||
| # include "BKE_paint.h" | # include "BKE_paint.h" | ||||
| # include "BKE_scene.h" | # include "BKE_scene.h" | ||||
| # include "BKE_screen.h" | # include "BKE_screen.h" | ||||
| # include "BKE_icons.h" | # include "BKE_icons.h" | ||||
| # include "BKE_workspace.h" | # include "BKE_workspace.h" | ||||
| ▲ Show 20 Lines • Show All 464 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static bool rna_RegionView3D_is_orthographic_side_view_get(PointerRNA *ptr) | static bool rna_RegionView3D_is_orthographic_side_view_get(PointerRNA *ptr) | ||||
| { | { | ||||
| RegionView3D *rv3d = (RegionView3D *)(ptr->data); | RegionView3D *rv3d = (RegionView3D *)(ptr->data); | ||||
| return RV3D_VIEW_IS_AXIS(rv3d->view); | return RV3D_VIEW_IS_AXIS(rv3d->view); | ||||
| } | } | ||||
| static IDProperty *rna_View3DShading_idprops(PointerRNA *ptr, bool create) | |||||
| { | |||||
| View3DShading *shading = ptr->data; | |||||
| if (create && !shading->prop) { | |||||
| IDPropertyTemplate val = {0}; | |||||
| shading->prop = IDP_New(IDP_GROUP, &val, "View3DShading ID properties"); | |||||
| } | |||||
| return shading->prop; | |||||
| } | |||||
| static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA *ptr) | static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| { | { | ||||
| ID *id = ptr->owner_id; | ID *id = ptr->owner_id; | ||||
| if (GS(id->name) == ID_SCE) { | if (GS(id->name) == ID_SCE) { | ||||
| return; | return; | ||||
| } | } | ||||
| View3DShading *shading = ptr->data; | View3DShading *shading = ptr->data; | ||||
| ▲ Show 20 Lines • Show All 2,049 Lines • ▼ Show 20 Lines | static void rna_def_space_view3d_shading(BlenderRNA *brna) | ||||
| }; | }; | ||||
| /* Note these settings are used for both 3D viewport and the OpenGL render | /* Note these settings are used for both 3D viewport and the OpenGL render | ||||
| * engine in the scene, so can't assume to always be part of a screen. */ | * engine in the scene, so can't assume to always be part of a screen. */ | ||||
| srna = RNA_def_struct(brna, "View3DShading", NULL); | srna = RNA_def_struct(brna, "View3DShading", NULL); | ||||
| RNA_def_struct_path_func(srna, "rna_View3DShading_path"); | RNA_def_struct_path_func(srna, "rna_View3DShading_path"); | ||||
| RNA_def_struct_ui_text( | RNA_def_struct_ui_text( | ||||
| srna, "3D View Shading Settings", "Settings for shading in the 3D viewport"); | srna, "3D View Shading Settings", "Settings for shading in the 3D viewport"); | ||||
| RNA_def_struct_idprops_func(srna, "rna_View3DShading_idprops"); | |||||
| prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_items(prop, rna_enum_shading_type_items); | RNA_def_property_enum_items(prop, rna_enum_shading_type_items); | ||||
| RNA_def_property_enum_funcs(prop, | RNA_def_property_enum_funcs(prop, | ||||
| "rna_3DViewShading_type_get", | "rna_3DViewShading_type_get", | ||||
| "rna_3DViewShading_type_set", | "rna_3DViewShading_type_set", | ||||
| "rna_3DViewShading_type_itemf"); | "rna_3DViewShading_type_itemf"); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| ▲ Show 20 Lines • Show All 3,297 Lines • Show Last 20 Lines | |||||