Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_depsgraph.c
| Show First 20 Lines • Show All 255 Lines • ▼ Show 20 Lines | static void rna_Depsgraph_debug_stats(Depsgraph *depsgraph, char *result) | ||||
| BLI_snprintf(result, | BLI_snprintf(result, | ||||
| STATS_MAX_SIZE, | STATS_MAX_SIZE, | ||||
| "Approx %lu Operations, %lu Relations, %lu Outer Nodes", | "Approx %lu Operations, %lu Relations, %lu Outer Nodes", | ||||
| ops, | ops, | ||||
| rels, | rels, | ||||
| outer); | outer); | ||||
| } | } | ||||
| static void rna_Depsgraph_update(Depsgraph *depsgraph, Main *bmain) | static void rna_Depsgraph_update(Depsgraph *depsgraph, Main *bmain, ReportList *reports) | ||||
| { | { | ||||
| if (DEG_is_evaluating(depsgraph)) { | |||||
| BKE_report(reports, RPT_ERROR, "Dependency graph update requested during evaluation"); | |||||
| return; | |||||
| } | |||||
| # ifdef WITH_PYTHON | # ifdef WITH_PYTHON | ||||
| /* Allow drivers to be evaluated */ | /* Allow drivers to be evaluated */ | ||||
| BPy_BEGIN_ALLOW_THREADS; | BPy_BEGIN_ALLOW_THREADS; | ||||
| # endif | # endif | ||||
| BKE_scene_graph_update_tagged(depsgraph, bmain); | BKE_scene_graph_update_tagged(depsgraph, bmain); | ||||
| # ifdef WITH_PYTHON | # ifdef WITH_PYTHON | ||||
| ▲ Show 20 Lines • Show All 375 Lines • ▼ Show 20 Lines | static void rna_def_depsgraph(BlenderRNA *brna) | ||||
| /* Updates. */ | /* Updates. */ | ||||
| func = RNA_def_function(srna, "update", "rna_Depsgraph_update"); | func = RNA_def_function(srna, "update", "rna_Depsgraph_update"); | ||||
| RNA_def_function_ui_description( | RNA_def_function_ui_description( | ||||
| func, | func, | ||||
| "Re-evaluate any modified data-blocks, for example for animation or modifiers. " | "Re-evaluate any modified data-blocks, for example for animation or modifiers. " | ||||
| "This invalidates all references to evaluated data-blocks from this dependency graph."); | "This invalidates all references to evaluated data-blocks from this dependency graph."); | ||||
| RNA_def_function_flag(func, FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS); | ||||
| /* Queries for original datablockls (the ones depsgraph is built for). */ | /* Queries for original datablockls (the ones depsgraph is built for). */ | ||||
| prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "Scene"); | RNA_def_property_struct_type(prop, "Scene"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_Depsgraph_scene_get", NULL, NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_Depsgraph_scene_get", NULL, NULL, NULL); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Scene", "Original scene dependency graph is built for"); | RNA_def_property_ui_text(prop, "Scene", "Original scene dependency graph is built for"); | ||||
| ▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines | |||||