Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_depsgraph.c
| Show All 35 Lines | |||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| # include "BLI_iterator.h" | # include "BLI_iterator.h" | ||||
| # include "BLI_math.h" | # include "BLI_math.h" | ||||
| # include "BKE_anim.h" | # include "BKE_anim.h" | ||||
| # include "BKE_object.h" | # include "BKE_object.h" | ||||
| # include "BKE_scene.h" | |||||
| # include "DEG_depsgraph_build.h" | # include "DEG_depsgraph_build.h" | ||||
| # include "DEG_depsgraph_debug.h" | # include "DEG_depsgraph_debug.h" | ||||
| # include "DEG_depsgraph_query.h" | # include "DEG_depsgraph_query.h" | ||||
| # include "MEM_guardedalloc.h" | # include "MEM_guardedalloc.h" | ||||
| /* **************** Object Instance **************** */ | /* **************** Object Instance **************** */ | ||||
| ▲ Show 20 Lines • Show All 199 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) | |||||
| { | |||||
| BKE_scene_graph_update_tagged(depsgraph, bmain); | |||||
| } | |||||
| /* Iteration over objects, simple version */ | /* Iteration over objects, simple version */ | ||||
| static void rna_Depsgraph_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | static void rna_Depsgraph_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | ||||
| { | { | ||||
| iter->internal.custom = MEM_callocN(sizeof(BLI_Iterator), __func__); | iter->internal.custom = MEM_callocN(sizeof(BLI_Iterator), __func__); | ||||
| DEGObjectIterData *data = MEM_callocN(sizeof(DEGObjectIterData), __func__); | DEGObjectIterData *data = MEM_callocN(sizeof(DEGObjectIterData), __func__); | ||||
| data->graph = (Depsgraph *)ptr->data; | data->graph = (Depsgraph *)ptr->data; | ||||
| ▲ Show 20 Lines • Show All 364 Lines • ▼ Show 20 Lines | static void rna_def_depsgraph(BlenderRNA *brna) | ||||
| func = RNA_def_function(srna, "debug_stats", "rna_Depsgraph_debug_stats"); | func = RNA_def_function(srna, "debug_stats", "rna_Depsgraph_debug_stats"); | ||||
| RNA_def_function_ui_description(func, "Report the number of elements in the Dependency Graph"); | RNA_def_function_ui_description(func, "Report the number of elements in the Dependency Graph"); | ||||
| /* weak!, no way to return dynamic string type */ | /* weak!, no way to return dynamic string type */ | ||||
| parm = RNA_def_string(func, "result", NULL, STATS_MAX_SIZE, "result", ""); | parm = RNA_def_string(func, "result", NULL, STATS_MAX_SIZE, "result", ""); | ||||
| RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); /* needed for string return value */ | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); /* needed for string return value */ | ||||
| RNA_def_function_output(func, parm); | RNA_def_function_output(func, parm); | ||||
| /* Updates. */ | |||||
| func = RNA_def_function(srna, "update", "rna_Depsgraph_update"); | |||||
| RNA_def_function_ui_description( | |||||
| func, | |||||
brecht: Suggested description:
```
Re-evaluate any modified data-blocks, for example for animation or… | |||||
| "Re-evaluate any modified data-blocks, for example for animation or modifiers. " | |||||
| "This invalidates all references to evaluated data-blocks from this dependency graph."); | |||||
| RNA_def_function_flag(func, FUNC_USE_MAIN); | |||||
| /* 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 106 Lines • Show Last 20 Lines | |||||
Suggested description:
Relations being up to date seems more like an implementation detail that API users do not need to be aware of.