Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_main_api.c
| Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_font.h" | #include "BKE_font.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_depsgraph.h" | #include "BKE_depsgraph.h" | ||||
| #include "BKE_speaker.h" | #include "BKE_speaker.h" | ||||
| #include "BKE_movieclip.h" | #include "BKE_movieclip.h" | ||||
| #include "BKE_mask.h" | #include "BKE_mask.h" | ||||
| #include "BKE_gpencil.h" | #include "BKE_gpencil.h" | ||||
| #include "BKE_linestyle.h" | #include "BKE_linestyle.h" | ||||
| #include "BKE_workspace.h" | |||||
| #include "DNA_armature_types.h" | #include "DNA_armature_types.h" | ||||
| #include "DNA_camera_types.h" | #include "DNA_camera_types.h" | ||||
| #include "DNA_curve_types.h" | #include "DNA_curve_types.h" | ||||
| #include "DNA_lamp_types.h" | #include "DNA_lamp_types.h" | ||||
| #include "DNA_material_types.h" | #include "DNA_material_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_speaker_types.h" | #include "DNA_speaker_types.h" | ||||
| Show All 15 Lines | |||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| # include "BPY_extern.h" | # include "BPY_extern.h" | ||||
| #endif | #endif | ||||
| #include "WM_api.h" | |||||
| static void rna_idname_validate(const char *name, char *r_name) | static void rna_idname_validate(const char *name, char *r_name) | ||||
| { | { | ||||
| BLI_strncpy(r_name, name, MAX_ID_NAME - 2); | BLI_strncpy(r_name, name, MAX_ID_NAME - 2); | ||||
| BLI_utf8_invalid_strip(r_name, strlen(r_name)); | BLI_utf8_invalid_strip(r_name, strlen(r_name)); | ||||
| } | } | ||||
| Show All 38 Lines | static void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, PointerRNA *scene_ptr, int do_unlink) | ||||
| /* don't call BKE_libblock_free(...) directly */ | /* don't call BKE_libblock_free(...) directly */ | ||||
| Scene *scene = scene_ptr->data; | Scene *scene = scene_ptr->data; | ||||
| Scene *scene_new; | Scene *scene_new; | ||||
| if ((scene_new = scene->id.prev) || | if ((scene_new = scene->id.prev) || | ||||
| (scene_new = scene->id.next)) | (scene_new = scene->id.next)) | ||||
| { | { | ||||
| if (do_unlink) { | if (do_unlink) { | ||||
| bScreen *sc = CTX_wm_screen(C); | wmWindow *win = CTX_wm_window(C); | ||||
| if (sc->scene == scene) { | |||||
| if (WM_window_get_active_scene(win) == scene) { | |||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| BPy_BEGIN_ALLOW_THREADS; | BPy_BEGIN_ALLOW_THREADS; | ||||
| #endif | #endif | ||||
| ED_screen_set_scene(C, sc, scene_new); | WM_window_change_active_scene(bmain, C, win, scene_new); | ||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| BPy_END_ALLOW_THREADS; | BPy_END_ALLOW_THREADS; | ||||
| #endif | #endif | ||||
| } | } | ||||
| } | } | ||||
| rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink); | rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink); | ||||
| ▲ Show 20 Lines • Show All 417 Lines • ▼ Show 20 Lines | |||||
| RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particle, ID_PA) | RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particle, ID_PA) | ||||
| RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL) | RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL) | ||||
| RNA_MAIN_ID_TAG_FUNCS_DEF(gpencil, gpencil, ID_GD) | RNA_MAIN_ID_TAG_FUNCS_DEF(gpencil, gpencil, ID_GD) | ||||
| RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclip, ID_MC) | RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclip, ID_MC) | ||||
| RNA_MAIN_ID_TAG_FUNCS_DEF(masks, mask, ID_MSK) | RNA_MAIN_ID_TAG_FUNCS_DEF(masks, mask, ID_MSK) | ||||
| RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyle, ID_LS) | RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyle, ID_LS) | ||||
| RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF) | RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF) | ||||
| RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC) | RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC) | ||||
| RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces, ID_WS) | |||||
| #undef RNA_MAIN_ID_TAG_FUNCS_DEF | #undef RNA_MAIN_ID_TAG_FUNCS_DEF | ||||
| #else | #else | ||||
| void RNA_api_main(StructRNA *UNUSED(srna)) | void RNA_api_main(StructRNA *UNUSED(srna)) | ||||
| { | { | ||||
| #if 0 | #if 0 | ||||
| ▲ Show 20 Lines • Show All 1,193 Lines • ▼ Show 20 Lines | void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this line style before deleting it"); | RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this line style before deleting it"); | ||||
| prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_Main_linestyle_is_updated_get", NULL); | RNA_def_property_boolean_funcs(prop, "rna_Main_linestyle_is_updated_get", NULL); | ||||
| } | } | ||||
| void RNA_def_main_workspaces(BlenderRNA *brna, PropertyRNA *cprop) | |||||
| { | |||||
| StructRNA *srna; | |||||
| FunctionRNA *func; | |||||
| PropertyRNA *parm; | |||||
| PropertyRNA *prop; | |||||
| RNA_def_property_srna(cprop, "BlendDataWorkSpaces"); | |||||
| srna = RNA_def_struct(brna, "BlendDataWorkSpaces", NULL); | |||||
| RNA_def_struct_sdna(srna, "Main"); | |||||
| RNA_def_struct_ui_text(srna, "Main Workspaces", "Collection of workspaces"); | |||||
| func = RNA_def_function(srna, "tag", "rna_Main_workspaces_tag"); | |||||
| parm = RNA_def_boolean(func, "value", 0, "Value", ""); | |||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | |||||
| prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_boolean_funcs(prop, "rna_Main_workspaces_is_updated_get", NULL); | |||||
| } | |||||
| #endif | #endif | ||||