Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_workspace.c
| Show All 22 Lines | |||||
| */ | */ | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "RNA_types.h" | #include "RNA_types.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "ED_render.h" | |||||
| #include "RE_engine.h" | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "rna_internal.h" | #include "rna_internal.h" | ||||
| /* Allow accessing private members of DNA_workspace_types.h */ | |||||
| #define DNA_PRIVATE_WORKSPACE_ALLOW | |||||
| #include "DNA_workspace_types.h" | |||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_workspace_types.h" | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| void rna_workspace_screens_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | void rna_workspace_screens_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | ||||
| { | { | ||||
| WorkSpace *workspace = ptr->id.data; | WorkSpace *workspace = ptr->id.data; | ||||
| rna_iterator_listbase_begin(iter, BKE_workspace_layouts_get(workspace), NULL); | rna_iterator_listbase_begin(iter, BKE_workspace_layouts_get(workspace), NULL); | ||||
| ▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | static void rna_workspace_render_layer_set(PointerRNA *ptr, PointerRNA value) | ||||
| BKE_workspace_render_layer_set(workspace, value.data); | BKE_workspace_render_layer_set(workspace, value.data); | ||||
| } | } | ||||
| #else /* RNA_RUNTIME */ | #else /* RNA_RUNTIME */ | ||||
| static void rna_def_workspace(BlenderRNA *brna) | static void rna_def_workspace(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
campbellbarton: Could `BLI_assert` if this isn't found. | |||||
| srna = RNA_def_struct(brna, "WorkSpace", "ID"); | srna = RNA_def_struct(brna, "WorkSpace", "ID"); | ||||
| RNA_def_struct_sdna(srna, "WorkSpace"); | RNA_def_struct_sdna(srna, "WorkSpace"); | ||||
| RNA_def_struct_ui_text(srna, "Workspace", "Workspace data-block, defining the working environment for the user"); | RNA_def_struct_ui_text(srna, "Workspace", "Workspace data-block, defining the working environment for the user"); | ||||
| /* TODO: real icon, just to show something */ | /* TODO: real icon, just to show something */ | ||||
| RNA_def_struct_ui_icon(srna, ICON_RENDER_RESULT); | RNA_def_struct_ui_icon(srna, ICON_RENDER_RESULT); | ||||
| prop = RNA_def_property(srna, "screens", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "screens", PROP_COLLECTION, PROP_NONE); | ||||
| Show All 19 Lines | #endif | ||||
| prop = RNA_def_property(srna, "render_layer", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "render_layer", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "SceneLayer"); | RNA_def_property_struct_type(prop, "SceneLayer"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_workspace_render_layer_get", "rna_workspace_render_layer_set", | RNA_def_property_pointer_funcs(prop, "rna_workspace_render_layer_get", "rna_workspace_render_layer_set", | ||||
| NULL, NULL); | NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Active Render Layer", "The active render layer used in this workspace"); | RNA_def_property_ui_text(prop, "Active Render Layer", "The active render layer used in this workspace"); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL); | RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL); | ||||
| RNA_def_property_update(prop, NC_SCREEN | ND_LAYER, NULL); | RNA_def_property_update(prop, NC_SCREEN | ND_LAYER, NULL); | ||||
| /* View Render */ | |||||
| prop = RNA_def_property(srna, "view_render", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_flag(prop, PROP_NEVER_NULL); | |||||
| RNA_def_property_struct_type(prop, "ViewRenderSettings"); | |||||
| RNA_def_property_ui_text(prop, "View Render", ""); | |||||
| /* Flags */ | |||||
| prop = RNA_def_property(srna, "use_scene_settings", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flags", WORKSPACE_USE_SCENE_SETTINGS); | |||||
| RNA_def_property_ui_text(prop, "Scene Settings", | |||||
| "Use scene settings instead of workspace settings"); | |||||
| RNA_def_property_update(prop, NC_SCREEN | ND_LAYER, NULL); | |||||
| } | } | ||||
| static void rna_def_transform_orientation(BlenderRNA *brna) | static void rna_def_transform_orientation(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "TransformOrientation", NULL); | srna = RNA_def_struct(brna, "TransformOrientation", NULL); | ||||
| Show All 19 Lines | |||||
Could BLI_assert if this isn't found.