Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/depsgraph_build.cc
| Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | void DEG_add_bone_relation(DepsNodeHandle *node_handle, | ||||
| DEG::ComponentKey comp_key(&object->id, type, bone_name); | DEG::ComponentKey comp_key(&object->id, type, bone_name); | ||||
| DEG::DepsNodeHandle *deg_node_handle = get_node_handle(node_handle); | DEG::DepsNodeHandle *deg_node_handle = get_node_handle(node_handle); | ||||
| deg_node_handle->builder->add_node_handle_relation(comp_key, deg_node_handle, description); | deg_node_handle->builder->add_node_handle_relation(comp_key, deg_node_handle, description); | ||||
| } | } | ||||
| void DEG_add_object_pointcache_relation(struct DepsNodeHandle *node_handle, | void DEG_add_object_pointcache_relation(struct DepsNodeHandle *node_handle, | ||||
| struct Object *object, | struct Object *object, | ||||
| eDepsObjectComponentType component, | eDepsObjectComponentType component, | ||||
| const char *description) | const char *description, | ||||
| bool allow_break_cycles) | |||||
| { | { | ||||
| DEG::NodeType type = DEG::nodeTypeFromObjectComponent(component); | DEG::NodeType type = DEG::nodeTypeFromObjectComponent(component); | ||||
| DEG::ComponentKey comp_key(&object->id, type); | DEG::ComponentKey comp_key(&object->id, type); | ||||
| DEG::DepsNodeHandle *deg_node_handle = get_node_handle(node_handle); | DEG::DepsNodeHandle *deg_node_handle = get_node_handle(node_handle); | ||||
| DEG::DepsgraphRelationBuilder *relation_builder = deg_node_handle->builder; | DEG::DepsgraphRelationBuilder *relation_builder = deg_node_handle->builder; | ||||
| int flags = allow_break_cycles ? DEG::RELATION_FLAG_PHYSICS_BREAK_CYCLES : 0; | |||||
| /* Add relation from source to the node handle. */ | /* Add relation from source to the node handle. */ | ||||
| relation_builder->add_node_handle_relation(comp_key, deg_node_handle, description); | relation_builder->add_node_handle_relation(comp_key, deg_node_handle, description, flags); | ||||
| /* Node deduct point cache component and connect source to it. */ | /* Node deduct point cache component and connect source to it. */ | ||||
| ID *id = DEG_get_id_from_handle(node_handle); | ID *id = DEG_get_id_from_handle(node_handle); | ||||
| DEG::ComponentKey point_cache_key(id, DEG::NodeType::POINT_CACHE); | DEG::ComponentKey point_cache_key(id, DEG::NodeType::POINT_CACHE); | ||||
| DEG::Relation *rel = relation_builder->add_relation(comp_key, point_cache_key, "Point Cache"); | DEG::Relation *rel = relation_builder->add_relation( | ||||
| comp_key, point_cache_key, "Point Cache", flags); | |||||
| if (rel != NULL) { | if (rel != NULL) { | ||||
| rel->flag |= DEG::RELATION_FLAG_FLUSH_USER_EDIT_ONLY; | rel->flag |= DEG::RELATION_FLAG_FLUSH_USER_EDIT_ONLY; | ||||
| } | } | ||||
| else { | else { | ||||
| fprintf(stderr, "Error in point cache relation from %s to ^%s.\n", object->id.name, id->name); | fprintf(stderr, "Error in point cache relation from %s to ^%s.\n", object->id.name, id->name); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 351 Lines • Show Last 20 Lines | |||||