Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_space.c
| Show First 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | const EnumPropertyItem rna_enum_clip_editor_mode_items[] = { | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| /* Actually populated dynamically trough a function, but helps for context-less access (e.g. doc, i18n...). */ | /* Actually populated dynamically trough a function, but helps for context-less access (e.g. doc, i18n...). */ | ||||
| static const EnumPropertyItem buttons_context_items[] = { | static const EnumPropertyItem buttons_context_items[] = { | ||||
| {BCONTEXT_SCENE, "SCENE", ICON_SCENE_DATA, "Scene", "Scene"}, | {BCONTEXT_SCENE, "SCENE", ICON_SCENE_DATA, "Scene", "Scene"}, | ||||
| {BCONTEXT_RENDER, "RENDER", ICON_SCENE, "Render", "Render"}, | {BCONTEXT_RENDER, "RENDER", ICON_SCENE, "Render", "Render"}, | ||||
| {BCONTEXT_VIEW_LAYER, "VIEW_LAYER", ICON_RENDER_RESULT, "View Layer", "View layer"}, | {BCONTEXT_VIEW_LAYER, "VIEW_LAYER", ICON_RENDER_RESULT, "View Layer", "View layer"}, | ||||
| {BCONTEXT_COLLECTION, "COLLECTION", ICON_COLLAPSEMENU, "Collection", "Collection"}, | |||||
| {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"}, | {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"}, | ||||
| {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"}, | {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"}, | ||||
| {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraints", "Object constraints"}, | {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraints", "Object constraints"}, | ||||
| {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Object modifiers"}, | {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Object modifiers"}, | ||||
| {BCONTEXT_DATA, "DATA", ICON_NONE, "Data", "Object data"}, | {BCONTEXT_DATA, "DATA", ICON_NONE, "Data", "Object data"}, | ||||
| {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"}, | {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"}, | ||||
| {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT_BONE, "Bone Constraints", "Bone constraints"}, | {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT_BONE, "Bone Constraints", "Bone constraints"}, | ||||
| {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"}, | {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"}, | ||||
| {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"}, | {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"}, | ||||
| {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle"}, | {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle"}, | ||||
| {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"}, | {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"}, | ||||
| {BCONTEXT_WORKSPACE, "WORKSPACE", ICON_SPLITSCREEN, "Workspace", "Workspace"}, | {BCONTEXT_WORKSPACE, "WORKSPACE", ICON_SPLITSCREEN, "Workspace", "Workspace"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static const EnumPropertyItem buttons_collection_context_items[] = { | |||||
| {SB_COLLECTION_CTX_VIEW_LAYER, "VIEW_LAYER", ICON_RENDER_RESULT, "", "Show material textures"}, | |||||
| {SB_COLLECTION_CTX_GROUP, "GROUP", ICON_GROUP, "", "Show world textures"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| static const EnumPropertyItem fileselectparams_recursion_level_items[] = { | static const EnumPropertyItem fileselectparams_recursion_level_items[] = { | ||||
| {0, "NONE", 0, "None", "Only list current directory's content, with no recursion"}, | {0, "NONE", 0, "None", "Only list current directory's content, with no recursion"}, | ||||
| {1, "BLEND", 0, "Blend File", "List .blend files' content"}, | {1, "BLEND", 0, "Blend File", "List .blend files' content"}, | ||||
| {2, "ALL_1", 0, "One Level", "List all sub-directories' content, one level of recursion"}, | {2, "ALL_1", 0, "One Level", "List all sub-directories' content, one level of recursion"}, | ||||
| {3, "ALL_2", 0, "Two Levels", "List all sub-directories' content, two levels of recursion"}, | {3, "ALL_2", 0, "Two Levels", "List all sub-directories' content, two levels of recursion"}, | ||||
| {4, "ALL_3", 0, "Three Levels", "List all sub-directories' content, three levels of recursion"}, | {4, "ALL_3", 0, "Three Levels", "List all sub-directories' content, three levels of recursion"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 866 Lines • ▼ Show 20 Lines | static const EnumPropertyItem *rna_SpaceProperties_context_itemf( | ||||
| if (sbuts->pathflag & (1 << BCONTEXT_WORLD)) { | if (sbuts->pathflag & (1 << BCONTEXT_WORLD)) { | ||||
| RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORLD); | RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORLD); | ||||
| } | } | ||||
| if (sbuts->pathflag & (1 << BCONTEXT_WORKSPACE)) { | if (sbuts->pathflag & (1 << BCONTEXT_WORKSPACE)) { | ||||
| RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORKSPACE); | RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORKSPACE); | ||||
| } | } | ||||
| if (sbuts->pathflag & (1 << BCONTEXT_COLLECTION)) { | |||||
| RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_COLLECTION); | |||||
| } | |||||
| if (sbuts->pathflag & (1 << BCONTEXT_OBJECT)) { | if (sbuts->pathflag & (1 << BCONTEXT_OBJECT)) { | ||||
| RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_OBJECT); | RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_OBJECT); | ||||
| } | } | ||||
| if (sbuts->pathflag & (1 << BCONTEXT_CONSTRAINT)) { | if (sbuts->pathflag & (1 << BCONTEXT_CONSTRAINT)) { | ||||
| RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_CONSTRAINT); | RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_CONSTRAINT); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 931 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void rna_def_space_outliner(BlenderRNA *brna) | static void rna_def_space_outliner(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem display_mode_items[] = { | static const EnumPropertyItem display_mode_items[] = { | ||||
| {SO_COLLECTIONS, "COLLECTIONS", 0, "Collections", "Display collections in the view layer"}, | |||||
| {SO_SCENES, "SCENES", 0, "Scenes", "Display scenes and their view layers, collections and objects"}, | {SO_SCENES, "SCENES", 0, "Scenes", "Display scenes and their view layers, collections and objects"}, | ||||
| {SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their data-blocks"}, | {SO_VIEW_LAYER, "VIEW_LAYER", 0, "View Layer", "Display collections and objects in the view layer"}, | ||||
| {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence data-blocks"}, | {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence data-blocks"}, | ||||
| {SO_LIBRARIES, "LIBRARIES", 0, "Blender File", "Display data of current file and linked libraries"}, | {SO_LIBRARIES, "LIBRARIES", 0, "Blender File", "Display data of current file and linked libraries"}, | ||||
| {SO_DATA_API, "DATA_API", 0, "Data API", "Display low level Blender data and its properties"}, | {SO_DATA_API, "DATA_API", 0, "Data API", "Display low level Blender data and its properties"}, | ||||
| {SO_ID_ORPHANS, "ORPHAN_DATA", 0, "Orphan Data", | {SO_ID_ORPHANS, "ORPHAN_DATA", 0, "Orphan Data", | ||||
| "Display data-blocks which are unused and/or will be lost when the file is reloaded"}, | "Display data-blocks which are unused and/or will be lost when the file is reloaded"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static const EnumPropertyItem filter_state_items[] = { | static const EnumPropertyItem filter_state_items[] = { | ||||
| {SO_FILTER_OB_NONE, "NONE", 0, "No Objects", "Don't show objects"}, | {SO_FILTER_OB_ALL, "ALL", 0, "All", "Show all objects in the view layer"}, | ||||
| {SO_FILTER_OB_ALL, "ALL", 0, "All Objects", "Show visible objects"}, | {SO_FILTER_OB_VISIBLE, "VISIBLE", 0, "Visible", "Show visible objects"}, | ||||
| {SO_FILTER_OB_VISIBLE, "VISIBLE", 0, "Visible Objects", "Show visible objects"}, | {SO_FILTER_OB_SELECTED, "SELECTED", 0, "Selected", "Show selected objects"}, | ||||
| {SO_FILTER_OB_SELECTED, "SELECTED", 0, "Selected Objects", "Show selected objects"}, | {SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active", "Show only the active object"}, | ||||
| {SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active Object", "Show only the active object"}, | |||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| srna = RNA_def_struct(brna, "SpaceOutliner", "Space"); | srna = RNA_def_struct(brna, "SpaceOutliner", "Space"); | ||||
| RNA_def_struct_sdna(srna, "SpaceOops"); | RNA_def_struct_sdna(srna, "SpaceOops"); | ||||
| RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data"); | RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data"); | ||||
| prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE); | ||||
| Show All 33 Lines | static void rna_def_space_outliner(BlenderRNA *brna) | ||||
| /* Filters. */ | /* Filters. */ | ||||
| prop = RNA_def_property(srna, "use_filter_search", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_filter_search", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "filter", SO_FILTER_SEARCH); | RNA_def_property_boolean_sdna(prop, NULL, "filter", SO_FILTER_SEARCH); | ||||
| RNA_def_property_ui_text(prop, "Search Name", "Filter searched elements"); | RNA_def_property_ui_text(prop, "Search Name", "Filter searched elements"); | ||||
| RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0); | RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); | ||||
| prop = RNA_def_property(srna, "use_filter_object", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OBJECT); | |||||
| RNA_def_property_ui_text(prop, "Filter Objects", "Show objects"); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); | |||||
| prop = RNA_def_property(srna, "use_filter_object_content", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_filter_object_content", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_CONTENT); | RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_CONTENT); | ||||
| RNA_def_property_ui_text(prop, "Show Object Contents", "Show what is inside the objects elements"); | RNA_def_property_ui_text(prop, "Show Object Contents", "Show what is inside the objects elements"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); | ||||
| prop = RNA_def_property(srna, "use_filter_children", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_filter_children", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_CHILDREN); | RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_CHILDREN); | ||||
| RNA_def_property_ui_text(prop, "Show Object Children", "Show children"); | RNA_def_property_ui_text(prop, "Show Object Children", "Show children"); | ||||
| ▲ Show 20 Lines • Show All 775 Lines • ▼ Show 20 Lines | static void rna_def_space_buttons(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "align"); | RNA_def_property_enum_sdna(prop, NULL, "align"); | ||||
| RNA_def_property_enum_items(prop, align_items); | RNA_def_property_enum_items(prop, align_items); | ||||
| RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL); | RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels"); | RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL); | ||||
| prop = RNA_def_property(srna, "collection_context", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, buttons_collection_context_items); | |||||
| RNA_def_property_ui_text(prop, "Collection Context", "Which collection we want to show"); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL); | |||||
| /* pinned data */ | /* pinned data */ | ||||
| prop = RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "pinid"); | RNA_def_property_pointer_sdna(prop, NULL, "pinid"); | ||||
| RNA_def_property_struct_type(prop, "ID"); | RNA_def_property_struct_type(prop, "ID"); | ||||
| /* note: custom set function is ONLY to avoid rna setting a user for this. */ | /* note: custom set function is ONLY to avoid rna setting a user for this. */ | ||||
| RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set", | RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set", | ||||
| "rna_SpaceProperties_pin_id_typef", NULL); | "rna_SpaceProperties_pin_id_typef", NULL); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); | RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); | ||||
| ▲ Show 20 Lines • Show All 1,763 Lines • Show Last 20 Lines | |||||