22#define STATS_MAX_SIZE 16384
51struct RNA_DepsgraphIterator {
64 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
65 return &di->py_instance;
72 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
74 return deg_iter->dupli_object_current;
79 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
83static bool rna_DepsgraphObjectInstance_is_instance_get(
PointerRNA *
ptr)
85 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
87 return (deg_iter->dupli_object_current !=
nullptr);
92 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
94 Object *instance_object =
nullptr;
95 if (deg_iter->dupli_object_current !=
nullptr) {
96 instance_object = deg_iter->dupli_object_current->ob;
101static bool rna_DepsgraphObjectInstance_show_self_get(
PointerRNA *
ptr)
103 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
106 deg_iter->eval_mode);
110static bool rna_DepsgraphObjectInstance_show_particles_get(
PointerRNA *
ptr)
112 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
115 deg_iter->eval_mode);
121 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
123 Object *dupli_parent =
nullptr;
124 if (deg_iter->dupli_object_current !=
nullptr) {
125 dupli_parent = deg_iter->dupli_parent;
132 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
135 if (deg_iter->dupli_object_current !=
nullptr) {
136 particle_system = deg_iter->dupli_object_current->particle_system;
141static void rna_DepsgraphObjectInstance_persistent_id_get(
PointerRNA *
ptr,
int *persistent_id)
143 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
145 if (deg_iter->dupli_object_current !=
nullptr) {
146 memcpy(persistent_id,
147 deg_iter->dupli_object_current->persistent_id,
148 sizeof(deg_iter->dupli_object_current->persistent_id));
151 memset(persistent_id, 0,
sizeof(deg_iter->dupli_object_current->persistent_id));
155static int rna_DepsgraphObjectInstance_random_id_get(
PointerRNA *
ptr)
157 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
159 if (deg_iter->dupli_object_current !=
nullptr) {
160 return int(deg_iter->dupli_object_current->random_id);
165static void rna_DepsgraphObjectInstance_matrix_world_get(
PointerRNA *
ptr,
float *mat)
167 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
169 if (deg_iter->dupli_object_current !=
nullptr) {
170 copy_m4_m4((
float (*)[4])mat, deg_iter->dupli_object_current->mat);
176 copy_m4_m4((
float (*)[4])mat, ob->object_to_world().ptr());
180static void rna_DepsgraphObjectInstance_orco_get(
PointerRNA *
ptr,
float *orco)
182 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
184 if (deg_iter->dupli_object_current !=
nullptr) {
185 copy_v3_v3(orco, deg_iter->dupli_object_current->orco);
192static void rna_DepsgraphObjectInstance_uv_get(
PointerRNA *
ptr,
float *uv)
194 RNA_DepsgraphIterator *di =
static_cast<RNA_DepsgraphIterator *
>(
ptr->data);
196 if (deg_iter->dupli_object_current !=
nullptr) {
197 copy_v2_v2(uv, deg_iter->dupli_object_current->uv);
208 Depsgraph *
depsgraph =
static_cast<Depsgraph *
>(
ptr->data);
219static bool rna_DepsgraphUpdate_is_updated_transform_get(
PointerRNA *
ptr)
221 ID *
id =
static_cast<ID *
>(
ptr->data);
225static bool rna_DepsgraphUpdate_is_updated_shading_get(
PointerRNA *
ptr)
229 ID *
id =
static_cast<ID *
>(
ptr->data);
233static bool rna_DepsgraphUpdate_is_updated_geometry_get(
PointerRNA *
ptr)
235 ID *
id =
static_cast<ID *
>(
ptr->data);
243 ID *
data =
static_cast<ID *
>(
object->data);
244 if (
data ==
nullptr) {
252static void rna_Depsgraph_debug_relations_graphviz(Depsgraph *
depsgraph,
253 const char *filepath,
258 *r_len = dot_str.size();
262 FILE *f = fopen(filepath,
"w");
266 fprintf(f,
"%s", dot_str.c_str());
271static void rna_Depsgraph_debug_stats_gnuplot(Depsgraph *
depsgraph,
272 const char *filepath,
273 const char *output_filepath)
275 FILE *f = fopen(filepath,
"w");
283static void rna_Depsgraph_debug_tag_update(Depsgraph *
depsgraph)
288static void rna_Depsgraph_debug_stats(Depsgraph *
depsgraph,
char *
result)
290 size_t outer, ops, rels;
294 "Approx %zu Operations, %zu Relations, %zu Outer Nodes",
330 data->settings = deg_iter_settings;
331 data->graph = deg_iter_settings->depsgraph;
332 data->flag = deg_iter_settings->flags;
336 iter->valid = ((
BLI_Iterator *)iter->internal.custom)->valid;
369struct RNA_Depsgraph_Instances_Iterator {
370 RNA_DepsgraphIterator iterators[2];
371 DEGObjectIterData deg_data[2];
372 DupliObject dupli_object_current[2];
378 RNA_Depsgraph_Instances_Iterator *di_it = MEM_new<RNA_Depsgraph_Instances_Iterator>(__func__);
387 data->settings = deg_iter_settings;
388 data->graph = deg_iter_settings->depsgraph;
389 data->flag = deg_iter_settings->flags;
391 di_it->iterators[0].iter.valid =
true;
393 iter->
valid = di_it->iterators[0].iter.valid;
398 RNA_Depsgraph_Instances_Iterator *di_it = (RNA_Depsgraph_Instances_Iterator *)
402 di_it->iterators[(di_it->counter + 1) % 2].iter = di_it->iterators[di_it->counter % 2].iter;
403 di_it->deg_data[(di_it->counter + 1) % 2].transfer_from(di_it->deg_data[di_it->counter % 2]);
406 di_it->iterators[di_it->counter % 2].iter.data = &di_it->deg_data[di_it->counter % 2];
413 if (di_it->deg_data[di_it->counter % 2].dupli_object_current !=
nullptr) {
414 di_it->dupli_object_current[di_it->counter % 2] =
415 *di_it->deg_data[di_it->counter % 2].dupli_object_current;
416 di_it->deg_data[di_it->counter % 2].dupli_object_current =
417 &di_it->dupli_object_current[di_it->counter % 2];
419 iter->
valid = di_it->iterators[di_it->counter % 2].iter.valid;
424 RNA_Depsgraph_Instances_Iterator *di_it = (RNA_Depsgraph_Instances_Iterator *)
427 RNA_DepsgraphIterator *di = &di_it->iterators[
i];
436 if (di->py_instance) {
447 RNA_Depsgraph_Instances_Iterator *di_it = (RNA_Depsgraph_Instances_Iterator *)
449 RNA_DepsgraphIterator *di = &di_it->iterators[di_it->counter % 2];
460 data->graph = (Depsgraph *)
ptr->data;
491 data->graph = (Depsgraph *)
ptr->data;
492 data->only_updated =
true;
505static ID *rna_Depsgraph_id_eval_get(Depsgraph *
depsgraph,
ID *id_orig)
510static bool rna_Depsgraph_id_type_updated(Depsgraph *
depsgraph,
int id_type)
546 scene_eval->
id, &RNA_ViewLayer, view_layer_eval);
559 "Dependency Graph Object Instance",
560 "Extended information about dependency graph object iterator "
561 "(Warning: All data here is 'evaluated' one, not original .blend IDs)");
572 prop,
"rna_DepsgraphObjectInstance_object_get",
nullptr,
nullptr,
nullptr);
577 prop,
"Show Self",
"The object geometry itself should be visible in the render");
583 prop,
"Show Particles",
"Particles part of the object should be visible in the render");
589 prop,
"Is Instance",
"Denotes if the object is generated by another object");
595 prop,
"Instance Object",
"Evaluated object which is being instanced by this iterator");
598 prop,
"rna_DepsgraphObjectInstance_instance_object_get",
nullptr,
nullptr,
nullptr);
603 prop,
"Parent",
"If the object is an instance, the parent object that generated it");
606 prop,
"rna_DepsgraphObjectInstance_parent_get",
nullptr,
nullptr,
nullptr);
612 prop,
"Particle System",
"Evaluated particle system that this object was instanced from");
614 prop,
"rna_DepsgraphObjectInstance_particle_system_get",
nullptr,
nullptr,
nullptr);
620 "Persistent identifier for inter-frame matching of objects with motion blur");
624 prop,
"rna_DepsgraphObjectInstance_persistent_id_get",
nullptr,
nullptr);
629 prop,
"Instance Random ID",
"Random id for this instance, typically for randomized shading");
637 prop,
"rna_DepsgraphObjectInstance_matrix_world_get",
nullptr,
nullptr);
643 prop,
"Generated Coordinates",
"Generated coordinates in parent object space");
696 {0,
nullptr, 0,
nullptr,
nullptr},
702 prop =
RNA_def_enum(srna,
"mode", enum_depsgraph_mode_items, 0,
"Mode",
"Evaluation mode");
709 srna,
"debug_relations_graphviz",
"rna_Depsgraph_debug_relations_graphviz");
715 "Optional output path for the graphviz debug file");
721 func =
RNA_def_function(srna,
"debug_stats_gnuplot",
"rna_Depsgraph_debug_stats_gnuplot");
723 func,
"filepath",
nullptr,
FILE_MAX,
"File Name",
"Output path for the gnuplot debug file");
730 "File name where gnuplot script will save the result");
733 func =
RNA_def_function(srna,
"debug_tag_update",
"rna_Depsgraph_debug_tag_update");
748 "Re-evaluate any modified data-blocks, for example for animation or modifiers. "
749 "This invalidates all references to evaluated data-blocks from this dependency graph.");
765 prop,
"View Layer",
"Original view layer dependency graph is built for");
771 func,
"id",
"ID",
"",
"Original ID to get evaluated complementary part for");
773 parm =
RNA_def_pointer(func,
"id_eval",
"ID",
"",
"Evaluated ID for the given original one");
776 func =
RNA_def_function(srna,
"id_type_updated",
"rna_Depsgraph_id_type_updated");
783 "True if any data-block with this type was added, updated or removed");
795 prop,
"rna_Depsgraph_view_layer_eval_get",
nullptr,
nullptr,
nullptr);
805 "rna_Depsgraph_ids_begin",
806 "rna_Depsgraph_ids_next",
807 "rna_Depsgraph_ids_end",
808 "rna_Depsgraph_ids_get",
819 "rna_Depsgraph_objects_begin",
820 "rna_Depsgraph_objects_next",
821 "rna_Depsgraph_objects_end",
822 "rna_Depsgraph_objects_get",
833 "rna_Depsgraph_object_instances_begin",
834 "rna_Depsgraph_object_instances_next",
835 "rna_Depsgraph_object_instances_end",
836 "rna_Depsgraph_object_instances_get",
843 "All object instances to display or render "
844 "(Warning: Only use this as an iterator, never as a sequence, "
845 "and do not keep any references to its items)");
851 "rna_Depsgraph_updates_begin",
852 "rna_Depsgraph_ids_next",
853 "rna_Depsgraph_ids_end",
854 "rna_Depsgraph_updates_get",
constexpr int MAX_DUPLI_RECUR
General operations, lookup, etc. for blender objects.
int BKE_object_visibility(const Object *ob, int dag_eval_mode)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain)
void copy_m4_m4(float m1[4][4], const float m2[4][4])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void zero_v2(float r[2])
MINLINE void zero_v3(float r[3])
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
#define BPy_BEGIN_ALLOW_THREADS
void BPY_DECREF_RNA_INVALIDATE(void *pyob_ptr)
#define BPy_END_ALLOW_THREADS
bool DEG_is_evaluating(const Depsgraph *depsgraph)
void DEG_graph_tag_relations_update(Depsgraph *graph)
std::string DEG_debug_graph_to_dot(const Depsgraph &graph, blender::StringRef label)
void DEG_stats_simple(const Depsgraph *graph, size_t *r_outer, size_t *r_operations, size_t *r_relations)
void DEG_debug_stats_gnuplot(const Depsgraph *graph, FILE *fp, const char *label, const char *output_filename)
void DEG_iterator_ids_begin(BLI_Iterator *iter, DEGIDIterData *data)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
bool DEG_id_type_updated(const Depsgraph *depsgraph, short id_type)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
void DEG_iterator_objects_begin(BLI_Iterator *iter, DEGObjectIterData *data)
void DEG_iterator_objects_end(BLI_Iterator *iter)
void DEG_iterator_ids_end(BLI_Iterator *iter)
ViewLayer * DEG_get_evaluated_view_layer(const Depsgraph *graph)
ViewLayer * DEG_get_input_view_layer(const Depsgraph *graph)
void DEG_iterator_objects_next(BLI_Iterator *iter)
void DEG_iterator_ids_next(BLI_Iterator *iter)
Scene * DEG_get_input_scene(const Depsgraph *graph)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY
@ DEG_ITER_OBJECT_FLAG_VISIBLE
@ DEG_ITER_OBJECT_FLAG_DUPLI
@ DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET
Read Guarded memory(de)allocation.
DupliObject * rna_hack_DepsgraphObjectInstance_dupli_object_get(PointerRNA *ptr)
BMesh const char void * data
BPy_StructRNA * depsgraph
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
const EnumPropertyItem rna_enum_id_type_items[]
PointerRNA RNA_pointer_create_id_subdata(ID &id, StructRNA *type, void *data)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg, const char *instance)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
const int rna_matrix_dimsize_4x4[]
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
PropertyRNA * RNA_def_string_file_path(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_flag_hide_from_ui_workaround(PropertyRNA *prop)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_depsgraph(BlenderRNA *brna)
static void rna_def_depsgraph_instance(BlenderRNA *brna)
static void rna_def_depsgraph_update(BlenderRNA *brna)
static void rna_def_depsgraph(BlenderRNA *brna)
union CollectionPropertyIterator::@220100362304005352221007113371015217044252346141 internal