92#include "RNA_prototypes.hh"
126bool is_time_dependent_scene_driver_target(
const DriverTarget *target)
136 return is_time_dependent_scene_driver_target(target);
140 return is_time_dependent_scene_driver_target(target);
146bool driver_variable_depends_on_time(
const DriverVar *variable)
149 if (driver_target_depends_on_time(variable, &variable->
targets[i])) {
156bool driver_variables_depends_on_time(
const ListBase *variables)
159 if (driver_variable_depends_on_time(variable)) {
171 if (driver_variables_depends_on_time(&driver->
variables)) {
192bool object_particles_depends_on_time(
Object *
object)
198 if (particle_system_depends_on_time(psys)) {
205bool check_id_has_anim_component(
ID *
id)
208 if (adt ==
nullptr) {
214bool check_id_has_driver_component(
ID *
id)
217 if (adt ==
nullptr) {
224 const char *subtarget,
226 const char *component_subdata,
231 if (target ==
id && root_map !=
nullptr) {
236 if (root_map->has_common_root(component_subdata, subtarget)) {
243bool object_have_geometry_component(
const Object *
object)
262 :
DepsgraphBuilder(bmain, graph, cache), scene_(nullptr), rna_node_query_(graph, this)
268 return graph_->time_source;
276 "find_node component: Could not find ID %s\n",
277 (key.
id !=
nullptr) ? key.
id->
name :
"<null>");
288 if (op_node ==
nullptr) {
290 "find_node_operation: Failed for (%s, '%s')\n",
299 return rna_node_query_.find_node(&key.
ptr, key.
prop, key.
source);
335 const char *description)
352 if (id_node ==
nullptr) {
364 if (id_node ==
nullptr) {
374 const char *description,
377 if (timesrc && node_to) {
378 return graph_->add_new_relation(timesrc, node_to, description, flags);
383 "add_time_relation(%p = %s, %p = %s, %s) Failed\n",
385 (timesrc) ? timesrc->
identifier().c_str() :
"<None>",
387 (node_to) ? node_to->
identifier().c_str() :
"<None>",
402 const char *description,
405 if (node_from && node_to) {
406 return graph_->add_new_relation(node_from, node_to, description, flags);
411 "add_operation_relation(%p = %s, %p = %s, %s) Failed\n",
413 (node_from) ? node_from->
identifier().c_str() :
"<None>",
415 (node_to) ? node_to->
identifier().c_str() :
"<None>",
429 if (relation->ob !=
object) {
457 if (relation->ob !=
object) {
470 if ((relation->pd !=
nullptr) && (relation->pd->forcefield ==
PFIELD_TEXTURE) &&
471 (relation->pd->tex !=
nullptr))
478 if (relation->pd->forcefield ==
PFIELD_FLUIDFLOW && relation->pd->f_source) {
491 if (relation->psys) {
492 if (relation->ob !=
object) {
500 else if (relation->psys != psys) {
504 relation->psys->name);
623 if (built_map_.checkIsBuiltAndTag(
id)) {
646 if (from_layer_collection !=
nullptr) {
663 if (
has_node(object_hierarchy_key)) {
665 object_hierarchy_key,
666 "Collection -> Object hierarchy",
673 if (built_map_.checkIsBuiltAndTag(collection)) {
691 add_relation(collection_hierarchy_key, object_hierarchy_key,
"Collection -> Object hierarchy");
695 add_relation(object_instance_geometry_key, collection_geometry_key,
"Collection Geometry");
699 Collection *collection_instance = cob->ob->instance_collection;
700 if (collection_instance !=
nullptr) {
703 add_relation(collection_instance_key, collection_geometry_key,
"Collection Geometry");
712 add_relation(child_collection_geometry_key, collection_geometry_key,
"Collection Geometry");
718 if (built_map_.checkIsBuiltAndTag(
object)) {
738 add_relation(init_transform_key, local_transform_key,
"Transform Init");
744 if (object->
parent !=
nullptr) {
750 add_relation(local_transform_key, parent_transform_key,
"ObLocal -> ObParent");
755 "Instance Geometry -> Geometry");
758 OperationKey{&object->id, NodeType::INSTANCING, OperationCode::INSTANCE_GEOMETRY},
759 "Transform -> Instance Geometry");
766 BuilderWalkUserData
data;
773 BuilderWalkUserData
data;
780 BuilderWalkUserData
data;
794 add_relation(base_op_key, constraint_key,
"ObBase-> Constraint Stack");
795 add_relation(constraint_key, final_transform_key,
"ObConstraints -> Done");
796 add_relation(constraint_key, ob_eval_key,
"Constraint -> Transform Eval");
798 ob_eval_key, object_transform_simulation_init_key,
"Transform Eval -> Simulation Init");
801 "Simulation -> Final Transform");
806 ob_eval_key, object_transform_simulation_init_key,
"Transform Eval -> Simulation Init");
809 "Simulation -> Final Transform");
827 (object->
pd->
tex !=
nullptr))
841 add_relation(final_transform_key, synchronize_key,
"Synchronize to Original");
851 add_relation(object_from_layer_entry_key, visibility_key,
"Object Visibility");
878 add_relation(view_layer_done_key, object_from_layer_entry_key,
"View Layer flags to Object");
895 add_relation(object_from_layer_entry_key, object_from_layer_exit_key,
"Object from Layer");
900 add_relation(object_from_layer_entry_key, object_flags_key,
"Base flags flush Entry");
901 add_relation(object_flags_key, object_from_layer_exit_key,
"Base flags flush Exit");
906 add_relation(object_from_layer_exit_key, synchronize_key,
"Synchronize to Original");
923 object_visibility_key,
924 "modifier -> object visibility",
927 add_relation(modifier_visibility_key, eval_key,
"modifier visibility -> geometry eval");
953 add_relation(time_src_key, modifier_key,
"Time Source -> Modifier");
956 previous_key = modifier_key;
958 add_relation(previous_key, eval_key,
"modifier stack order");
961 BuilderWalkUserData
data;
968 if (object->
data ==
nullptr) {
973 if (!built_map_.checkIsBuilt(obdata_id)) {
977 switch (object->
type) {
997 add_relation(transform_key, geometry_key,
"Text on Curve own Transform");
1020 if (key !=
nullptr) {
1028 if (materials_ptr !=
nullptr) {
1041 add_relation(camera_parameters_key, object_parameters_key,
"Camera -> Object");
1050 add_relation(lamp_parameters_key, object_parameters_key,
"Light -> Object");
1052 add_relation(lamp_parameters_key, object_shading_key,
"Light -> Object Shading");
1061 add_relation(probe_key, object_key,
"LightProbe Update");
1063 add_relation(probe_key, object_shading_key,
"LightProbe -> Object Shading");
1072 add_relation(speaker_key, object_key,
"Speaker Update");
1078 ID *parent_id = &
object->parent->id;
1085 add_relation(parent_transform_key, object_transform_key,
"Parent Armature Transform");
1091 parent_transform_key, object_geometry_key,
"Parent Armature Transform -> Geometry");
1092 add_relation(parent_pose_key, object_geometry_key,
"Parent Armature Pose -> Geometry");
1095 &object->
id, object_geometry_key,
"Virtual Armature Modifier");
1105 add_relation(parent_key, object_transform_key,
"Vertex Parent");
1117 add_relation(transform_key, object_transform_key,
"Vertex Parent TFM");
1127 add_relation(parent_bone_key, object_transform_key,
"Bone Parent");
1128 add_relation(parent_transform_key, object_transform_key,
"Armature Parent");
1138 add_relation(parent_key, object_transform_key,
"Lattice Deform Parent");
1139 add_relation(geom_key, object_transform_key,
"Lattice Deform Parent Geom");
1147 add_relation(parent_key, object_transform_key,
"Curve Follow Parent");
1149 add_relation(transform_key, object_transform_key,
"Curve Follow TFM");
1154 add_relation(parent_key, object_transform_key,
"Curve Parent");
1160 add_relation(parent_key, object_transform_key,
"Parent");
1173 add_relation(parent_geometry_key, object_transform_key,
"Parent");
1185 if (md1 ==
nullptr) {
1188 if (md2 ==
nullptr) {
1202 std::optional<ComponentKey> point_cache_key;
1203 bool has_rigid_body_relation =
false;
1204 bool has_geometry_eval_relation =
false;
1208 if (!point_cache_key) {
1213 if (!has_geometry_eval_relation) {
1214 has_geometry_eval_relation =
true;
1217 add_relation(*point_cache_key, geometry_key,
"Point Cache -> Geometry");
1223 has_rigid_body_relation =
true;
1227 add_relation(*point_cache_key, transform_key,
"Point Cache -> Rigid Body");
1233 if (!
graph_->is_render_pipeline_depsgraph) {
1238 "Rigid Body Rebuild -> Point Cache Reset",
1243 if (md && md->
prev) {
1251 if (point_cache_key) {
1256 "Transform Simulation -> Point Cache",
1261 if (last_input_modifier !=
nullptr) {
1266 "Previous Modifier -> Point Cache",
1274 "Geometry Init -> Point Cache",
1286 Collection *instance_collection =
object->instance_collection;
1296 add_relation(dupli_transform_key, object_transform_final_key,
"Dupligroup");
1301 "Instance -> Instancer");
1311 add_relation(shading_key, shading_done_key,
"Shading -> Done");
1319 "Light Linking -> Instance",
1331 add_relation(hierarchy_key, light_linking_key,
"Light Linking From Layer");
1332 add_relation(light_linking_key, shading_done_key,
"Light Linking -> Shading Done");
1345 if (collection ==
nullptr) {
1372 collection_light_linking_key,
1373 "Entry -> Collection Light Linking",
1376 collection_parameters_exit_key,
1377 "Collection Light Linking -> Exit",
1381 collection_light_linking_key,
1382 "Collection Hierarchy -> Light Linking",
1390 emitter_light_linking_key,
1391 "Collection -> Object Light Linking");
1396 const char *component_subdata,
1409 ListBase targets = {
nullptr,
nullptr};
1411 if (cti ==
nullptr) {
1426 bool depends_on_camera =
false;
1430 depends_on_camera =
true;
1432 if (
data->depth_ob) {
1440 depends_on_camera =
true;
1442 if (depends_on_camera && scene_->camera !=
nullptr) {
1449 add_relation(time_src_key, constraint_op_key,
"TimeSrc -> Animation");
1455 add_relation(time_src_key, constraint_op_key,
"TimeSrc -> Animation");
1457 if (
data->cache_file) {
1464 if (ct->tar ==
nullptr) {
1478 else if ((ct->tar->type ==
OB_ARMATURE) && (ct->subtarget[0])) {
1481 opcode = bone_target_opcode(
1482 &ct->tar->id, ct->subtarget,
id, component_subdata, root_map);
1534 if (&ct->tar->id ==
id) {
1587 if (check_id_has_anim_component(
id)) {
1590 add_relation(animation_key, parameters_key,
"Animation -> Parameters");
1598 if (adt ==
nullptr) {
1601 if (adt->
action !=
nullptr) {
1611 add_relation(animation_entry_key, animation_eval_key,
"Init -> Eval");
1612 add_relation(animation_eval_key, animation_exit_key,
"Eval -> Exit");
1616 if (adt->
action !=
nullptr) {
1618 add_relation(action_key, adt_key,
"Action -> Animation");
1623 if (node_from ==
nullptr) {
1629 if (adt->
action !=
nullptr) {
1647 if (node_to ==
nullptr) {
1659 graph_->add_new_relation(
1665 if (id_node_from != id_node_to) {
1669 "Animated Copy-on-Eval -> Animation",
1705#ifdef WITH_ANIM_BAKLAVA
1707 if (slot ==
nullptr) {
1716 switch (strip->type()) {
1717 case animrig::Strip::Type::Keyframe: {
1743 if (strip->act !=
nullptr) {
1747 add_relation(action_key, adt_key,
"Action -> Animation");
1750 id, strip->action_slot_handle, adt_key, operation_from, strip->act);
1752 else if (strip->strips.first !=
nullptr) {
1761 if (adt ==
nullptr) {
1769 fcu->rna_path ? fcu->rna_path :
"",
1777 add_relation(adt_key, driver_key,
"AnimData Before Drivers");
1785 bool has_image_animation =
false;
1790 has_image_animation =
true;
1798 add_relation(time_src_key, image_animation_key,
"TimeSrc -> Image Animation");
1804 add_relation(material_update_key, image_animation_key,
"Material Update -> Image Animation");
1808 add_relation(world_update_key, image_animation_key,
"World Update -> Image Animation");
1812 add_relation(ntree_output_key, image_animation_key,
"NTree Output -> Image Animation");
1832 add_relation(animation_key, rigidbody_key,
"Animation -> Rigid Body");
1837 if (built_map_.checkIsBuiltAndTag(dna_action)) {
1846#ifndef WITH_ANIM_BAKLAVA
1856 add_relation(time_src_key, animation_key,
"TimeSrc -> Animation");
1876 if (driver_depends_on_time(driver)) {
1878 add_relation(time_src_key, driver_key,
"TimeSrc -> Driver");
1885 const char *rna_path = fcu->
rna_path;
1886 if (rna_path ==
nullptr || rna_path[0] ==
'\0') {
1906 bool is_bone = id_ptr && property_entry_key.
ptr.
type == &RNA_Bone;
1910 id_ptr = (
ID *)((
Object *)id_ptr)->data;
1916 if (bone ==
nullptr) {
1917 fprintf(stderr,
"Couldn't find armature bone name for driver path - '%s'\n", rna_path);
1922 const bool driver_targets_bbone =
STRPREFIX(prop_identifier,
"bbone_");
1932 if (object->
data != id_ptr || object->
pose ==
nullptr) {
1937 if (pchan ==
nullptr) {
1942 if (driver_targets_bbone) {
1947 add_relation(driver_key, bone_key,
"Arm Bone -> Driver -> Bone");
1959 if (node_to !=
nullptr) {
1960 add_relation(driver_key, property_entry_key,
"Driver -> Driven Property");
1979 property_entry_key.
ptr,
1980 property_entry_key.
prop,
1983 add_relation(property_exit_key, parameters_key,
"Driven Property -> Properties");
1992 add_relation(driver_key, ntree_output_key,
"Drivers -> NTree Output");
1996 add_relation(driver_key, ntree_geo_preprocess_key,
"Drivers -> NTree Geo Preprocess");
2034 Object *
object =
nullptr;
2036 object = (
Object *)target_id;
2040 (dtar->pchan_name[0]))
2043 if (target_pchan ==
nullptr) {
2051 add_relation(variable_key, driver_key,
"Bone Target -> Driver");
2055 if (target_id ==
id) {
2062 add_relation(target_key, driver_key,
"Target -> Driver");
2064 else if (dtar->rna_path !=
nullptr && dtar->rna_path[0] !=
'\0') {
2066 driver_key, self_key, target_id, target_prop, dtar->rna_path);
2070 scene_, target_prop, dtar->rna_path))
2085 if (rna_path ==
"data" || rna_path.
startswith(
"data.")) {
2103 const char *rna_path)
2107 bool animated =
false;
2110 if (!
ELEM(marker->camera,
nullptr, scene->
camera)) {
2121 add_relation(time_src_key, driver_key,
"TimeSrc -> Driver Camera Ref");
2129 const char *rna_path)
2140 add_relation(variable_exit_key, driver_key,
"RNA Target -> Driver");
2177 add_relation(target_id_key, driver_key,
"Target ID -> Driver");
2183 const char *rna_path_from_target_prop)
2185 if (rna_path_from_target_prop ==
nullptr || rna_path_from_target_prop[0] ==
'\0') {
2195 if (prop ==
nullptr) {
2233 add_relation(parameters_entry_key, parameters_eval_key,
"Entry -> Eval");
2234 add_relation(parameters_eval_key, parameters_exit_key,
"Entry -> Exit");
2242 add_relation(geometry_key, dimensions_key,
"Geometry -> Dimensions");
2243 add_relation(transform_key, dimensions_key,
"Transform -> Dimensions");
2248 if (built_map_.checkIsBuiltAndTag(
world)) {
2262 add_relation(parameters_key, world_key,
"World's parameters");
2265 if (
world->nodetree !=
nullptr) {
2281 add_relation(time_src_key, rb_init_key,
"TimeSrc -> Rigidbody Init");
2293 add_relation(effector_transform_key, rb_init_key,
"RigidBody Field");
2294 if (effector_relation->pd !=
nullptr) {
2295 const short shape = effector_relation->pd->shape;
2298 add_relation(effector_geometry_key, rb_init_key,
"RigidBody Field");
2301 (effector_relation->pd->tex !=
nullptr))
2304 add_relation(tex_key, rb_init_key,
"Force field Texture");
2309 if (rbw->
group !=
nullptr) {
2336 "Object Transform -> Rigidbody Sim Eval");
2346 "Object Geom Eval -> Rigidbody Sim Eval",
2360 add_relation(rb_simulate_key, rb_transform_copy_key,
"Rigidbody Sim Eval -> RBO Sync");
2365 object_transform_final_key,
2366 "Rigidbody Sync -> Transform Final");
2401 add_relation(particle_settings_key, eval_init_key,
"Particle Settings Change");
2407 add_relation(psys_key, obdata_ubereval_key,
"PSys -> UberEval");
2423 if (part->
boids !=
nullptr) {
2426 Object *ruleob =
nullptr;
2433 if (ruleob !=
nullptr) {
2443 if (
ELEM(particle_target->ob,
nullptr,
object)) {
2481 if (built_map_.checkIsBuiltAndTag(part)) {
2497 particle_settings_init_key, particle_settings_eval_key,
"Particle Settings Init Order");
2498 add_relation(particle_settings_reset_key, particle_settings_eval_key,
"Particle Settings Reset");
2501 if (mtex ==
nullptr || mtex->
tex ==
nullptr) {
2507 particle_settings_reset_key,
2508 "Particle Texture -> Particle Reset",
2510 add_relation(texture_key, particle_settings_eval_key,
"Particle Texture -> Particle Eval");
2515 add_relation(object_key, particle_settings_eval_key,
"Particle Texture Space");
2518 if (check_id_has_anim_component(&part->
id)) {
2520 add_relation(animation_key, particle_settings_eval_key,
"Particle Settings Animation");
2532 add_relation(dup_ob_key, psys_key,
"Particle Object Visualization");
2535 add_relation(obdata_ubereval_key, dup_geometry_key,
"Particle MBall Visualization");
2542 if (built_map_.checkIsBuiltAndTag(key)) {
2558 add_relation(key_block_key, geometry_key,
"Key Block Properties");
2559 add_relation(key_block_key, parameters_eval_key,
"Key Block Properties");
2593 add_relation(obdata_geom_key, geom_key,
"Object Geometry Base Data");
2603 "Transform -> Instance Geometry");
2618 add_relation(time_src_key, obdata_ubereval_key,
"Time Source");
2633 add_relation(geom_init_key, obdata_ubereval_key,
"Object Geometry UberEval");
2639 if (mom ==
object) {
2641 add_relation(mom_transform_key, mom_geom_key,
"Metaball Motherball Transform -> Geometry");
2645 add_relation(geom_key, mom_geom_key,
"Metaball Motherball");
2646 add_relation(transform_key, mom_geom_key,
"Metaball Motherball");
2656 if (object_particles_depends_on_time(
object)) {
2660 add_relation(time_key, obdata_ubereval_key,
"Legacy particle time");
2665 if (key !=
nullptr) {
2666 if (key->
adt !=
nullptr) {
2679 add_relation(final_geometry_key, synchronize_key,
"Synchronize to Original");
2685 add_relation(object_data_select_key, object_select_key,
"Data Selection -> Object Selection");
2691 add_relation(geometry_shading_key, object_shading_key,
"Geometry Shading -> Object Shading");
2696 if (built_map_.checkIsBuiltAndTag(obdata)) {
2708 if (key !=
nullptr) {
2714 add_relation(obdata_geom_eval_key, obdata_geom_done_key,
"ObData Geom Eval Done");
2718 add_relation(parameters_key, obdata_geom_eval_key,
"ObData Geom Params");
2729 if (cu->
bevobj !=
nullptr) {
2731 add_relation(bevob_geom_key, obdata_geom_eval_key,
"Curve Bevel Geometry");
2733 add_relation(bevob_key, obdata_geom_eval_key,
"Curve Bevel Transform");
2738 add_relation(taperob_key, obdata_geom_eval_key,
"Curve Taper");
2743 add_relation(textoncurve_geom_key, obdata_geom_eval_key,
"Text on Curve Geometry");
2745 add_relation(textoncurve_key, obdata_geom_eval_key,
"Text on Curve Transform");
2757 add_relation(object_data_select_key, obdata_geom_eval_key,
"Active Spline Update");
2773 add_relation(time_key, geometry_key,
"GP Frame Change");
2778 for (
int i = 0; i < gpd->
totcol; i++) {
2780 if ((ma !=
nullptr) && (ma->
gp_style !=
nullptr)) {
2782 add_relation(material_key, geometry_key,
"Material -> GP Data");
2788 if (gpl->parent !=
nullptr) {
2791 if (gpl->partype ==
PARBONE) {
2797 add_relation(armature_key, gpd_geom_key,
"Armature Parent");
2801 add_relation(transform_key, gpd_geom_key,
"GPencil Parent Layer");
2808 Curves *curves_id =
reinterpret_cast<Curves *
>(obdata);
2809 if (curves_id->
surface !=
nullptr) {
2824 add_relation(time_key, geometry_key,
"Volume sequence time");
2834 add_relation(time_key, geometry_key,
"Grease Pencil Frame Change");
2839 if (parent ==
nullptr) {
2842 if (parent->
type ==
OB_ARMATURE && !layer->parent_bone_name().is_empty()) {
2847 add_relation(bone_key, geometry_key,
"Grease Pencil Layer Bone Parent");
2848 add_relation(armature_key, geometry_key,
"Grease Pencil Layer Armature Parent");
2852 add_relation(transform_key, geometry_key,
"Grease Pencil Layer Object Parent");
2865 if (built_map_.checkIsBuiltAndTag(armature)) {
2896 if (built_map_.checkIsBuiltAndTag(
camera)) {
2905 if (
camera->dof.focus_object !=
nullptr) {
2909 add_relation(dof_ob_key, camera_parameters_key,
"Camera DOF");
2910 if (
camera->dof.focus_subtarget[0]) {
2913 camera->dof.focus_subtarget,
2915 add_relation(target_key, camera_parameters_key,
"Camera DOF subtarget");
2923 if (built_map_.checkIsBuiltAndTag(lamp)) {
2937 add_relation(lamp_parameters_key, shading_key,
"Light Shading Parameters");
2944 add_relation(ntree_key, shading_key,
"NTree->Light Parameters");
2955 if (
object !=
nullptr) {
2961 if (
image !=
nullptr) {
2967 if (collection !=
nullptr) {
2979 if (material !=
nullptr) {
2987 if (ntree ==
nullptr) {
2990 if (built_map_.checkIsBuiltAndTag(ntree)) {
3004 add_relation(ntree_cow_key, ntree_geo_preprocess_key,
"Copy-on-Eval -> Preprocess");
3007 "Preprocess -> Output",
3011 for (
bNode *bnode : ntree->all_nodes()) {
3021 if (
id ==
nullptr) {
3025 if (id_type ==
ID_MA) {
3028 add_relation(material_key, ntree_output_key,
"Material -> Node");
3030 else if (id_type ==
ID_TE) {
3033 add_relation(texture_key, ntree_output_key,
"Texture -> Node");
3035 else if (id_type ==
ID_IM) {
3038 add_relation(image_key, ntree_output_key,
"Image -> Node");
3040 else if (id_type ==
ID_OB) {
3043 add_relation(object_transform_key, ntree_output_key,
"Object Transform -> Node");
3044 if (object_have_geometry_component(
reinterpret_cast<Object *
>(
id))) {
3046 add_relation(object_geometry_key, ntree_output_key,
"Object Geometry -> Node");
3049 else if (id_type ==
ID_SCE) {
3056 if (node_scene->
camera !=
nullptr) {
3060 else if (id_type ==
ID_TXT) {
3063 else if (id_type ==
ID_MSK) {
3066 add_relation(mask_key, ntree_output_key,
"Mask -> Node");
3068 else if (id_type ==
ID_MC) {
3071 add_relation(clip_key, ntree_output_key,
"Clip -> Node");
3073 else if (id_type ==
ID_VF) {
3076 add_relation(vfont_key, ntree_output_key,
"VFont -> Node");
3085 add_relation(group_output_key, ntree_output_key,
"Group Node");
3090 add_relation(group_preprocess_key, ntree_geo_preprocess_key,
"Group Node Preprocess");
3100 ntree->ensure_interface_cache();
3108 if (check_id_has_anim_component(&ntree->
id)) {
3110 add_relation(animation_key, ntree_output_key,
"NTree Shading Parameters");
3112 add_relation(animation_key, ntree_geo_preprocess_key,
"NTree Animation -> Preprocess");
3123 add_relation(material_key, owner_shading_key,
"Material -> Owner Shading");
3126 if (built_map_.checkIsBuiltAndTag(material)) {
3140 add_relation(parameters_key, material_key,
"Material's parameters");
3143 if (material->
nodetree !=
nullptr) {
3147 add_relation(ntree_key, material_key,
"Material's NTree");
3154 for (
int i = 0; i < num_materials; i++) {
3155 if (materials[i] ==
nullptr) {
3165 if (built_map_.checkIsBuiltAndTag(
texture)) {
3182 add_relation(ntree_key, texture_key,
"Texture's NTree");
3188 if (
texture->ima !=
nullptr) {
3196 if (check_id_has_anim_component(&
texture->id)) {
3198 add_relation(animation_key, texture_key,
"Datablock Animation");
3203 add_relation(image_animation_key, texture_key,
"Datablock Image Animation");
3209 if (built_map_.checkIsBuiltAndTag(
image)) {
3221 if (built_map_.checkIsBuiltAndTag(cache_file)) {
3231 if (check_id_has_anim_component(&cache_file->
id)) {
3234 add_relation(animation_key, datablock_key,
"Datablock Animation");
3236 if (check_id_has_driver_component(&cache_file->
id)) {
3239 add_relation(animation_key, datablock_key,
"Drivers -> Cache Eval");
3247 add_relation(time_src_key, cache_update_key,
"TimeSrc -> Cache File Eval");
3253 if (built_map_.checkIsBuiltAndTag(
mask)) {
3267 add_relation(time_src_key, mask_animation_key,
"TimeSrc -> Mask Animation");
3270 add_relation(mask_animation_key, mask_eval_key,
"Mask Animation -> Mask Eval");
3274 for (
int i = 0; i < spline->tot_point; i++) {
3277 if (parent ==
nullptr || parent->
id ==
nullptr) {
3284 add_relation(movieclip_eval_key, mask_eval_key,
"Movie Clip -> Mask Eval");
3293 if (built_map_.checkIsBuiltAndTag(linestyle)) {
3299 ID *linestyle_id = &linestyle->
id;
3308 if (built_map_.checkIsBuiltAndTag(clip)) {
3322 if (built_map_.checkIsBuiltAndTag(probe)) {
3335 if (built_map_.checkIsBuiltAndTag(speaker)) {
3344 if (speaker->
sound !=
nullptr) {
3348 add_relation(sound_key, speaker_key,
"Sound -> Speaker");
3354 if (built_map_.checkIsBuiltAndTag(sound)) {
3367 add_relation(parameters_key, audio_key,
"Parameters -> Audio");
3381 if (
seq->sound !=
nullptr) {
3387 if (
seq->scene !=
nullptr) {
3397 sequence_scene_audio_key, cd->
sequencer_key,
"Sequence Scene Audio -> Sequencer");
3400 sequence_scene_key, cd->
sequencer_key,
"Sequence Scene -> Sequencer");
3411 if (scene->
ed ==
nullptr) {
3429 add_relation(sequencer_key, scene_audio_key,
"Sequencer -> Audio");
3438 add_relation(scene_audio_entry_key, scene_audio_volume_key,
"Audio Entry -> Volume");
3439 add_relation(scene_audio_volume_key, scene_sound_eval_key,
"Audio Volume -> Sound");
3443 add_relation(scene_anim_key, scene_audio_volume_key,
"Animation -> Audio Volume");
3451 Object *
object = base->object;
3461 if (built_map_.checkIsBuiltAndTag(vfont)) {
3486 int relation_flag = 0;
3487 if (!flush_cow_changes) {
3492 add_relation(id_copy_on_write_key, owner_copy_on_write_key,
"Eval Order", relation_flag);
3497 if (ntree ==
nullptr) {
3508 if (key ==
nullptr) {
3537 if (!comp_node->depends_on_cow()) {
3548 if (id_type ==
ID_SO) {
3577 if (op_entry !=
nullptr) {
3578 Relation *rel =
graph_->add_new_relation(op_cow, op_entry,
"Copy-on-Eval Dependency");
3579 rel->
flag |= rel_flag;
3582 for (
OperationNode *op_node : comp_node->operations_map->values()) {
3583 if (op_node == op_entry) {
3586 if (op_node->inlinks.is_empty()) {
3587 Relation *rel =
graph_->add_new_relation(op_cow, op_node,
"Copy-on-Eval Dependency");
3588 rel->
flag |= rel_flag;
3591 bool has_same_comp_dependency =
false;
3592 for (
Relation *rel_current : op_node->inlinks) {
3598 has_same_comp_dependency =
true;
3602 if (!has_same_comp_dependency) {
3603 Relation *rel =
graph_->add_new_relation(op_cow, op_node,
"Copy-on-Eval Dependency");
3604 rel->
flag |= rel_flag;
3620 ID *object_data_id = (
ID *)object->
data;
3621 if (object_data_id !=
nullptr) {
3642 if (animation_data !=
nullptr) {
3643 if (animation_data->
action !=
nullptr) {
3657void DepsgraphRelationBuilder::modifier_walk(
void *user_data,
3662 BuilderWalkUserData *
data = (BuilderWalkUserData *)user_data;
3664 if (
id ==
nullptr) {
3667 data->builder->build_id(
id);
3670void DepsgraphRelationBuilder::constraint_walk(
bConstraint * ,
3675 BuilderWalkUserData *
data = (BuilderWalkUserData *)user_data;
3677 if (
id ==
nullptr) {
3680 data->builder->build_id(
id);
Functions and classes to work with Actions.
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
AnimData * BKE_animdata_from_id(const ID *id)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(_collection, _object, _mode)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END
void BKE_constraint_targets_flush(struct bConstraint *con, struct ListBase *targets, bool no_copy)
int BKE_constraint_targets_get(struct bConstraint *con, struct ListBase *r_targets)
bool BKE_constraint_target_uses_bbone(struct bConstraint *con, struct bConstraintTarget *ct)
const bConstraintTypeInfo * BKE_constraint_typeinfo_get(struct bConstraint *con)
void BKE_constraints_id_loop(struct ListBase *list, ConstraintIDFunc func, const int flag, void *userdata)
bool BKE_driver_expression_depends_on_time(struct ChannelDriver *driver)
bool driver_get_target_property(const DriverTargetContext *driver_target_context, struct DriverVar *dvar, struct DriverTarget *dtar, struct PointerRNA *r_prop)
#define DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
void BKE_gpencil_modifiers_foreach_ID_link(struct Object *ob, GreasePencilIDWalkFunc walk, void *user_data)
Low-level operations for grease pencil.
void IDP_foreach_property(IDProperty *id_property_root, int type_filter, blender::FunctionRef< void(IDProperty *id_property)> callback)
bool BKE_image_user_id_has_animation(ID *id)
Key * BKE_key_from_id(ID *id)
Key * BKE_key_from_object(Object *ob)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
ViewLayer * BKE_view_layer_default_render(const Scene *scene)
ListBase * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
General operations, lookup, etc. for materials.
short * BKE_object_material_len_p(struct Object *ob)
struct Material *** BKE_object_material_array_p(struct Object *ob)
Object * BKE_mball_basis_find(Scene *scene, Object *ob)
bool BKE_modifier_depends_ontime(Scene *scene, ModifierData *md)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
void void void BKE_modifiers_foreach_ID_link(Object *ob, IDWalkFunc walk, void *user_data)
#define NODE_CUSTOM_GROUP
General operations, lookup, etc. for blender objects.
bool BKE_ptcache_object_has(struct Scene *scene, struct Object *ob, int duplis)
void BKE_ptcache_foreach_object_cache(struct Object &ob, struct Scene &scene, bool duplis, PointCacheIdFn fn)
#define PTCACHE_TYPE_RIGIDBODY
API for Blender-side Rigid Body stuff.
void BKE_shaderfx_foreach_ID_link(struct Object *ob, ShaderFxIDWalkFunc walk, void *user_data)
bool BKE_shaderfx_depends_ontime(struct ShaderFxData *fx)
const ShaderFxTypeInfo * BKE_shaderfx_get_info(ShaderFxType type)
bool BKE_shrinkwrap_needs_normals(int shrinkType, int shrinkMode)
#define BLI_assert_msg(a, msg)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
@ DAG_EVAL_NEED_SHRINKWRAP_BOUNDARY
@ DAG_EVAL_NEED_CURVE_PATH
struct DriverVar DriverVar
struct DriverTarget DriverTarget
@ DTAR_CONTEXT_PROPERTY_ACTIVE_SCENE
struct ChannelDriver ChannelDriver
@ eBoidRuleType_FollowLeader
Object groups, one object can be in many groups at once.
@ CONSTRAINT_TYPE_FOLLOWTRACK
@ CONSTRAINT_TYPE_OBJECTSOLVER
@ CONSTRAINT_TYPE_ARMATURE
@ CONSTRAINT_TYPE_LOCLIKE
@ CONSTRAINT_TYPE_SHRINKWRAP
@ CONSTRAINT_TYPE_CAMERASOLVER
@ CONSTRAINT_TYPE_ROTLIKE
@ CONSTRAINT_TYPE_SPLINEIK
@ CONSTRAINT_TYPE_KINEMATIC
@ CONSTRAINT_TYPE_TRANSLIKE
@ CONSTRAINT_TYPE_CLAMPTO
@ CONSTRAINT_TYPE_FOLLOWPATH
@ CONSTRAINT_TYPE_SIZELIKE
@ CONSTRAINT_TYPE_TRANSFORM_CACHE
@ CON_SHRINKWRAP_TRACK_NORMAL
#define CD_MASK_ORIGINDEX
#define CD_MASK_MDEFORMVERT
#define CD_MASK_CUSTOMLOOPNORMAL
@ eModifierType_Collision
@ MOD_SHRINKWRAP_TARGET_PROJECT
@ MOD_SHRINKWRAP_NEAREST_VERTEX
@ NTREE_RUNTIME_FLAG_HAS_IMAGE_ANIMATION
Object is a sort of wrapper for general info.
#define OB_TYPE_IS_GEOMETRY(_type)
struct ParticleSettings ParticleSettings
struct ParticleSystem ParticleSystem
Types and defines for representing Rigid Body entities.
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between world
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
btSequentialImpulseConstraintSolverMt int btPersistentManifold int btTypedConstraint ** constraints
constexpr bool startswith(StringRef prefix) const
blender::Span< const Layer * > layers() const
bool is_action_legacy() const
bool is_action_layered() const
Slot * slot_for_handle(slot_handle_t handle)
const ChannelBag * channelbag_for_slot(const Slot &slot) const
virtual bool check_pchan_has_bbone_segments(const Object *object, const bPoseChannel *pchan)
virtual bool need_pull_base_into_graph(const Base *base)
static const char * get_rna_path_relative_to_scene_camera(const Scene *scene, const PointerRNA &target_prop, const char *rna_path)
DepsgraphBuilder(Main *bmain, Depsgraph *graph, DepsgraphBuilderCache *cache)
virtual void build_driver_rna_path_variable(const OperationKey &driver_key, const RNAPathKey &self_key, ID *target_id, const PointerRNA &target_prop, const char *rna_path)
void add_particle_collision_relations(const OperationKey &key, Object *object, Collection *collection, const char *name)
virtual void build_sound(bSound *sound)
virtual void build_animdata_action_targets(ID *id, int32_t slot_handle, ComponentKey &adt_key, OperationNode *operation_from, bAction *action)
Relation * add_depends_on_transform_relation(ID *id, const KeyTo &key_to, const char *description, int flags=0)
virtual void build_freestyle_linestyle(FreestyleLineStyle *linestyle)
virtual void build_collection(LayerCollection *from_layer_collection, Collection *collection)
virtual void build_scene_audio(Scene *scene)
virtual void build_image(Image *image)
virtual void build_driver_id_property(const PointerRNA &target_prop, const char *rna_path_from_target_prop)
virtual void build_copy_on_write_relations()
virtual void build_object_layer_component_relations(Object *object)
virtual void build_object_from_view_layer_base(Object *object)
virtual void build_driver(ID *id, FCurve *fcurve)
virtual void build_dimensions(Object *object)
virtual void build_animation_images(ID *id)
virtual void build_driver_data(ID *id, FCurve *fcurve)
virtual void build_nested_nodetree(ID *owner, bNodeTree *ntree)
virtual void build_nodetree_socket(bNodeSocket *socket)
virtual void build_light(Light *lamp)
virtual void build_action(bAction *action)
virtual void build_material(Material *ma, ID *owner=nullptr)
virtual void build_speaker(Speaker *speaker)
virtual void build_animdata_force(ID *id)
TimeSourceNode * get_node(const TimeSourceKey &key) const
bool is_same_nodetree_node_dependency(const KeyFrom &key_from, const KeyTo &key_to)
virtual void build_scene_speakers(Scene *scene, ViewLayer *view_layer)
OperationNode * find_node(const OperationKey &key) const
virtual void build_armature(bArmature *armature)
virtual void build_armature_bone_collections(blender::Span< BoneCollection * > collections)
virtual void build_armature_bones(ListBase *bones)
virtual void build_object_pointcache(Object *object)
virtual void build_constraints(ID *id, NodeType component_type, const char *component_subdata, ListBase *constraints, RootPChanMap *root_map)
virtual void build_mask(Mask *mask)
virtual void build_object_modifiers(Object *object)
virtual void build_vfont(VFont *vfont)
virtual void build_animdata_curves_targets(ID *id, ComponentKey &adt_key, OperationNode *operation_from, ListBase *curves)
virtual void build_camera(Camera *camera)
virtual void build_object_data_light(Object *object)
virtual void build_world(World *world)
void add_customdata_mask(Object *object, const DEGCustomDataMeshMasks &customdata_masks)
bool is_same_bone_dependency(const KeyFrom &key_from, const KeyTo &key_to)
virtual void build_scene_sequencer(Scene *scene)
virtual void build_object_data_camera(Object *object)
virtual void build_animdata(ID *id)
virtual void build_object_data_geometry(Object *object)
DepsgraphRelationBuilder(Main *bmain, Depsgraph *graph, DepsgraphBuilderCache *cache)
virtual void build_object_data_lightprobe(Object *object)
virtual void build_particle_settings(ParticleSettings *part)
virtual void build_object_light_linking(Object *emitter)
virtual void build_texture(Tex *tex)
void add_special_eval_flag(ID *id, uint32_t flag)
virtual void build_generic_id(ID *id)
virtual void build_driver_scene_camera_variable(const OperationKey &driver_key, const RNAPathKey &self_key, Scene *scene, const char *rna_path)
virtual void build_object(Object *object)
virtual void build_movieclip(MovieClip *clip)
virtual void build_nodetree(bNodeTree *ntree)
Relation * add_relation(const KeyFrom &key_from, const KeyTo &key_to, const char *description, int flags=0)
virtual void build_object_data_geometry_datablock(ID *obdata)
virtual void build_animdata_fcurve_target(ID *id, PointerRNA id_ptr, ComponentKey &adt_key, OperationNode *operation_from, FCurve *fcu)
void add_particle_forcefield_relations(const OperationKey &key, Object *object, ParticleSystem *psys, EffectorWeights *eff, bool add_absorption, const char *name)
virtual void build_rigidbody(Scene *scene)
virtual void build_nested_datablock(ID *owner, ID *id, bool flush_cow_changes)
virtual void build_particle_system_visualization_object(Object *object, ParticleSystem *psys, Object *draw_object)
virtual void build_lightprobe(LightProbe *probe)
void add_visibility_relation(ID *id_from, ID *id_to)
virtual void build_driver_variables(ID *id, FCurve *fcurve)
virtual void build_object_instance_collection(Object *object)
virtual void build_nested_shapekey(ID *owner, Key *key)
virtual void build_object_parent(Object *object)
virtual void build_scene_parameters(Scene *scene)
virtual void build_parameters(ID *id)
bool has_node(const ComponentKey &key) const
virtual void build_shapekeys(Key *key)
virtual void build_object_data_speaker(Object *object)
virtual void build_light_linking_collection(Object *emitter, Collection *collection)
virtual void build_rig(Object *object)
Relation * add_operation_relation(OperationNode *node_from, OperationNode *node_to, const char *description, int flags=0)
virtual void build_object_data(Object *object)
virtual void build_animdata_drivers(ID *id)
virtual void build_id(ID *id)
virtual void build_idproperties(IDProperty *id_property)
virtual void build_materials(ID *owner, Material **materials, int num_materials)
virtual void build_animdata_curves(ID *id)
virtual void build_cachefile(CacheFile *cache_file)
virtual void build_object_shading(Object *object)
DepsNodeHandle create_node_handle(const KeyType &key, const char *default_name="")
virtual void build_animdata_nlastrip_targets(ID *id, ComponentKey &adt_key, OperationNode *operation_from, ListBase *strips)
Relation * add_time_relation(TimeSourceNode *timesrc, Node *node_to, const char *description, int flags=0)
virtual void build_particle_systems(Object *object)
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
local_group_size(16, 16) .push_constant(Type texture
#define DEG_DEBUG_PRINTF(depsgraph, type,...)
void SEQ_for_each_callback(ListBase *seqbase, SeqForEachFunc callback, void *user_data)
ccl_device_inline float4 mask(const int4 mask, const float4 a)
bNodeTree ** node_tree_ptr_from_id(ID *id)
@ RELATION_FLAG_FLUSH_USER_EDIT_ONLY
@ RELATION_CHECK_BEFORE_ADD
@ RELATION_NO_VISIBILITY_CHANGE
static bool seq_build_prop_cb(Sequence *seq, void *user_data)
@ NTREE_GEOMETRY_PREPROCESS
bool rna_prop_affects_parameters_node(const PointerRNA *ptr, const PropertyRNA *prop)
static const ModifierData * get_latter_modifier(const ModifierData *md1, const ModifierData *md2)
ListBase * build_collision_relations(Depsgraph *graph, Collection *collection, uint modifier_type)
static bool rigidbody_object_depends_on_evaluated_geometry(const RigidBodyOb *rbo)
@ TRANSFORM_SIMULATION_INIT
@ OBJECT_FROM_LAYER_ENTRY
@ RIGIDBODY_TRANSFORM_COPY
@ SYNCHRONIZE_TO_ORIGINAL
@ PARTICLE_SETTINGS_RESET
@ NTREE_GEOMETRY_PREPROCESS
ListBase * build_effector_relations(Depsgraph *graph, Collection *collection)
const char * operationCodeAsString(OperationCode opcode)
bool deg_eval_copy_is_needed(const ID *id_orig)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
bool RNA_pointer_is_null(const PointerRNA *ptr)
const char * RNA_property_identifier(const PropertyRNA *prop)
PointerRNA RNA_id_pointer_create(ID *id)
bool RNA_path_resolve_full(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
struct Collection * group
struct ClothCollSettings * coll_parms
struct Object * textoncurve
struct ViewLayer * view_layer
struct Collection * group
struct bNodeTree * nodetree
struct bNodeTree * nodetree
struct bNodeTree * nodetree
struct MaterialGPencilStyle * gp_style
struct ModifierData * prev
void(* update_depsgraph)(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
struct Collection * instance_collection
struct RigidBodyOb * rigidbody_object
ListBase greasepencil_modifiers
LightLinking * light_linking
struct Collection * collision_group
struct Collection * instance_collection
struct BoidSettings * boids
struct EffectorWeights * effector_weights
struct Object * instance_object
struct ClothModifierData * clmd
struct Collection * group
struct EffectorWeights * effector_weights
struct RigidBodyWorld * rigidbody_world
void(* update_depsgraph)(struct ShaderFxData *fx, const struct ModifierUpdateDepsgraphContext *ctx)
bNodeTreeRuntimeHandle * runtime
OperationNode * find_operation(OperationIDKey key) const
static DEGCustomDataMeshMasks MaskVert(const uint64_t vert_mask)
static DEGCustomDataMeshMasks MaskFace(const uint64_t face_mask)
static DEGCustomDataMeshMasks MaskLoop(const uint64_t loop_mask)
static DEGCustomDataMeshMasks MaskEdge(const uint64_t edge_mask)
static DEGCustomDataMeshMasks MaskPoly(const uint64_t poly_mask)
DEGCustomDataMeshMasks customdata_masks
Map< ComponentIDKey, ComponentNode * > components
ComponentNode * find_component(NodeType type, const char *name="") const
virtual OperationNode * get_entry_operation()
virtual string identifier() const
virtual OperationNode * get_exit_operation()
const char * component_name
virtual OperationNode * get_entry_operation() override
virtual string identifier() const override
DepsgraphRelationBuilder * builder
ComponentKey sequencer_key