Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_space.c
| Show First 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | const EnumPropertyItem rna_enum_clip_editor_mode_items[] = { | ||||
| {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask", "Show mask editing tools"}, | {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask", "Show mask editing tools"}, | ||||
| {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_RENDER_LAYER, "RENDER_LAYER", ICON_RENDERLAYERS, "Render Layers", "Render layers"}, | {BCONTEXT_VIEW_LAYER, "VIEW_LAYER", ICON_RENDERLAYERS, "View Layers", "View layers"}, | ||||
| {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"}, | ||||
| ▲ Show 20 Lines • Show All 339 Lines • ▼ Show 20 Lines | static float rna_View3D_GridScaleUnit_get(PointerRNA *ptr) | ||||
| return ED_view3d_grid_scale(scene, v3d, NULL); | return ED_view3d_grid_scale(scene, v3d, NULL); | ||||
| } | } | ||||
| static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values) | static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values) | ||||
| { | { | ||||
| View3D *v3d = (View3D *)(ptr->data); | View3D *v3d = (View3D *)(ptr->data); | ||||
| v3d->lay = ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact); | v3d->lay = ED_view3d_view_layer_set(v3d->lay, values, &v3d->layact); | ||||
| } | } | ||||
| static int rna_SpaceView3D_active_layer_get(PointerRNA *ptr) | static int rna_SpaceView3D_active_layer_get(PointerRNA *ptr) | ||||
| { | { | ||||
| View3D *v3d = (View3D *)(ptr->data); | View3D *v3d = (View3D *)(ptr->data); | ||||
| return (int)(log(v3d->layact) / M_LN2); | return (int)(log(v3d->layact) / M_LN2); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr) | ||||
| return ED_space_image_show_uvedit(sima, scene->obedit); | return ED_space_image_show_uvedit(sima, scene->obedit); | ||||
| } | } | ||||
| static int rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr) | static int rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr) | ||||
| { | { | ||||
| SpaceImage *sima = (SpaceImage *)(ptr->data); | SpaceImage *sima = (SpaceImage *)(ptr->data); | ||||
| bScreen *sc = (bScreen *)ptr->id.data; | bScreen *sc = (bScreen *)ptr->id.data; | ||||
| Scene *scene = ED_screen_scene_find(sc, G.main->wm.first); | Scene *scene = ED_screen_scene_find(sc, G.main->wm.first); | ||||
| SceneLayer *scene_layer = BKE_scene_layer_context_active_PLACEHOLDER(scene); | ViewLayer *view_layer = BKE_view_layer_context_active_PLACEHOLDER(scene); | ||||
| return ED_space_image_check_show_maskedit(scene_layer, sima); | return ED_space_image_check_show_maskedit(view_layer, sima); | ||||
| } | } | ||||
| static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value) | static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value) | ||||
| { | { | ||||
| SpaceImage *sima = (SpaceImage *)(ptr->data); | SpaceImage *sima = (SpaceImage *)(ptr->data); | ||||
| bScreen *sc = (bScreen *)ptr->id.data; | bScreen *sc = (bScreen *)ptr->id.data; | ||||
| Scene *scene = ED_screen_scene_find(sc, G.main->wm.first); | Scene *scene = ED_screen_scene_find(sc, G.main->wm.first); | ||||
| ▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | static const EnumPropertyItem *rna_SpaceProperties_context_itemf(bContext *UNUSED(C), PointerRNA *ptr, | ||||
| SpaceButs *sbuts = (SpaceButs *)(ptr->data); | SpaceButs *sbuts = (SpaceButs *)(ptr->data); | ||||
| EnumPropertyItem *item = NULL; | EnumPropertyItem *item = NULL; | ||||
| int totitem = 0; | int totitem = 0; | ||||
| if (sbuts->pathflag & (1 << BCONTEXT_RENDER)) { | if (sbuts->pathflag & (1 << BCONTEXT_RENDER)) { | ||||
| RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_RENDER); | RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_RENDER); | ||||
| } | } | ||||
| if (sbuts->pathflag & (1 << BCONTEXT_RENDER_LAYER)) { | if (sbuts->pathflag & (1 << BCONTEXT_VIEW_LAYER)) { | ||||
| RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_RENDER_LAYER); | RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_VIEW_LAYER); | ||||
| } | } | ||||
| if (sbuts->pathflag & (1 << BCONTEXT_SCENE)) { | if (sbuts->pathflag & (1 << BCONTEXT_SCENE)) { | ||||
| RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_SCENE); | RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_SCENE); | ||||
| } | } | ||||
| 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); | ||||
| ▲ Show 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | else { | ||||
| printf("ACK: who's trying to set an action while not in a mode displaying a single Action only?\n"); | printf("ACK: who's trying to set an action while not in a mode displaying a single Action only?\n"); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr) | static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr) | ||||
| { | { | ||||
| SpaceAction *saction = (SpaceAction *)(ptr->data); | SpaceAction *saction = (SpaceAction *)(ptr->data); | ||||
| SceneLayer *scene_layer = CTX_data_scene_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Object *obact = OBACT(scene_layer); | Object *obact = OBACT(view_layer); | ||||
| /* we must set this action to be the one used by active object (if not pinned) */ | /* we must set this action to be the one used by active object (if not pinned) */ | ||||
| if (obact /* && saction->pin == 0*/) { | if (obact /* && saction->pin == 0*/) { | ||||
| AnimData *adt = NULL; | AnimData *adt = NULL; | ||||
| if (saction->mode == SACTCONT_ACTION) { | if (saction->mode == SACTCONT_ACTION) { | ||||
| /* TODO: context selector could help decide this with more control? */ | /* TODO: context selector could help decide this with more control? */ | ||||
| adt = BKE_animdata_add_id(&obact->id); /* this only adds if non-existent */ | adt = BKE_animdata_add_id(&obact->id); /* this only adds if non-existent */ | ||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | if (obact /* && saction->pin == 0*/) { | ||||
| /* Update relations as well, so new time source dependency is added. */ | /* Update relations as well, so new time source dependency is added. */ | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| } | } | ||||
| } | } | ||||
| static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr) | static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr) | ||||
| { | { | ||||
| SpaceAction *saction = (SpaceAction *)(ptr->data); | SpaceAction *saction = (SpaceAction *)(ptr->data); | ||||
| SceneLayer *scene_layer = CTX_data_scene_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Object *obact = OBACT(scene_layer); | Object *obact = OBACT(view_layer); | ||||
| /* special exceptions for ShapeKey Editor mode */ | /* special exceptions for ShapeKey Editor mode */ | ||||
| if (saction->mode == SACTCONT_SHAPEKEY) { | if (saction->mode == SACTCONT_SHAPEKEY) { | ||||
| Key *key = BKE_key_from_object(obact); | Key *key = BKE_key_from_object(obact); | ||||
| /* 1) update the action stored for the editor */ | /* 1) update the action stored for the editor */ | ||||
| if (key) | if (key) | ||||
| saction->action = (key->adt) ? key->adt->action : NULL; | saction->action = (key->adt) ? key->adt->action : NULL; | ||||
| ▲ Show 20 Lines • Show All 692 Lines • ▼ Show 20 Lines | static const EnumPropertyItem display_mode_items[] = { | ||||
| "Display data-blocks of all objects of same type as selected object"}, | "Display data-blocks of all objects of same type as selected object"}, | ||||
| {SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their data-blocks"}, | {SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their data-blocks"}, | ||||
| {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_DATABLOCKS, "DATABLOCKS", 0, "Data-Blocks", "Display all raw data-blocks"}, | {SO_DATABLOCKS, "DATABLOCKS", 0, "Data-Blocks", "Display all raw data-blocks"}, | ||||
| {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display user preference data"}, | {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display user preference data"}, | ||||
| {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"}, | ||||
| {SO_ACT_LAYER, "ACT_LAYER", 0, "Active Render Layer", "Display the collections of the active render layer"}, | {SO_ACT_LAYER, "ACT_LAYER", 0, "Active View Layer", "Display the collections of the active view layer"}, | ||||
| {SO_COLLECTIONS, "MASTER_COLLECTION", 0, "Master Collection Tree", "Display all collections based on the " | {SO_COLLECTIONS, "MASTER_COLLECTION", 0, "Master Collection Tree", "Display all collections based on the " | ||||
| "master collection hierarchy"}, | "master collection hierarchy"}, | ||||
| {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"); | ||||
| ▲ Show 20 Lines • Show All 2,496 Lines • Show Last 20 Lines | |||||