From f783efd1279ae6c0e334e4fa86666e4f1234f85d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 31 May 2017 21:14:08 +0200 Subject: Fix T51680: 'Delete Group' from Group view of Outliner does not work. Do not call invoke ops from outliner's operations menus. Invoke op would search again for item under mouse coordinates... when it is invoked! Means often entry menu you would have clicked would not be over target item, leading to either nothing or operation being applied to wrong item. Note: about groups, there is another minor annoyance leading to some assert - groups have an annoying virtual fake user which breaks usercount, will see whether this is easily fixable. :| --- source/blender/editors/space_outliner/outliner_tools.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index cdb3df0fae9..d1392b6c07e 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -399,7 +399,7 @@ static void object_deselect_cb( static void object_delete_cb( bContext *C, ReportList *reports, Scene *scene, TreeElement *te, - TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, void *UNUSED(user_data)) + TreeStoreElem *tsep, TreeStoreElem *tselem, void *user_data) { Base *base = (Base *)te->directdata; @@ -436,7 +436,7 @@ static void object_delete_cb( * Should not happen ideally, but does happens, see T51625. * Rather than twisting in all kind of ways to address all possible cases leading to that situation, simpler * to allow deleting such object as a mere generic data-block. */ - WM_operator_name_call(C, "OUTLINER_OT_id_delete", WM_OP_INVOKE_REGION_WIN, NULL); + id_delete_cb(C, reports, scene, te, tsep, tselem, user_data); } } @@ -1058,7 +1058,7 @@ static EnumPropertyItem prop_group_op_types[] = { {OL_GROUPOP_UNLINK, "UNLINK", 0, "Unlink Group", ""}, {OL_GROUPOP_LOCAL, "LOCAL", 0, "Make Local Group", ""}, {OL_GROUPOP_LINK, "LINK", 0, "Link Group Objects to Scene", ""}, - {OL_GROUPOP_DELETE, "DELETE", 0, "Delete Group", "WARNING: no undo"}, + {OL_GROUPOP_DELETE, "DELETE", 0, "Delete Group", ""}, {OL_GROUPOP_REMAP, "REMAP", 0, "Remap Users", "Make all users of selected data-blocks to use instead current (clicked) one"}, {OL_GROUPOP_INSTANCE, "INSTANCE", 0, "Instance Groups in Scene", ""}, @@ -1097,7 +1097,7 @@ static int outliner_group_operation_exec(bContext *C, wmOperator *op) DAG_relations_tag_update(CTX_data_main(C)); break; case OL_GROUPOP_DELETE: - WM_operator_name_call(C, "OUTLINER_OT_id_delete", WM_OP_INVOKE_REGION_WIN, NULL); + outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, id_delete_cb, NULL); break; case OL_GROUPOP_REMAP: outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, id_remap_cb, NULL); -- cgit v1.2.3 From 8b0f968a312e4293349c91d1d50621d120b5c899 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 31 May 2017 21:24:41 +0200 Subject: Fix bad handling of 'extra' user for groups at their creation. Was just keeping the default '1' user from `BKE_libblock_alloc()`, instead of using correct way to handle extra virtual user needed when we want to keep unused datablocks around... --- source/blender/blenkernel/intern/group.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 9b011dbb003..414802dd250 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -80,6 +80,8 @@ Group *BKE_group_add(Main *bmain, const char *name) Group *group; group = BKE_libblock_alloc(bmain, ID_GR, name); + id_us_min(&group->id); + id_us_ensure_real(&group->id); group->layer = (1 << 20) - 1; group->preview = NULL; -- cgit v1.2.3 From e2b1c70b487aa61f59d57fbde61df0ce30aded20 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 1 Jun 2017 15:04:22 +1000 Subject: Fix bad index use drawing deformed face centers --- source/blender/blenkernel/intern/editderivedmesh.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index 5591ee2a0d4..4a45bf1534c 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -149,6 +149,8 @@ static void emDM_ensurePolyCenters(EditDerivedBMesh *bmdm) const float (*vertexCos)[3]; vertexCos = bmdm->vertexCos; + BM_mesh_elem_index_ensure(bm, BM_VERT); + BM_ITER_MESH_INDEX (efa, &fiter, bm, BM_FACES_OF_MESH, i) { BM_face_calc_center_mean_vcos(bm, efa, polyCos[i], vertexCos); } -- cgit v1.2.3 From 528ae8885ebb8a2eebbc6726af3950ca4db38665 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 1 Jun 2017 12:18:57 +0200 Subject: Fix T51687: GPUmat evaluation of shader tree would crash uppon unknown/unsupported socket types. Made this resilient to unknown types, for now. Supporting specific INT sockets (through implicit conversion to GPU_FLOAT ones) is considered nice TODO. --- source/blender/nodes/intern/node_exec.c | 3 +- source/blender/nodes/shader/node_shader_util.c | 52 ++++++++++++++++---------- 2 files changed, 34 insertions(+), 21 deletions(-) (limited to 'source') diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c index 2347564c696..0cf131adbdc 100644 --- a/source/blender/nodes/intern/node_exec.c +++ b/source/blender/nodes/intern/node_exec.c @@ -78,7 +78,8 @@ void node_get_stack(bNode *node, bNodeStack *stack, bNodeStack **in, bNodeStack static void node_init_input_index(bNodeSocket *sock, int *index) { - if (sock->link && sock->link->fromsock) { + /* Only consider existing link if from socket is valid! */ + if (sock->link && sock->link->fromsock && sock->link->fromsock->stack_index >= 0) { sock->stack_index = sock->link->fromsock->stack_index; } else { diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c index 9bd43f331fb..5bc97f13b41 100644 --- a/source/blender/nodes/shader/node_shader_util.c +++ b/source/blender/nodes/shader/node_shader_util.c @@ -142,28 +142,40 @@ void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, bNodeStack *ns) { memset(gs, 0, sizeof(*gs)); - nodestack_get_vec(gs->vec, type, ns); - gs->link = ns->data; - - if (type == SOCK_FLOAT) - gs->type = GPU_FLOAT; - else if (type == SOCK_VECTOR) - gs->type = GPU_VEC3; - else if (type == SOCK_RGBA) - gs->type = GPU_VEC4; - else if (type == SOCK_SHADER) - gs->type = GPU_VEC4; - else + if (ns == NULL) { + /* node_get_stack() will generate NULL bNodeStack pointers for unknown/unsuported types of sockets... */ + zero_v4(gs->vec); + gs->link = NULL; gs->type = GPU_NONE; + gs->name = ""; + gs->hasinput = false; + gs->hasoutput = false; + gs->sockettype = type; + } + else { + nodestack_get_vec(gs->vec, type, ns); + gs->link = ns->data; - gs->name = ""; - gs->hasinput = ns->hasinput && ns->data; - /* XXX Commented out the ns->data check here, as it seems it's not always set, - * even though there *is* a valid connection/output... But that might need - * further investigation. - */ - gs->hasoutput = ns->hasoutput /*&& ns->data*/; - gs->sockettype = ns->sockettype; + if (type == SOCK_FLOAT) + gs->type = GPU_FLOAT; + else if (type == SOCK_VECTOR) + gs->type = GPU_VEC3; + else if (type == SOCK_RGBA) + gs->type = GPU_VEC4; + else if (type == SOCK_SHADER) + gs->type = GPU_VEC4; + else + gs->type = GPU_NONE; + + gs->name = ""; + gs->hasinput = ns->hasinput && ns->data; + /* XXX Commented out the ns->data check here, as it seems it's not always set, + * even though there *is* a valid connection/output... But that might need + * further investigation. + */ + gs->hasoutput = ns->hasoutput /*&& ns->data*/; + gs->sockettype = ns->sockettype; + } } void node_data_from_gpu_stack(bNodeStack *ns, GPUNodeStack *gs) -- cgit v1.2.3 From a6bb98aef99d13877f0d4d32bd9c1419e8930619 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 1 Jun 2017 14:49:17 +0200 Subject: Depsgraph: Cleanup, get rid of relation type It was never actually used apart from being stored at a construciton time. This caused some redundancy and ncertanty about which relation type to use during construciton (often existing types were not close enough to particular use case). --- .../intern/builder/deg_builder_relations.cc | 189 +++++++++------------ .../intern/builder/deg_builder_relations.h | 37 ++-- .../intern/builder/deg_builder_relations_rig.cc | 72 ++++---- source/blender/depsgraph/intern/depsgraph.cc | 8 +- source/blender/depsgraph/intern/depsgraph.h | 4 - source/blender/depsgraph/intern/depsgraph_build.cc | 5 - source/blender/depsgraph/intern/depsgraph_types.h | 53 ------ 7 files changed, 135 insertions(+), 233 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index df56ff5897c..7df33e07e49 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -282,7 +282,7 @@ void DepsgraphRelationBuilder::add_time_relation(TimeSourceDepsNode *timesrc, const char *description) { if (timesrc && node_to) { - m_graph->add_new_relation(timesrc, node_to, DEPSREL_TYPE_TIME, description); + m_graph->add_new_relation(timesrc, node_to, description); } else { DEG_DEBUG_PRINTF("add_time_relation(%p = %s, %p = %s, %s) Failed\n", @@ -295,17 +295,16 @@ void DepsgraphRelationBuilder::add_time_relation(TimeSourceDepsNode *timesrc, void DepsgraphRelationBuilder::add_operation_relation( OperationDepsNode *node_from, OperationDepsNode *node_to, - eDepsRelation_Type type, const char *description) { if (node_from && node_to) { - m_graph->add_new_relation(node_from, node_to, type, description); + m_graph->add_new_relation(node_from, node_to, description); } else { - DEG_DEBUG_PRINTF("add_operation_relation(%p = %s, %p = %s, %d, %s) Failed\n", + DEG_DEBUG_PRINTF("add_operation_relation(%p = %s, %p = %s, %s) Failed\n", node_from, (node_from) ? node_from->identifier().c_str() : "", node_to, (node_to) ? node_to->identifier().c_str() : "", - type, description); + description); } } @@ -319,10 +318,10 @@ void DepsgraphRelationBuilder::add_collision_relations(const OperationKey &key, Object *ob1 = collobjs[i]; ComponentKey trf_key(&ob1->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(trf_key, key, DEPSREL_TYPE_STANDARD, name); + add_relation(trf_key, key, name); ComponentKey coll_key(&ob1->id, DEPSNODE_TYPE_GEOMETRY); - add_relation(coll_key, key, DEPSREL_TYPE_STANDARD, name); + add_relation(coll_key, key, name); } if (collobjs) @@ -337,30 +336,30 @@ void DepsgraphRelationBuilder::add_forcefield_relations(const OperationKey &key, for (EffectorCache *eff = (EffectorCache *)effectors->first; eff; eff = eff->next) { if (eff->ob != ob) { ComponentKey eff_key(&eff->ob->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(eff_key, key, DEPSREL_TYPE_STANDARD, name); + add_relation(eff_key, key, name); } if (eff->psys) { if (eff->ob != ob) { ComponentKey eff_key(&eff->ob->id, DEPSNODE_TYPE_EVAL_PARTICLES); - add_relation(eff_key, key, DEPSREL_TYPE_STANDARD, name); + add_relation(eff_key, key, name); /* TODO: remove this when/if EVAL_PARTICLES is sufficient for up to date particles */ ComponentKey mod_key(&eff->ob->id, DEPSNODE_TYPE_GEOMETRY); - add_relation(mod_key, key, DEPSREL_TYPE_STANDARD, name); + add_relation(mod_key, key, name); } else if (eff->psys != psys) { OperationKey eff_key(&eff->ob->id, DEPSNODE_TYPE_EVAL_PARTICLES, DEG_OPCODE_PSYS_EVAL, eff->psys->name); - add_relation(eff_key, key, DEPSREL_TYPE_STANDARD, name); + add_relation(eff_key, key, name); } } if (eff->pd->forcefield == PFIELD_SMOKEFLOW && eff->pd->f_source) { ComponentKey trf_key(&eff->pd->f_source->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(trf_key, key, DEPSREL_TYPE_STANDARD, "Smoke Force Domain"); + add_relation(trf_key, key, "Smoke Force Domain"); ComponentKey eff_key(&eff->pd->f_source->id, DEPSNODE_TYPE_GEOMETRY); - add_relation(eff_key, key, DEPSREL_TYPE_STANDARD, "Smoke Force Domain"); + add_relation(eff_key, key, "Smoke Force Domain"); } if (add_absorption && (eff->pd->flag & PFIELD_VISIBILITY)) { @@ -407,7 +406,6 @@ void DepsgraphRelationBuilder::build_group(Main *bmain, ComponentKey dupli_transform_key(&go->ob->id, DEPSNODE_TYPE_TRANSFORM); add_relation(dupli_transform_key, object_local_transform_key, - DEPSREL_TYPE_TRANSFORM, "Dupligroup"); } group_id->tag |= LIB_TAG_DOIT; @@ -438,7 +436,6 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o /* local -> parent */ add_relation(local_transform_key, parent_transform_key, - DEPSREL_TYPE_COMPONENT_ORDER, "[ObLocal -> ObParent]"); } @@ -476,21 +473,17 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o /* operation order */ add_relation(base_op_key, constraint_key, - DEPSREL_TYPE_COMPONENT_ORDER, "[ObBase-> Constraint Stack]"); add_relation(constraint_key, final_transform_key, - DEPSREL_TYPE_COMPONENT_ORDER, "[ObConstraints -> Done]"); // XXX add_relation(constraint_key, ob_ubereval_key, - DEPSREL_TYPE_COMPONENT_ORDER, "Temp Ubereval"); add_relation(ob_ubereval_key, final_transform_key, - DEPSREL_TYPE_COMPONENT_ORDER, "Temp Ubereval"); } else { @@ -504,12 +497,10 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o */ add_relation(base_op_key, ob_ubereval_key, - DEPSREL_TYPE_COMPONENT_ORDER, "Temp Ubereval"); } add_relation(ob_ubereval_key, final_transform_key, - DEPSREL_TYPE_COMPONENT_ORDER, "Temp Ubereval"); } @@ -522,7 +513,6 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o ComponentKey adt_key(&ob->id, DEPSNODE_TYPE_ANIMATION); add_relation(adt_key, local_transform_key, - DEPSREL_TYPE_OPERATION, "Object Animation"); } @@ -571,7 +561,6 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o ComponentKey key_key(&key->id, DEPSNODE_TYPE_GEOMETRY); add_relation(key_key, geometry_key, - DEPSREL_TYPE_GEOMETRY_EVAL, "Shapekeys"); } } @@ -595,7 +584,7 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o */ ComponentKey ob_pose_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE); ComponentKey proxy_pose_key(&ob->proxy->id, DEPSNODE_TYPE_EVAL_POSE); - add_relation(ob_pose_key, proxy_pose_key, DEPSREL_TYPE_TRANSFORM, "Proxy"); + add_relation(ob_pose_key, proxy_pose_key, "Proxy"); } /* Object dupligroup. */ @@ -619,7 +608,7 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) case PARSKEL: /* Armature Deform (Virtual Modifier) */ { ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(parent_key, ob_key, DEPSREL_TYPE_STANDARD, "Armature Deform Parent"); + add_relation(parent_key, ob_key, "Armature Deform Parent"); break; } @@ -627,7 +616,7 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) case PARVERT3: { ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_GEOMETRY); - add_relation(parent_key, ob_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Vertex Parent"); + add_relation(parent_key, ob_key, "Vertex Parent"); /* XXX not sure what this is for or how you could be done properly - lukas */ OperationDepsNode *parent_node = find_operation_node(parent_key); @@ -636,7 +625,7 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) } ComponentKey transform_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(transform_key, ob_key, DEPSREL_TYPE_TRANSFORM, "Vertex Parent TFM"); + add_relation(transform_key, ob_key, "Vertex Parent TFM"); break; } @@ -650,11 +639,9 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) DEG_OPCODE_TRANSFORM_FINAL); add_relation(parent_bone_key, ob_key, - DEPSREL_TYPE_TRANSFORM, "Bone Parent"); add_relation(parent_transform_key, ob_key, - DEPSREL_TYPE_TRANSFORM, "Armature Parent"); break; } @@ -667,8 +654,8 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); ComponentKey geom_key(&ob->parent->id, DEPSNODE_TYPE_GEOMETRY); - add_relation(parent_key, ob_key, DEPSREL_TYPE_STANDARD, "Lattice Deform Parent"); - add_relation(geom_key, ob_key, DEPSREL_TYPE_STANDARD, "Lattice Deform Parent Geom"); + add_relation(parent_key, ob_key, "Lattice Deform Parent"); + add_relation(geom_key, ob_key, "Lattice Deform Parent Geom"); } else if (ob->parent->type == OB_CURVE) { Curve *cu = (Curve *)ob->parent->data; @@ -676,21 +663,21 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) if (cu->flag & CU_PATH) { /* Follow Path */ ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_GEOMETRY); - add_relation(parent_key, ob_key, DEPSREL_TYPE_TRANSFORM, "Curve Follow Parent"); + add_relation(parent_key, ob_key, "Curve Follow Parent"); ComponentKey transform_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(transform_key, ob_key, DEPSREL_TYPE_TRANSFORM, "Curve Follow TFM"); + add_relation(transform_key, ob_key, "Curve Follow TFM"); } else { /* Standard Parent */ ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(parent_key, ob_key, DEPSREL_TYPE_TRANSFORM, "Curve Parent"); + add_relation(parent_key, ob_key, "Curve Parent"); } } else { /* Standard Parent */ ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(parent_key, ob_key, DEPSREL_TYPE_TRANSFORM, "Parent"); + add_relation(parent_key, ob_key, "Parent"); } break; } @@ -730,7 +717,7 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode if (data->depth_ob) { // DAG_RL_DATA_OB | DAG_RL_OB_OB ComponentKey depth_key(&data->depth_ob->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(depth_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name); + add_relation(depth_key, constraint_op_key, cti->name); } } else if (cti->type == CONSTRAINT_TYPE_OBJECTSOLVER) { @@ -740,23 +727,23 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode if (depends_on_camera && scene->camera) { // DAG_RL_DATA_OB | DAG_RL_OB_OB ComponentKey camera_key(&scene->camera->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(camera_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name); + add_relation(camera_key, constraint_op_key, cti->name); } /* TODO(sergey): This is more a TimeSource -> MovieClip -> Constraint dependency chain. */ TimeSourceKey time_src_key; - add_relation(time_src_key, constraint_op_key, DEPSREL_TYPE_TIME, "[TimeSrc -> Animation]"); + add_relation(time_src_key, constraint_op_key, "[TimeSrc -> Animation]"); } else if (cti->type == CONSTRAINT_TYPE_TRANSFORM_CACHE) { /* TODO(kevin): This is more a TimeSource -> CacheFile -> Constraint dependency chain. */ TimeSourceKey time_src_key; - add_relation(time_src_key, constraint_op_key, DEPSREL_TYPE_TIME, "[TimeSrc -> Animation]"); + add_relation(time_src_key, constraint_op_key, "[TimeSrc -> Animation]"); bTransformCacheConstraint *data = (bTransformCacheConstraint *)con->data; if (data->cache_file) { ComponentKey cache_key(&data->cache_file->id, DEPSNODE_TYPE_CACHE); - add_relation(cache_key, constraint_op_key, DEPSREL_TYPE_CACHE, cti->name); + add_relation(cache_key, constraint_op_key, cti->name); } } else if (cti->get_constraint_targets) { @@ -774,7 +761,7 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode else if (ELEM(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO)) { /* these constraints require path geometry data... */ ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_GEOMETRY); - add_relation(target_key, constraint_op_key, DEPSREL_TYPE_GEOMETRY_EVAL, cti->name); // XXX: type = geom_transform + add_relation(target_key, constraint_op_key, cti->name); // XXX: type = geom_transform // TODO: path dependency } else if ((ct->tar->type == OB_ARMATURE) && (ct->subtarget[0])) { @@ -794,19 +781,19 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode } OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_BONE, ct->subtarget, target_key_opcode); - add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name); + add_relation(target_key, constraint_op_key, cti->name); } else { /* different armature - we can safely use the result of that */ OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_BONE, ct->subtarget, DEG_OPCODE_BONE_DONE); - add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name); + add_relation(target_key, constraint_op_key, cti->name); } } else if (ELEM(ct->tar->type, OB_MESH, OB_LATTICE) && (ct->subtarget[0])) { /* vertex group */ /* NOTE: for now, we don't need to represent vertex groups separately... */ ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_GEOMETRY); - add_relation(target_key, constraint_op_key, DEPSREL_TYPE_GEOMETRY_EVAL, cti->name); + add_relation(target_key, constraint_op_key, cti->name); if (ct->tar->type == OB_MESH) { OperationDepsNode *node2 = find_operation_node(target_key); @@ -818,11 +805,11 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode else if (con->type == CONSTRAINT_TYPE_SHRINKWRAP) { /* Constraints which requires the target object surface. */ ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_GEOMETRY); - add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name); + add_relation(target_key, constraint_op_key, cti->name); /* NOTE: obdata eval now doesn't necessarily depend on the object's transform... */ ComponentKey target_transform_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(target_transform_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name); + add_relation(target_transform_key, constraint_op_key, cti->name); } else { /* standard object relation */ @@ -836,17 +823,17 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode */ if ((ct->tar->type == OB_ARMATURE) && (component_type == DEPSNODE_TYPE_BONE)) { OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); - add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name); + add_relation(target_key, constraint_op_key, cti->name); } else { OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_LOCAL); - add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name); + add_relation(target_key, constraint_op_key, cti->name); } } else { /* normal object dependency */ OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); - add_relation(target_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name); + add_relation(target_key, constraint_op_key, cti->name); } } @@ -861,7 +848,7 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode { /* TODO(sergey): Add used space check. */ ComponentKey target_transform_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(target_transform_key, constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name); + add_relation(target_transform_key, constraint_op_key, cti->name); } } @@ -885,7 +872,7 @@ void DepsgraphRelationBuilder::build_animdata(ID *id) if (adt->action || adt->nla_tracks.first) { /* wire up dependency to time source */ TimeSourceKey time_src_key; - add_relation(time_src_key, adt_key, DEPSREL_TYPE_TIME, "[TimeSrc -> Animation]"); + add_relation(time_src_key, adt_key, "[TimeSrc -> Animation]"); // XXX: Hook up specific update callbacks for special properties which may need it... @@ -947,14 +934,13 @@ void DepsgraphRelationBuilder::build_animdata(ID *id) fcu->array_index); add_relation(prev_driver_key, driver_key, - DEPSREL_TYPE_OPERATION, "[Driver Order]"); } } /* prevent driver from occurring before own animation... */ if (adt->action || adt->nla_tracks.first) { - add_relation(adt_key, driver_key, DEPSREL_TYPE_OPERATION, + add_relation(adt_key, driver_key, "[AnimData Before Drivers]"); } } @@ -975,7 +961,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) /* create dependency between driver and data affected by it */ /* - direct property relationship... */ //RNAPathKey affected_key(id, fcu->rna_path); - //add_relation(driver_key, affected_key, DEPSREL_TYPE_DRIVER, "[Driver -> Data] DepsRel"); + //add_relation(driver_key, affected_key, "[Driver -> Data] DepsRel"); /* driver -> data components (for interleaved evaluation - bones/constraints/modifiers) */ // XXX: this probably should probably be moved out into a separate function @@ -995,7 +981,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) if (pchan) { OperationKey bone_key(id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); - add_relation(driver_key, bone_key, DEPSREL_TYPE_DRIVER, "[Driver -> Bone]"); + add_relation(driver_key, bone_key, "[Driver -> Bone]"); } else { fprintf(stderr, @@ -1022,7 +1008,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) if (pchan) { OperationKey bone_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); - add_relation(driver_key, bone_key, DEPSREL_TYPE_DRIVER, "[Arm Bone -> Driver -> Bone]"); + add_relation(driver_key, bone_key, "[Arm Bone -> Driver -> Bone]"); } } } @@ -1046,7 +1032,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) DEG_OPCODE_GEOMETRY_MODIFIER, modifier_name); if (has_node(modifier_key)) { - add_relation(driver_key, modifier_key, DEPSREL_TYPE_DRIVER, "[Driver -> Modifier]"); + add_relation(driver_key, modifier_key, "[Driver -> Modifier]"); } else { printf("Unexisting driver RNA path: %s\n", rna_path); @@ -1061,21 +1047,21 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) Key *shape_key = (Key *)id; ComponentKey geometry_key(shape_key->from, DEPSNODE_TYPE_GEOMETRY); - add_relation(driver_key, geometry_key, DEPSREL_TYPE_DRIVER, "[Driver -> ShapeKey Geom]"); + add_relation(driver_key, geometry_key, "[Driver -> ShapeKey Geom]"); } else if (strstr(rna_path, "key_blocks[")) { ComponentKey geometry_key(id, DEPSNODE_TYPE_GEOMETRY); - add_relation(driver_key, geometry_key, DEPSREL_TYPE_DRIVER, "[Driver -> ShapeKey Geom]"); + add_relation(driver_key, geometry_key, "[Driver -> ShapeKey Geom]"); } else { if (GS(id->name) == ID_OB) { /* assume that driver affects a transform... */ OperationKey local_transform_key(id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_LOCAL); - add_relation(driver_key, local_transform_key, DEPSREL_TYPE_OPERATION, "[Driver -> Transform]"); + add_relation(driver_key, local_transform_key, "[Driver -> Transform]"); } else if (GS(id->name) == ID_KE) { ComponentKey geometry_key(id, DEPSNODE_TYPE_GEOMETRY); - add_relation(driver_key, geometry_key, DEPSREL_TYPE_GEOMETRY_EVAL, "[Driver -> Shapekey Geometry]"); + add_relation(driver_key, geometry_key, "[Driver -> Shapekey Geometry]"); } } @@ -1109,13 +1095,13 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) continue; } OperationKey target_key(dtar->id, DEPSNODE_TYPE_BONE, target_pchan->name, DEG_OPCODE_BONE_DONE); - add_relation(target_key, driver_key, DEPSREL_TYPE_DRIVER_TARGET, "[Bone Target -> Driver]"); + add_relation(target_key, driver_key, "[Bone Target -> Driver]"); } } else if (dtar->flag & DTAR_FLAG_STRUCT_REF) { /* get node associated with the object's transforms */ OperationKey target_key(dtar->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); - add_relation(target_key, driver_key, DEPSREL_TYPE_DRIVER_TARGET, "[Target -> Driver]"); + add_relation(target_key, driver_key, "[Target -> Driver]"); } else if (dtar->rna_path && strstr(dtar->rna_path, "pose.bones[")) { /* workaround for ensuring that local bone transforms don't end up @@ -1136,7 +1122,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) continue; } OperationKey bone_key(dtar->id, DEPSNODE_TYPE_BONE, target_pchan->name, DEG_OPCODE_BONE_LOCAL); - add_relation(bone_key, driver_key, DEPSREL_TYPE_DRIVER, "[RNA Bone -> Driver]"); + add_relation(bone_key, driver_key, "[RNA Bone -> Driver]"); } } else { @@ -1148,7 +1134,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) } /* resolve path to get node */ RNAPathKey target_key(dtar->id, dtar->rna_path ? dtar->rna_path : ""); - add_relation(target_key, driver_key, DEPSREL_TYPE_DRIVER_TARGET, "[RNA Target -> Driver]"); + add_relation(target_key, driver_key, "[RNA Target -> Driver]"); } } DRIVER_TARGETS_LOOPER_END @@ -1162,7 +1148,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) python_driver_depends_on_time(driver)) { TimeSourceKey time_src_key; - add_relation(time_src_key, driver_key, DEPSREL_TYPE_TIME, "[TimeSrc -> Driver]"); + add_relation(time_src_key, driver_key, "[TimeSrc -> Driver]"); } } @@ -1187,7 +1173,7 @@ void DepsgraphRelationBuilder::build_world(World *world) ComponentKey ntree_key(&world->nodetree->id, DEPSNODE_TYPE_PARAMETERS); ComponentKey world_key(world_id, DEPSNODE_TYPE_PARAMETERS); add_relation(ntree_key, world_key, - DEPSREL_TYPE_COMPONENT_ORDER, "NTree->World Parameters"); + "NTree->World Parameters"); } } @@ -1199,7 +1185,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) OperationKey sim_key(&scene->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_RIGIDBODY_SIM); /* rel between the two sim-nodes */ - add_relation(init_key, sim_key, DEPSREL_TYPE_OPERATION, "Rigidbody [Init -> SimStep]"); + add_relation(init_key, sim_key, "Rigidbody [Init -> SimStep]"); /* set up dependencies between these operations and other builtin nodes --------------- */ @@ -1207,7 +1193,6 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) TimeSourceKey time_src_key; add_relation(time_src_key, init_key, - DEPSREL_TYPE_TIME, "TimeSrc -> Rigidbody Reset/Rebuild (Optional)"); /* objects - simulation participants */ @@ -1231,7 +1216,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) eDepsOperation_Code trans_opcode = ob->parent ? DEG_OPCODE_TRANSFORM_PARENT : DEG_OPCODE_TRANSFORM_LOCAL; OperationKey trans_op(&ob->id, DEPSNODE_TYPE_TRANSFORM, trans_opcode); - add_relation(sim_key, rbo_key, DEPSREL_TYPE_COMPONENT_ORDER, "Rigidbody Sim Eval -> RBO Sync"); + add_relation(sim_key, rbo_key, "Rigidbody Sim Eval -> RBO Sync"); /* if constraints exist, those depend on the result of the rigidbody sim * - This allows constraints to modify the result of the sim (i.e. clamping) @@ -1247,7 +1232,6 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) DEG_OPCODE_TRANSFORM_CONSTRAINTS); add_relation(rbo_key, constraint_key, - DEPSREL_TYPE_COMPONENT_ORDER, "RBO Sync -> Ob Constraints"); } else { @@ -1261,14 +1245,12 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) DEG_OPCODE_OBJECT_UBEREVAL); add_relation(rbo_key, uber_key, - DEPSREL_TYPE_COMPONENT_ORDER, "RBO Sync -> Uber (Temp)"); } /* Needed to get correct base values. */ add_relation(trans_op, sim_key, - DEPSREL_TYPE_OPERATION, "Base Ob Transform -> Rigidbody Sim Eval"); } } @@ -1291,11 +1273,11 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) OperationKey ob2_key(&rbc->ob2->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_RIGIDBODY); /* - constrained-objects sync depends on the constraint-holder */ - add_relation(trans_key, ob1_key, DEPSREL_TYPE_TRANSFORM, "RigidBodyConstraint -> RBC.Object_1"); - add_relation(trans_key, ob2_key, DEPSREL_TYPE_TRANSFORM, "RigidBodyConstraint -> RBC.Object_2"); + add_relation(trans_key, ob1_key, "RigidBodyConstraint -> RBC.Object_1"); + add_relation(trans_key, ob2_key, "RigidBodyConstraint -> RBC.Object_2"); /* - ensure that sim depends on this constraint's transform */ - add_relation(trans_key, sim_key, DEPSREL_TYPE_TRANSFORM, "RigidBodyConstraint Transform -> RB Simulation"); + add_relation(trans_key, sim_key, "RigidBodyConstraint Transform -> RB Simulation"); } } } @@ -1325,7 +1307,6 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) * Hair without dynamics i.e. */ add_relation(time_src_key, psys_key, - DEPSREL_TYPE_TIME, "TimeSrc -> PSys"); /* TODO(sergey): Currently particle update is just a placeholder, @@ -1334,7 +1315,6 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) */ add_relation(psys_key, obdata_ubereval_key, - DEPSREL_TYPE_OPERATION, "PSys -> UberEval"); #if 0 @@ -1388,7 +1368,7 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) if (ruleob) { ComponentKey ruleob_key(&ruleob->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(ruleob_key, psys_key, DEPSREL_TYPE_TRANSFORM, "Boid Rule"); + add_relation(ruleob_key, psys_key, "Boid Rule"); } } } @@ -1398,7 +1378,6 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) ComponentKey dup_ob_key(&part->dup_ob->id, DEPSNODE_TYPE_TRANSFORM); add_relation(dup_ob_key, psys_key, - DEPSREL_TYPE_TRANSFORM, "Particle Object Visualization"); } } @@ -1412,7 +1391,6 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) ComponentKey transform_key(&ob->id, DEPSNODE_TYPE_TRANSFORM); add_relation(transform_key, obdata_ubereval_key, - DEPSREL_TYPE_GEOMETRY_EVAL, "Partcile Eval"); /* pointcache */ @@ -1434,7 +1412,6 @@ void DepsgraphRelationBuilder::build_cloth(Scene * /*scene*/, md->name); add_relation(cache_key, modifier_key, - DEPSREL_TYPE_TIME, "Cloth Cache -> Cloth"); } @@ -1450,7 +1427,7 @@ void DepsgraphRelationBuilder::build_shapekeys(ID *obdata, Key *key) // TODO: this should really be handled in build_animdata, since many of these cases will need it if (key->adt->action || key->adt->nla_tracks.first) { ComponentKey adt_key(&key->id, DEPSNODE_TYPE_ANIMATION); - add_relation(adt_key, obdata_key, DEPSREL_TYPE_OPERATION, "Animation"); + add_relation(adt_key, obdata_key, "Animation"); } /* NOTE: individual shapekey drivers are handled above already */ @@ -1459,7 +1436,7 @@ void DepsgraphRelationBuilder::build_shapekeys(ID *obdata, Key *key) /* attach to geometry */ // XXX: aren't shapekeys now done as a pseudo-modifier on object? //ComponentKey key_key(&key->id, DEPSNODE_TYPE_GEOMETRY); // FIXME: this doesn't exist - //add_relation(key_key, obdata_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Shapekeys"); + //add_relation(key_key, obdata_key, "Shapekeys"); } /** @@ -1494,7 +1471,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje ComponentKey geom_key(&ob->id, DEPSNODE_TYPE_GEOMETRY); /* link components to each other */ - add_relation(obdata_geom_key, geom_key, DEPSREL_TYPE_DATABLOCK, "Object Geometry Base Data"); + add_relation(obdata_geom_key, geom_key, "Object Geometry Base Data"); /* Modifiers */ if (ob->modifiers.first) { @@ -1506,11 +1483,11 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje if (md->prev) { /* Stack relation: modifier depends on previous modifier in the stack */ - add_relation(prev_mod_key, mod_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Modifier Stack"); + add_relation(prev_mod_key, mod_key, "Modifier Stack"); } else { /* Stack relation: first modifier depends on the geometry. */ - add_relation(geom_init_key, mod_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Modifier Stack"); + add_relation(geom_init_key, mod_key, "Modifier Stack"); } if (mti->updateDepsgraph) { @@ -1525,7 +1502,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje if (BKE_object_modifier_use_time(ob, md)) { TimeSourceKey time_src_key; - add_relation(time_src_key, mod_key, DEPSREL_TYPE_TIME, "Time Source"); + add_relation(time_src_key, mod_key, "Time Source"); /* Hacky fix for T45633 (Animated modifiers aren't updated) * @@ -1535,7 +1512,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje /* XXX: Remove this hack when these links are added as part of build_animdata() instead */ if (modifier_dependsOnTime(md) == false && needs_animdata_node(&ob->id)) { ComponentKey animation_key(&ob->id, DEPSNODE_TYPE_ANIMATION); - add_relation(animation_key, mod_key, DEPSREL_TYPE_OPERATION, "Modifier Animation"); + add_relation(animation_key, mod_key, "Modifier Animation"); } } @@ -1572,10 +1549,10 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje if (ob->modifiers.last) { ModifierData *md = (ModifierData *)ob->modifiers.last; OperationKey mod_key(&ob->id, DEPSNODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_MODIFIER, md->name); - add_relation(mod_key, obdata_ubereval_key, DEPSREL_TYPE_OPERATION, "Object Geometry UberEval"); + add_relation(mod_key, obdata_ubereval_key, "Object Geometry UberEval"); } else { - add_relation(geom_init_key, obdata_ubereval_key, DEPSREL_TYPE_OPERATION, "Object Geometry UberEval"); + add_relation(geom_init_key, obdata_ubereval_key, "Object Geometry UberEval"); } } @@ -1587,7 +1564,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje /* Link object data evaluation node to exit operation. */ OperationKey obdata_geom_eval_key(obdata, DEPSNODE_TYPE_GEOMETRY, DEG_OPCODE_PLACEHOLDER, "Geometry Eval"); OperationKey obdata_geom_done_key(obdata, DEPSNODE_TYPE_GEOMETRY, DEG_OPCODE_PLACEHOLDER, "Eval Done"); - add_relation(obdata_geom_eval_key, obdata_geom_done_key, DEPSREL_TYPE_DATABLOCK, "ObData Geom Eval Done"); + add_relation(obdata_geom_eval_key, obdata_geom_done_key, "ObData Geom Eval Done"); /* type-specific node/links */ switch (ob->type) { @@ -1603,8 +1580,8 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje /* non-motherball -> cannot be directly evaluated! */ ComponentKey mom_key(&mom->id, DEPSNODE_TYPE_GEOMETRY); ComponentKey transform_key(&ob->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(geom_key, mom_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Metaball Motherball"); - add_relation(transform_key, mom_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Metaball Motherball"); + add_relation(geom_key, mom_key, "Metaball Motherball"); + add_relation(transform_key, mom_key, "Metaball Motherball"); } break; } @@ -1619,18 +1596,18 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje if (cu->bevobj) { ComponentKey bevob_key(&cu->bevobj->id, DEPSNODE_TYPE_GEOMETRY); build_object(bmain, scene, cu->bevobj); - add_relation(bevob_key, geom_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Curve Bevel"); + add_relation(bevob_key, geom_key, "Curve Bevel"); } if (cu->taperobj) { ComponentKey taperob_key(&cu->taperobj->id, DEPSNODE_TYPE_GEOMETRY); build_object(bmain, scene, cu->taperobj); - add_relation(taperob_key, geom_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Curve Taper"); + add_relation(taperob_key, geom_key, "Curve Taper"); } if (ob->type == OB_FONT) { if (cu->textoncurve) { ComponentKey textoncurve_key(&cu->textoncurve->id, DEPSNODE_TYPE_GEOMETRY); build_object(bmain, scene, cu->textoncurve); - add_relation(textoncurve_key, geom_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Text on Curve"); + add_relation(textoncurve_key, geom_key, "Text on Curve"); } } break; @@ -1657,11 +1634,11 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje ComponentKey animation_key(obdata, DEPSNODE_TYPE_ANIMATION); ComponentKey parameters_key(obdata, DEPSNODE_TYPE_PARAMETERS); add_relation(animation_key, parameters_key, - DEPSREL_TYPE_COMPONENT_ORDER, "Geom Parameters"); + "Geom Parameters"); /* Evaluation usually depends on animation. * TODO(sergey): Need to re-hook it after granular update is implemented.. */ - add_relation(animation_key, obdata_geom_eval_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Animation"); + add_relation(animation_key, obdata_geom_eval_key, "Animation"); } } @@ -1681,14 +1658,14 @@ void DepsgraphRelationBuilder::build_camera(Object *ob) if (needs_animdata_node(camera_id)) { ComponentKey animation_key(camera_id, DEPSNODE_TYPE_ANIMATION); add_relation(animation_key, parameters_key, - DEPSREL_TYPE_COMPONENT_ORDER, "Camera Parameters"); + "Camera Parameters"); } /* DOF */ if (cam->dof_ob) { ComponentKey ob_param_key(&ob->id, DEPSNODE_TYPE_PARAMETERS); ComponentKey dof_ob_key(&cam->dof_ob->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(dof_ob_key, ob_param_key, DEPSREL_TYPE_TRANSFORM, "Camera DOF"); + add_relation(dof_ob_key, ob_param_key, "Camera DOF"); } } @@ -1707,7 +1684,7 @@ void DepsgraphRelationBuilder::build_lamp(Object *ob) if (needs_animdata_node(lamp_id)) { ComponentKey animation_key(lamp_id, DEPSNODE_TYPE_ANIMATION); add_relation(animation_key, parameters_key, - DEPSREL_TYPE_COMPONENT_ORDER, "Lamp Parameters"); + "Lamp Parameters"); } /* lamp's nodetree */ @@ -1715,7 +1692,7 @@ void DepsgraphRelationBuilder::build_lamp(Object *ob) build_nodetree(la->nodetree); ComponentKey nodetree_key(&la->nodetree->id, DEPSNODE_TYPE_PARAMETERS); add_relation(nodetree_key, parameters_key, - DEPSREL_TYPE_COMPONENT_ORDER, "NTree->Lamp Parameters"); + "NTree->Lamp Parameters"); } /* textures */ @@ -1756,7 +1733,7 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); add_relation(group_parameters_key, parameters_key, - DEPSREL_TYPE_COMPONENT_ORDER, "Group Node"); + "Group Node"); } } } @@ -1764,7 +1741,7 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) if (needs_animdata_node(ntree_id)) { ComponentKey animation_key(ntree_id, DEPSNODE_TYPE_ANIMATION); add_relation(animation_key, parameters_key, - DEPSREL_TYPE_COMPONENT_ORDER, "NTree Parameters"); + "NTree Parameters"); } } @@ -1795,7 +1772,7 @@ void DepsgraphRelationBuilder::build_material(Material *ma) DEG_OPCODE_PLACEHOLDER, "Material Update"); add_relation(ntree_key, material_key, - DEPSREL_TYPE_UPDATE, "Material's NTree"); + "Material's NTree"); } } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index 4ca95bebe3f..ace629e471d 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -177,19 +177,16 @@ struct DepsgraphRelationBuilder template void add_relation(const KeyFrom& key_from, const KeyTo& key_to, - eDepsRelation_Type type, const char *description); template void add_relation(const TimeSourceKey& key_from, const KeyTo& key_to, - eDepsRelation_Type type, const char *description); template void add_node_handle_relation(const KeyType& key_from, const DepsNodeHandle *handle, - eDepsRelation_Type type, const char *description); void build_scene(Main *bmain, Scene *scene); @@ -250,7 +247,6 @@ protected: const char *description); void add_operation_relation(OperationDepsNode *node_from, OperationDepsNode *node_to, - eDepsRelation_Type type, const char *description); template @@ -290,7 +286,6 @@ OperationDepsNode *DepsgraphRelationBuilder::find_operation_node(const KeyType& template void DepsgraphRelationBuilder::add_relation(const KeyFrom &key_from, const KeyTo &key_to, - eDepsRelation_Type type, const char *description) { DepsNode *node_from = find_node(key_from); @@ -298,27 +293,27 @@ void DepsgraphRelationBuilder::add_relation(const KeyFrom &key_from, OperationDepsNode *op_from = node_from ? node_from->get_exit_operation() : NULL; OperationDepsNode *op_to = node_to ? node_to->get_entry_operation() : NULL; if (op_from && op_to) { - add_operation_relation(op_from, op_to, type, description); + add_operation_relation(op_from, op_to, description); } else { if (!op_from) { /* XXX TODO handle as error or report if needed */ node_from = find_node(key_from); - fprintf(stderr, "add_relation(%d, %s) - Could not find op_from (%s)\n", - type, description, key_from.identifier().c_str()); + fprintf(stderr, "add_relation(%s) - Could not find op_from (%s)\n", + description, key_from.identifier().c_str()); } else { - fprintf(stderr, "add_relation(%d, %s) - Failed, but op_from (%s) was ok\n", - type, description, key_from.identifier().c_str()); + fprintf(stderr, "add_relation(%s) - Failed, but op_from (%s) was ok\n", + description, key_from.identifier().c_str()); } if (!op_to) { /* XXX TODO handle as error or report if needed */ - fprintf(stderr, "add_relation(%d, %s) - Could not find op_to (%s)\n", - type, description, key_to.identifier().c_str()); + fprintf(stderr, "add_relation(%s) - Could not find op_to (%s)\n", + description, key_to.identifier().c_str()); } else { - fprintf(stderr, "add_relation(%d, %s) - Failed, but op_to (%s) was ok\n", - type, description, key_to.identifier().c_str()); + fprintf(stderr, "add_relation(%s) - Failed, but op_to (%s) was ok\n", + description, key_to.identifier().c_str()); } } } @@ -326,11 +321,8 @@ void DepsgraphRelationBuilder::add_relation(const KeyFrom &key_from, template void DepsgraphRelationBuilder::add_relation(const TimeSourceKey &key_from, const KeyTo &key_to, - eDepsRelation_Type type, const char *description) { - (void)type; /* Ignored in release builds. */ - BLI_assert(type == DEPSREL_TYPE_TIME); TimeSourceDepsNode *time_from = find_node(key_from); DepsNode *node_to = find_node(key_to); OperationDepsNode *op_to = node_to ? node_to->get_entry_operation() : NULL; @@ -345,23 +337,22 @@ template void DepsgraphRelationBuilder::add_node_handle_relation( const KeyType &key_from, const DepsNodeHandle *handle, - eDepsRelation_Type type, const char *description) { DepsNode *node_from = find_node(key_from); OperationDepsNode *op_from = node_from ? node_from->get_exit_operation() : NULL; OperationDepsNode *op_to = handle->node->get_entry_operation(); if (op_from && op_to) { - add_operation_relation(op_from, op_to, type, description); + add_operation_relation(op_from, op_to, description); } else { if (!op_from) { - fprintf(stderr, "add_node_handle_relation(%d, %s) - Could not find op_from (%s)\n", - type, description, key_from.identifier().c_str()); + fprintf(stderr, "add_node_handle_relation(%s) - Could not find op_from (%s)\n", + description, key_from.identifier().c_str()); } if (!op_to) { - fprintf(stderr, "add_node_handle_relation(%d, %s) - Could not find op_to (%s)\n", - type, description, key_from.identifier().c_str()); + fprintf(stderr, "add_node_handle_relation(%s) - Could not find op_to (%s)\n", + description, key_from.identifier().c_str()); } } } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc index 2b4c000f483..df1d19e59dc 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -102,19 +102,19 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, if (data->tar != ob) { /* different armature - can just read the results */ ComponentKey target_key(&data->tar->id, DEPSNODE_TYPE_BONE, data->subtarget); - add_relation(target_key, pose_key, DEPSREL_TYPE_TRANSFORM, con->name); + add_relation(target_key, pose_key, con->name); } else { /* same armature - we'll use the ready state only, just in case this bone is in the chain we're solving */ OperationKey target_key(&data->tar->id, DEPSNODE_TYPE_BONE, data->subtarget, DEG_OPCODE_BONE_DONE); - add_relation(target_key, solver_key, DEPSREL_TYPE_TRANSFORM, con->name); + add_relation(target_key, solver_key, con->name); } } else if (ELEM(data->tar->type, OB_MESH, OB_LATTICE) && (data->subtarget[0])) { /* vertex group target */ /* NOTE: for now, we don't need to represent vertex groups separately... */ ComponentKey target_key(&data->tar->id, DEPSNODE_TYPE_GEOMETRY); - add_relation(target_key, solver_key, DEPSREL_TYPE_GEOMETRY_EVAL, con->name); + add_relation(target_key, solver_key, con->name); if (data->tar->type == OB_MESH) { OperationDepsNode *node2 = find_operation_node(target_key); @@ -126,7 +126,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, else { /* Standard Object Target */ ComponentKey target_key(&data->tar->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(target_key, pose_key, DEPSREL_TYPE_TRANSFORM, con->name); + add_relation(target_key, pose_key, con->name); } if ((data->tar == ob) && (data->subtarget[0])) { @@ -143,13 +143,13 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, if ((data->poletar->type == OB_ARMATURE) && (data->polesubtarget[0])) { // XXX: same armature issues - ready vs done? ComponentKey target_key(&data->poletar->id, DEPSNODE_TYPE_BONE, data->polesubtarget); - add_relation(target_key, solver_key, DEPSREL_TYPE_TRANSFORM, con->name); + add_relation(target_key, solver_key, con->name); } else if (ELEM(data->poletar->type, OB_MESH, OB_LATTICE) && (data->polesubtarget[0])) { /* vertex group target */ /* NOTE: for now, we don't need to represent vertex groups separately... */ ComponentKey target_key(&data->poletar->id, DEPSNODE_TYPE_GEOMETRY); - add_relation(target_key, solver_key, DEPSREL_TYPE_GEOMETRY_EVAL, con->name); + add_relation(target_key, solver_key, con->name); if (data->poletar->type == OB_MESH) { OperationDepsNode *node2 = find_operation_node(target_key); @@ -160,7 +160,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, } else { ComponentKey target_key(&data->poletar->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(target_key, solver_key, DEPSREL_TYPE_TRANSFORM, con->name); + add_relation(target_key, solver_key, con->name); } } @@ -173,7 +173,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, OperationKey tip_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_LOCAL); add_relation(solver_key, tip_transforms_key, - DEPSREL_TYPE_TRANSFORM, "IK Solver Result"); + "IK Solver Result"); parchan = pchan->parent; } @@ -182,7 +182,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, OperationKey parchan_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_READY); add_relation(parchan_transforms_key, solver_key, - DEPSREL_TYPE_TRANSFORM, "IK Solver Owner"); + "IK Solver Owner"); /* Walk to the chain's root */ //size_t segcount = 0; @@ -197,14 +197,14 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, */ if (parchan != pchan) { OperationKey parent_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_READY); - add_relation(parent_key, solver_key, DEPSREL_TYPE_TRANSFORM, "IK Chain Parent"); + add_relation(parent_key, solver_key, "IK Chain Parent"); OperationKey done_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); - add_relation(solver_key, done_key, DEPSREL_TYPE_TRANSFORM, "IK Chain Result"); + add_relation(solver_key, done_key, "IK Chain Result"); } else { OperationKey final_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); - add_relation(solver_key, final_transforms_key, DEPSREL_TYPE_TRANSFORM, "IK Solver Result"); + add_relation(solver_key, final_transforms_key, "IK Solver Result"); } parchan->flag |= POSE_DONE; @@ -220,7 +220,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, } OperationKey flush_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); - add_relation(solver_key, flush_key, DEPSREL_TYPE_OPERATION, "PoseEval Result-Bone Link"); + add_relation(solver_key, flush_key, "PoseEval Result-Bone Link"); } /* Spline IK Eval Steps */ @@ -238,7 +238,7 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *ob, * - assume that owner is always part of chain * - see notes on direction of rel below... */ - add_relation(transforms_key, solver_key, DEPSREL_TYPE_TRANSFORM, "Spline IK Solver Owner"); + add_relation(transforms_key, solver_key, "Spline IK Solver Owner"); /* attach path dependency to solver */ if (data->tar) { @@ -249,12 +249,12 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *ob, // TODO: the bigggest point here is that we need the curve PATH and not just the general geometry... ComponentKey target_key(&data->tar->id, DEPSNODE_TYPE_GEOMETRY); ComponentKey pose_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE); - add_relation(target_key, pose_key, DEPSREL_TYPE_TRANSFORM, "[Curve.Path -> Spline IK] DepsRel"); + add_relation(target_key, pose_key, "[Curve.Path -> Spline IK] DepsRel"); } pchan->flag |= POSE_DONE; OperationKey final_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE); - add_relation(solver_key, final_transforms_key, DEPSREL_TYPE_TRANSFORM, "Spline IK Result"); + add_relation(solver_key, final_transforms_key, "Spline IK Result"); root_map->add_bone(pchan->name, rootchan->name); @@ -271,15 +271,15 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *ob, */ if (parchan != pchan) { OperationKey parent_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_READY); - add_relation(parent_key, solver_key, DEPSREL_TYPE_TRANSFORM, "Spline IK Solver Update"); + add_relation(parent_key, solver_key, "Spline IK Solver Update"); OperationKey done_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); - add_relation(solver_key, done_key, DEPSREL_TYPE_TRANSFORM, "IK Chain Result"); + add_relation(solver_key, done_key, "IK Chain Result"); } parchan->flag |= POSE_DONE; OperationKey final_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); - add_relation(solver_key, final_transforms_key, DEPSREL_TYPE_TRANSFORM, "Spline IK Solver Result"); + add_relation(solver_key, final_transforms_key, "Spline IK Solver Result"); root_map->add_bone(parchan->name, rootchan->name); @@ -289,7 +289,7 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *ob, } OperationKey flush_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); - add_relation(solver_key, flush_key, DEPSREL_TYPE_OPERATION, "PoseEval Result-Bone Link"); + add_relation(solver_key, flush_key, "PoseEval Result-Bone Link"); } /* Pose/Armature Bones Graph */ @@ -304,18 +304,18 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob) OperationKey init_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT); OperationKey flush_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); - add_relation(init_key, flush_key, DEPSREL_TYPE_COMPONENT_ORDER, "[Pose Init -> Pose Cleanup]"); + add_relation(init_key, flush_key, "[Pose Init -> Pose Cleanup]"); /* Make sure pose is up-to-date with armature updates. */ OperationKey armature_key(&arm->id, DEPSNODE_TYPE_PARAMETERS, DEG_OPCODE_PLACEHOLDER, "Armature Eval"); - add_relation(armature_key, init_key, DEPSREL_TYPE_COMPONENT_ORDER, "Data dependency"); + add_relation(armature_key, init_key, "Data dependency"); if (needs_animdata_node(&ob->id)) { ComponentKey animation_key(&ob->id, DEPSNODE_TYPE_ANIMATION); - add_relation(animation_key, init_key, DEPSREL_TYPE_OPERATION, "Rig Animation"); + add_relation(animation_key, init_key, "Rig Animation"); } /* IK Solvers... @@ -372,7 +372,7 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob) */ ComponentKey pose_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE); ComponentKey local_transform_key(&ob->id, DEPSNODE_TYPE_TRANSFORM); - add_relation(local_transform_key, pose_key, DEPSREL_TYPE_TRANSFORM, "Local Transforms"); + add_relation(local_transform_key, pose_key, "Local Transforms"); } @@ -386,10 +386,10 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob) pchan->flag &= ~POSE_DONE; /* pose init to bone local */ - add_relation(init_key, bone_local_key, DEPSREL_TYPE_OPERATION, "PoseEval Source-Bone Link"); + add_relation(init_key, bone_local_key, "PoseEval Source-Bone Link"); /* local to pose parenting operation */ - add_relation(bone_local_key, bone_pose_key, DEPSREL_TYPE_OPERATION, "Bone Local - PoseSpace Link"); + add_relation(bone_local_key, bone_pose_key, "Bone Local - PoseSpace Link"); /* parent relation */ if (pchan->parent != NULL) { @@ -404,7 +404,7 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob) } OperationKey parent_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->parent->name, parent_key_opcode); - add_relation(parent_key, bone_pose_key, DEPSREL_TYPE_TRANSFORM, "[Parent Bone -> Child Bone]"); + add_relation(parent_key, bone_pose_key, "[Parent Bone -> Child Bone]"); } /* constraints */ @@ -414,15 +414,15 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob) /* pose -> constraints */ OperationKey constraints_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_CONSTRAINTS); - add_relation(bone_pose_key, constraints_key, DEPSREL_TYPE_OPERATION, "Constraints Stack"); + add_relation(bone_pose_key, constraints_key, "Constraints Stack"); /* constraints -> ready */ // TODO: when constraint stack is exploded, this step should occur before the first IK solver - add_relation(constraints_key, bone_ready_key, DEPSREL_TYPE_OPERATION, "Constraints -> Ready"); + add_relation(constraints_key, bone_ready_key, "Constraints -> Ready"); } else { /* pose -> ready */ - add_relation(bone_pose_key, bone_ready_key, DEPSREL_TYPE_OPERATION, "Pose -> Ready"); + add_relation(bone_pose_key, bone_ready_key, "Pose -> Ready"); } /* bone ready -> done @@ -430,10 +430,10 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob) * For IK chains however, an additional rel is created from IK to done, * with transitive reduction removing this one... */ - add_relation(bone_ready_key, bone_done_key, DEPSREL_TYPE_OPERATION, "Ready -> Done"); + add_relation(bone_ready_key, bone_done_key, "Ready -> Done"); /* assume that all bones must be done for the pose to be ready (for deformers) */ - add_relation(bone_done_key, flush_key, DEPSREL_TYPE_OPERATION, "PoseEval Result-Bone Link"); + add_relation(bone_done_key, flush_key, "PoseEval Result-Bone Link"); } } @@ -445,10 +445,10 @@ void DepsgraphRelationBuilder::build_proxy_rig(Object *ob) OperationKey bone_local_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); OperationKey bone_ready_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY); OperationKey bone_done_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE); - add_relation(pose_init_key, bone_local_key, DEPSREL_TYPE_OPERATION, "Pose Init -> Bone Local"); - add_relation(bone_local_key, bone_ready_key, DEPSREL_TYPE_OPERATION, "Local -> Ready"); - add_relation(bone_ready_key, bone_done_key, DEPSREL_TYPE_OPERATION, "Ready -> Done"); - add_relation(bone_done_key, pose_done_key, DEPSREL_TYPE_OPERATION, "Bone Done -> Pose Done"); + add_relation(pose_init_key, bone_local_key, "Pose Init -> Bone Local"); + add_relation(bone_local_key, bone_ready_key, "Local -> Ready"); + add_relation(bone_ready_key, bone_done_key, "Ready -> Done"); + add_relation(bone_done_key, pose_done_key, "Bone Done -> Pose Done"); } } diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 5604044e123..c3e9ad5a475 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -367,11 +367,10 @@ void Depsgraph::clear_id_nodes() /* Add new relationship between two nodes. */ DepsRelation *Depsgraph::add_new_relation(OperationDepsNode *from, OperationDepsNode *to, - eDepsRelation_Type type, const char *description) { /* Create new relation, and add it to the graph. */ - DepsRelation *rel = OBJECT_GUARDED_NEW(DepsRelation, from, to, type, description); + DepsRelation *rel = OBJECT_GUARDED_NEW(DepsRelation, from, to, description); /* TODO(sergey): Find a better place for this. */ #ifdef WITH_OPENSUBDIV ComponentDepsNode *comp_node = from->owner; @@ -391,11 +390,10 @@ DepsRelation *Depsgraph::add_new_relation(OperationDepsNode *from, /* Add new relation between two nodes */ DepsRelation *Depsgraph::add_new_relation(DepsNode *from, DepsNode *to, - eDepsRelation_Type type, const char *description) { /* Create new relation, and add it to the graph. */ - DepsRelation *rel = OBJECT_GUARDED_NEW(DepsRelation, from, to, type, description); + DepsRelation *rel = OBJECT_GUARDED_NEW(DepsRelation, from, to, description); return rel; } @@ -404,12 +402,10 @@ DepsRelation *Depsgraph::add_new_relation(DepsNode *from, DepsNode *to, DepsRelation::DepsRelation(DepsNode *from, DepsNode *to, - eDepsRelation_Type type, const char *description) : from(from), to(to), name(description), - type(type), flag(0) { #ifndef NDEBUG diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h index e668facd645..eefae4133f9 100644 --- a/source/blender/depsgraph/intern/depsgraph.h +++ b/source/blender/depsgraph/intern/depsgraph.h @@ -79,12 +79,10 @@ struct DepsRelation { /* relationship attributes */ const char *name; /* label for debugging */ - eDepsRelation_Type type; /* type */ int flag; /* (eDepsRelation_Flag) */ DepsRelation(DepsNode *from, DepsNode *to, - eDepsRelation_Type type, const char *description); ~DepsRelation(); @@ -127,12 +125,10 @@ struct Depsgraph { /* Add new relationship between two nodes. */ DepsRelation *add_new_relation(OperationDepsNode *from, OperationDepsNode *to, - eDepsRelation_Type type, const char *description); DepsRelation *add_new_relation(DepsNode *from, DepsNode *to, - eDepsRelation_Type type, const char *description); /* Tag a specific node as needing updates. */ diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 3a69469053c..aa9a2aebd30 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -121,7 +121,6 @@ void DEG_add_scene_relation(DepsNodeHandle *handle, DEG::DepsNodeHandle *deg_handle = get_handle(handle); deg_handle->builder->add_node_handle_relation(comp_key, deg_handle, - DEG::DEPSREL_TYPE_GEOMETRY_EVAL, description); } @@ -135,7 +134,6 @@ void DEG_add_object_relation(DepsNodeHandle *handle, DEG::DepsNodeHandle *deg_handle = get_handle(handle); deg_handle->builder->add_node_handle_relation(comp_key, deg_handle, - DEG::DEPSREL_TYPE_GEOMETRY_EVAL, description); } @@ -149,7 +147,6 @@ void DEG_add_object_cache_relation(DepsNodeHandle *handle, DEG::DepsNodeHandle *deg_handle = get_handle(handle); deg_handle->builder->add_node_handle_relation(comp_key, deg_handle, - DEG::DEPSREL_TYPE_CACHE, description); } @@ -167,7 +164,6 @@ void DEG_add_bone_relation(DepsNodeHandle *handle, */ deg_handle->builder->add_node_handle_relation(comp_key, deg_handle, - DEG::DEPSREL_TYPE_GEOMETRY_EVAL, description); } @@ -226,7 +222,6 @@ void DEG_graph_build_from_scene(Depsgraph *graph, Main *bmain, Scene *scene) #if 0 relation_builder.add_relation(RootKey(), IDKey(scene), - DEPSREL_TYPE_ROOT_TO_ACTIVE, "Root to Active Scene"); #endif relation_builder.build_scene(bmain, scene); diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h index c9c4329769d..d03d598084e 100644 --- a/source/blender/depsgraph/intern/depsgraph_types.h +++ b/source/blender/depsgraph/intern/depsgraph_types.h @@ -284,57 +284,4 @@ typedef enum eDepsOperation_Type { DEPSOP_TYPE_REBUILD = 5, } eDepsOperation_Type; -/* Types of relationships between nodes - * - * This is used to provide additional hints to use when filtering - * the graph, so that we can go without doing more extensive - * data-level checks... - */ -typedef enum eDepsRelation_Type { - /* relationship type unknown/irrelevant */ - DEPSREL_TYPE_STANDARD = 0, - - /* root -> active scene or entity (screen, image, etc.) */ - DEPSREL_TYPE_ROOT_TO_ACTIVE, - - /* general datablock dependency */ - DEPSREL_TYPE_DATABLOCK, - - /* time dependency */ - DEPSREL_TYPE_TIME, - - /* component depends on results of another */ - DEPSREL_TYPE_COMPONENT_ORDER, - - /* relationship is just used to enforce ordering of operations - * (e.g. "init()" callback done before "exec() and "cleanup()") - */ - DEPSREL_TYPE_OPERATION, - - /* relationship results from a property driver affecting property */ - DEPSREL_TYPE_DRIVER, - - /* relationship is something driver depends on */ - DEPSREL_TYPE_DRIVER_TARGET, - - /* relationship is used for transform stack - * (e.g. parenting, user transforms, constraints) - */ - DEPSREL_TYPE_TRANSFORM, - - /* relationship is used for geometry evaluation - * (e.g. metaball "motherball" or modifiers) - */ - DEPSREL_TYPE_GEOMETRY_EVAL, - - /* relationship is used to trigger a post-change validity updates */ - DEPSREL_TYPE_UPDATE, - - /* relationship is used to trigger editor/screen updates */ - DEPSREL_TYPE_UPDATE_UI, - - /* cache dependency */ - DEPSREL_TYPE_CACHE, -} eDepsRelation_Type; - } // namespace DEG -- cgit v1.2.3 From a13aa12d7c002ecddc42dcae9135064fe3178b24 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 1 Jun 2017 15:06:05 +0200 Subject: Depsgraph: Remove dead code from add_time_source() This was never finished or done or used, no reason to keep it. Better to simplify things before adding complexity of overrides and copy-on-write. --- .../depsgraph/intern/builder/deg_builder_nodes.cc | 41 +++------------------- .../depsgraph/intern/builder/deg_builder_nodes.h | 2 +- .../intern/builder/deg_builder_nodes_scene.cc | 2 +- 3 files changed, 7 insertions(+), 38 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 49ebdc8b8ac..03e6fa4d9e8 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -170,44 +170,13 @@ IDDepsNode *DepsgraphNodeBuilder::add_id_node(ID *id) return m_graph->add_id_node(id, id->name); } -TimeSourceDepsNode *DepsgraphNodeBuilder::add_time_source(ID *id) +TimeSourceDepsNode *DepsgraphNodeBuilder::add_time_source() { - /* determine which node to attach timesource to */ - if (id) { -#if 0 /* XXX TODO */ - /* get ID node */ - IDDepsNode id_node = m_graph->find_id_node(id); - - /* depends on what this is... */ - switch (GS(id->name)) { - case ID_SCE: /* Scene - Usually sequencer strip causing time remapping... */ - { - // TODO... - } - break; - - case ID_GR: /* Group */ - { - // TODO... - } - break; - - // XXX: time source... - - default: /* Unhandled */ - printf("%s(): Unhandled ID - %s \n", __func__, id->name); - break; - } -#endif + /* root-node */ + RootDepsNode *root_node = m_graph->root_node; + if (root_node != NULL) { + return root_node->add_time_source("Time Source"); } - else { - /* root-node */ - RootDepsNode *root_node = m_graph->root_node; - if (root_node) { - return root_node->add_time_source("Time Source"); - } - } - return NULL; } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 745f8283328..93a8c6c6015 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -76,7 +76,7 @@ struct DepsgraphNodeBuilder { RootDepsNode *add_root_node(); IDDepsNode *add_id_node(ID *id); - TimeSourceDepsNode *add_time_source(ID *id); + TimeSourceDepsNode *add_time_source(); ComponentDepsNode *add_component_node(ID *id, eDepsNode_Type comp_type, diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc index 7dd694cb570..d7ae10421df 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc @@ -69,7 +69,7 @@ void DepsgraphNodeBuilder::build_scene(Main *bmain, Scene *scene) add_id_node(&scene->id); /* timesource */ - add_time_source(NULL); + add_time_source(); /* build subgraph for set, and link this in... */ // XXX: depending on how this goes, that scene itself could probably store its -- cgit v1.2.3 From d492ae8893e6c1aa26bf1fd65ec2f5d76f6f3aa7 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 1 Jun 2017 15:07:47 +0200 Subject: Depsgraph: Remove dead code Was never used or worked on in ages, if any of this code is needed in the future it'll need to be redone anyway. --- .../intern/builder/deg_builder_relations.cc | 28 ---------------------- source/blender/depsgraph/intern/depsgraph.cc | 10 -------- source/blender/depsgraph/intern/depsgraph_build.cc | 5 ---- 3 files changed, 43 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 7df33e07e49..eba4e8907b1 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1317,34 +1317,6 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) obdata_ubereval_key, "PSys -> UberEval"); -#if 0 - if (ELEM(part->phystype, PART_PHYS_KEYED, PART_PHYS_BOIDS)) { - LINKLIST_FOREACH (ParticleTarget *, pt, &psys->targets) { - if (pt->ob && BLI_findlink(&pt->ob->particlesystem, pt->psys - 1)) { - node2 = dag_get_node(dag, pt->ob); - dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Particle Targets"); - } - } - } - - if (part->ren_as == PART_DRAW_OB && part->dup_ob) { - node2 = dag_get_node(dag, part->dup_ob); - /* note that this relation actually runs in the wrong direction, the problem - * is that dupli system all have this (due to parenting), and the render - * engine instancing assumes particular ordering of objects in list */ - dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Object Visualization"); - if (part->dup_ob->type == OB_MBALL) - dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA, "Particle Object Visualization"); - } - - if (part->ren_as == PART_DRAW_GR && part->dup_group) { - LINKLIST_FOREACH (GroupObject *, go, &part->dup_group->gobject) { - node2 = dag_get_node(dag, go->ob); - dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Particle Group Visualization"); - } - } -#endif - /* collisions */ if (part->type != PART_HAIR) { add_collision_relations(psys_key, scene, ob, part->collision_group, ob->lay, true, "Particle Collision"); diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index c3e9ad5a475..8054c33817b 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -302,16 +302,6 @@ SubgraphDepsNode *Depsgraph::add_subgraph_node(const ID *id) /* Add to subnodes list. */ BLI_gset_insert(subgraphs, subgraph_node); - /* if there's an ID associated, add to ID-nodes lookup too */ - if (id) { -#if 0 - /* XXX subgraph node is NOT a true IDDepsNode - what is this supposed to do? */ - // TODO: what to do if subgraph's ID has already been added? - BLI_assert(!graph->find_id_node(id)); - graph->id_hash[id] = this; -#endif - } - return subgraph_node; } diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index aa9a2aebd30..9abdc3cf0eb 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -219,11 +219,6 @@ void DEG_graph_build_from_scene(Depsgraph *graph, Main *bmain, Scene *scene) * scene is to be connected. */ relation_builder.begin_build(bmain); -#if 0 - relation_builder.add_relation(RootKey(), - IDKey(scene), - "Root to Active Scene"); -#endif relation_builder.build_scene(bmain, scene); /* Detect and solve cycles. */ -- cgit v1.2.3 From a4925b05a77974579f1a3b45816a7bd017192204 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 1 Jun 2017 15:14:11 +0200 Subject: Depsgraph: Remove subgraph nodes Those were never finished nor used. Again, starting from clean state before we go into more complicated details. --- .../depsgraph/intern/builder/deg_builder_nodes.cc | 35 ---------------------- .../depsgraph/intern/builder/deg_builder_nodes.h | 2 -- .../intern/builder/deg_builder_relations.h | 1 - .../depsgraph/intern/debug/deg_debug_graphviz.cc | 35 +++++----------------- source/blender/depsgraph/intern/depsgraph.cc | 32 -------------------- source/blender/depsgraph/intern/depsgraph.h | 8 ----- source/blender/depsgraph/intern/depsgraph_types.h | 8 +---- .../depsgraph/intern/eval/deg_eval_flush.cc | 1 - source/blender/depsgraph/intern/nodes/deg_node.cc | 31 ------------------- source/blender/depsgraph/intern/nodes/deg_node.h | 35 ---------------------- .../depsgraph/intern/nodes/deg_node_operation.h | 3 -- 11 files changed, 9 insertions(+), 182 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 03e6fa4d9e8..ef94dec4b61 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -321,41 +321,6 @@ void DepsgraphNodeBuilder::build_group(Scene *scene, } } -SubgraphDepsNode *DepsgraphNodeBuilder::build_subgraph(Group *group) -{ - /* sanity checks */ - if (!group) - return NULL; - - /* create new subgraph's data */ - Depsgraph *subgraph = reinterpret_cast(DEG_graph_new()); - - DepsgraphNodeBuilder subgraph_builder(m_bmain, subgraph); - - /* add group objects */ - LINKLIST_FOREACH (GroupObject *, go, &group->gobject) { - /*Object *ob = go->ob;*/ - - /* Each "group object" is effectively a separate instance of the - * underlying object data. When the group is evaluated, the transform - * results and/or some other attributes end up getting overridden by - * the group. - */ - } - - /* Create a node for representing subgraph. */ - SubgraphDepsNode *subgraph_node = m_graph->add_subgraph_node(&group->id); - subgraph_node->graph = subgraph; - - /* Make a copy of the data this node will need? */ - /* XXX: do we do this now, or later? */ - /* TODO: need API function which queries graph's ID's hash, and duplicates - * those blocks thoroughly with all outside links removed. - */ - - return subgraph_node; -} - void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob) { const bool has_object = (ob->id.tag & LIB_TAG_DOIT); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 93a8c6c6015..5774d8b6aed 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -62,7 +62,6 @@ namespace DEG { struct Depsgraph; struct DepsNode; struct RootDepsNode; -struct SubgraphDepsNode; struct IDDepsNode; struct TimeSourceDepsNode; struct ComponentDepsNode; @@ -125,7 +124,6 @@ struct DepsgraphNodeBuilder { int name_tag = -1); void build_scene(Main *bmain, Scene *scene); - SubgraphDepsNode *build_subgraph(Group *group); void build_group(Scene *scene, Base *base, Group *group); void build_object(Scene *scene, Base *base, Object *ob); void build_object_transform(Scene *scene, Object *ob); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index ace629e471d..411f3be4036 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -78,7 +78,6 @@ struct Depsgraph; struct DepsNode; struct DepsNodeHandle; struct RootDepsNode; -struct SubgraphDepsNode; struct IDDepsNode; struct TimeSourceDepsNode; struct ComponentDepsNode; diff --git a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc index 0d56ce71c7d..3df4ee0c3dd 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc @@ -80,17 +80,16 @@ static const int deg_debug_node_type_color_map[][2] = { {DEPSNODE_TYPE_ROOT, 0}, {DEPSNODE_TYPE_TIMESOURCE, 1}, {DEPSNODE_TYPE_ID_REF, 2}, - {DEPSNODE_TYPE_SUBGRAPH, 3}, /* Outer Types */ - {DEPSNODE_TYPE_PARAMETERS, 4}, - {DEPSNODE_TYPE_PROXY, 5}, - {DEPSNODE_TYPE_ANIMATION, 6}, - {DEPSNODE_TYPE_TRANSFORM, 7}, - {DEPSNODE_TYPE_GEOMETRY, 8}, - {DEPSNODE_TYPE_SEQUENCER, 9}, - {DEPSNODE_TYPE_SHADING, 10}, - {DEPSNODE_TYPE_CACHE, 11}, + {DEPSNODE_TYPE_PARAMETERS, 3}, + {DEPSNODE_TYPE_PROXY, 4}, + {DEPSNODE_TYPE_ANIMATION, 5}, + {DEPSNODE_TYPE_TRANSFORM, 6}, + {DEPSNODE_TYPE_GEOMETRY, 7}, + {DEPSNODE_TYPE_SEQUENCER, 8}, + {DEPSNODE_TYPE_SHADING, 9}, + {DEPSNODE_TYPE_CACHE, 10}, {-1, 0} }; #endif @@ -380,19 +379,6 @@ static void deg_debug_graphviz_node(const DebugContext &ctx, } break; } - case DEPSNODE_TYPE_SUBGRAPH: - { - SubgraphDepsNode *sub_node = (SubgraphDepsNode *)node; - if (sub_node->graph) { - deg_debug_graphviz_node_cluster_begin(ctx, node); - deg_debug_graphviz_graph_nodes(ctx, sub_node->graph); - deg_debug_graphviz_node_cluster_end(ctx); - } - else { - deg_debug_graphviz_node_single(ctx, node); - } - break; - } case DEPSNODE_TYPE_PARAMETERS: case DEPSNODE_TYPE_ANIMATION: case DEPSNODE_TYPE_TRANSFORM: @@ -432,11 +418,6 @@ static bool deg_debug_graphviz_is_cluster(const DepsNode *node) const IDDepsNode *id_node = (const IDDepsNode *)node; return BLI_ghash_size(id_node->components) > 0; } - case DEPSNODE_TYPE_SUBGRAPH: - { - SubgraphDepsNode *sub_node = (SubgraphDepsNode *)node; - return sub_node->graph != NULL; - } case DEPSNODE_TYPE_PARAMETERS: case DEPSNODE_TYPE_ANIMATION: case DEPSNODE_TYPE_TRANSFORM: diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 8054c33817b..808e3f80bef 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -75,7 +75,6 @@ Depsgraph::Depsgraph() { BLI_spin_init(&lock); id_hash = BLI_ghash_ptr_new("Depsgraph id hash"); - subgraphs = BLI_gset_ptr_new("Depsgraph subgraphs"); entry_tags = BLI_gset_ptr_new("Depsgraph entry_tags"); } @@ -83,9 +82,7 @@ Depsgraph::~Depsgraph() { /* Free root node - it won't have been freed yet... */ clear_id_nodes(); - clear_subgraph_nodes(); BLI_ghash_free(id_hash, NULL, NULL); - BLI_gset_free(subgraphs, NULL); BLI_gset_free(entry_tags, NULL); if (this->root_node != NULL) { OBJECT_GUARDED_DELETE(this->root_node, RootDepsNode); @@ -293,34 +290,6 @@ TimeSourceDepsNode *Depsgraph::find_time_source(const ID *id) const return NULL; } -SubgraphDepsNode *Depsgraph::add_subgraph_node(const ID *id) -{ - DepsNodeFactory *factory = deg_get_node_factory(DEPSNODE_TYPE_SUBGRAPH); - SubgraphDepsNode *subgraph_node = - (SubgraphDepsNode *)factory->create_node(id, "", id->name + 2); - - /* Add to subnodes list. */ - BLI_gset_insert(subgraphs, subgraph_node); - - return subgraph_node; -} - -void Depsgraph::remove_subgraph_node(SubgraphDepsNode *subgraph_node) -{ - BLI_gset_remove(subgraphs, subgraph_node, NULL); - OBJECT_GUARDED_DELETE(subgraph_node, SubgraphDepsNode); -} - -void Depsgraph::clear_subgraph_nodes() -{ - GSET_FOREACH_BEGIN(SubgraphDepsNode *, subgraph_node, subgraphs) - { - OBJECT_GUARDED_DELETE(subgraph_node, SubgraphDepsNode); - } - GSET_FOREACH_END(); - BLI_gset_clear(subgraphs, NULL); -} - IDDepsNode *Depsgraph::find_id_node(const ID *id) const { return reinterpret_cast(BLI_ghash_lookup(id_hash, id)); @@ -458,7 +427,6 @@ void Depsgraph::add_entry_tag(OperationDepsNode *node) void Depsgraph::clear_all_nodes() { clear_id_nodes(); - clear_subgraph_nodes(); BLI_ghash_clear(id_hash, NULL, NULL); if (this->root_node) { OBJECT_GUARDED_DELETE(this->root_node, RootDepsNode); diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h index eefae4133f9..8622d378472 100644 --- a/source/blender/depsgraph/intern/depsgraph.h +++ b/source/blender/depsgraph/intern/depsgraph.h @@ -52,7 +52,6 @@ struct DepsNode; struct RootDepsNode; struct TimeSourceDepsNode; struct IDDepsNode; -struct SubgraphDepsNode; struct ComponentDepsNode; struct OperationDepsNode; @@ -113,10 +112,6 @@ struct Depsgraph { TimeSourceDepsNode *find_time_source(const ID *id = NULL) const; - SubgraphDepsNode *add_subgraph_node(const ID *id); - void remove_subgraph_node(SubgraphDepsNode *subgraph_node); - void clear_subgraph_nodes(); - IDDepsNode *find_id_node(const ID *id) const; IDDepsNode *add_id_node(ID *id, const char *name = ""); void remove_id_node(const ID *id); @@ -146,9 +141,6 @@ struct Depsgraph { /* "root" node - the one where all evaluation enters from. */ RootDepsNode *root_node; - /* Subgraphs referenced in tree. */ - GSet *subgraphs; - /* Indicates whether relations needs to be updated. */ bool need_update; diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h index d03d598084e..3c74ecfc52c 100644 --- a/source/blender/depsgraph/intern/depsgraph_types.h +++ b/source/blender/depsgraph/intern/depsgraph_types.h @@ -96,10 +96,6 @@ typedef enum eDepsNode_Type { * but not usually part of main graph. */ DEPSNODE_TYPE_ID_REF, - /* Isolated sub-graph - used for keeping instanced data separate from - * instances using them. - */ - DEPSNODE_TYPE_SUBGRAPH, /* **** Outer Types **** */ @@ -107,9 +103,7 @@ typedef enum eDepsNode_Type { * (i.e. just SDNA property setting). */ DEPSNODE_TYPE_PARAMETERS, - /* Generic "Proxy-Inherit" Component - * XXX: Also for instancing of subgraphs? - */ + /* Generic "Proxy-Inherit" Component. */ DEPSNODE_TYPE_PROXY, /* Animation Component * diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index d64fdd83d39..89a61ecaca9 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -170,7 +170,6 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) case DEPSNODE_TYPE_ROOT: case DEPSNODE_TYPE_TIMESOURCE: case DEPSNODE_TYPE_ID_REF: - case DEPSNODE_TYPE_SUBGRAPH: case DEPSNODE_TYPE_PARAMETERS: case DEPSNODE_TYPE_SEQUENCER: /* Ignore, does not translate to object component. */ diff --git a/source/blender/depsgraph/intern/nodes/deg_node.cc b/source/blender/depsgraph/intern/nodes/deg_node.cc index b1d5b538e25..dc2d1a4e0ae 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node.cc @@ -289,43 +289,12 @@ void IDDepsNode::finalize_build() DEG_DEPSNODE_DEFINE(IDDepsNode, DEPSNODE_TYPE_ID_REF, "ID Node"); static DepsNodeFactoryImpl DNTI_ID_REF; -/* Subgraph Node ========================================== */ - -/* Initialize 'subgraph' node - from pointer data given. */ -void SubgraphDepsNode::init(const ID *id, const char *UNUSED(subdata)) -{ - /* Store ID-ref if provided. */ - this->root_id = (ID *)id; - - /* NOTE: graph will need to be added manually, - * as we don't have any way of passing this down. - */ -} - -/* Free 'subgraph' node */ -SubgraphDepsNode::~SubgraphDepsNode() -{ - /* Only free if graph not shared, of if this node is the first - * reference to it... - */ - // XXX: prune these flags a bit... - if ((this->flag & SUBGRAPH_FLAG_FIRSTREF) || !(this->flag & SUBGRAPH_FLAG_SHARED)) { - /* Free the referenced graph. */ - DEG_graph_free(reinterpret_cast< ::Depsgraph* >(graph)); - graph = NULL; - } -} - -DEG_DEPSNODE_DEFINE(SubgraphDepsNode, DEPSNODE_TYPE_SUBGRAPH, "Subgraph Node"); -static DepsNodeFactoryImpl DNTI_SUBGRAPH; - void deg_register_base_depsnodes() { deg_register_node_typeinfo(&DNTI_ROOT); deg_register_node_typeinfo(&DNTI_TIMESOURCE); deg_register_node_typeinfo(&DNTI_ID_REF); - deg_register_node_typeinfo(&DNTI_SUBGRAPH); } } // namespace DEG diff --git a/source/blender/depsgraph/intern/nodes/deg_node.h b/source/blender/depsgraph/intern/nodes/deg_node.h index 7c2f53840b6..354f0fd6857 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node.h +++ b/source/blender/depsgraph/intern/nodes/deg_node.h @@ -185,41 +185,6 @@ struct IDDepsNode : public DepsNode { DEG_DEPSNODE_DECLARE; }; -/* Subgraph Reference. */ -struct SubgraphDepsNode : public DepsNode { - void init(const ID *id, const char *subdata); - ~SubgraphDepsNode(); - - /* Instanced graph. */ - Depsgraph *graph; - - /* ID-block at root of subgraph (if applicable). */ - ID *root_id; - - /* Number of nodes which use/reference this subgraph - if just 1, it may be - * possible to merge into main, - */ - size_t num_users; - - /* (eSubgraphRef_Flag) assorted settings for subgraph node. */ - int flag; - - DEG_DEPSNODE_DECLARE; -}; - -/* Flags for subgraph node */ -typedef enum eSubgraphRef_Flag { - /* Subgraph referenced is shared with another reference, so shouldn't - * free on exit. - */ - SUBGRAPH_FLAG_SHARED = (1 << 0), - - /* Node is first reference to subgraph, so it can be freed when we are - * removed. - */ - SUBGRAPH_FLAG_FIRSTREF = (1 << 1), -} eSubgraphRef_Flag; - void deg_register_base_depsnodes(); } // namespace DEG diff --git a/source/blender/depsgraph/intern/nodes/deg_node_operation.h b/source/blender/depsgraph/intern/nodes/deg_node_operation.h index 598393054db..f5e034734d9 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_operation.h +++ b/source/blender/depsgraph/intern/nodes/deg_node_operation.h @@ -44,9 +44,6 @@ typedef enum eDepsOperation_Flag { DEPSOP_FLAG_NEEDS_UPDATE = (1 << 0), /* node was directly modified, causing need for update */ - /* XXX: intention is to make it easier to tell when we just need to - * take subgraphs. - */ DEPSOP_FLAG_DIRECTLY_MODIFIED = (1 << 1), /* Operation is evaluated using CPython; has GIL and security -- cgit v1.2.3 From 5bda458bce54d66da44ceb72202d9a2a36b12df3 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 1 Jun 2017 15:38:15 +0200 Subject: Depsgraph: Remove unused argument from time source query --- .../depsgraph/intern/debug/deg_debug_graphviz.cc | 4 ++-- source/blender/depsgraph/intern/depsgraph.cc | 21 +++------------------ source/blender/depsgraph/intern/depsgraph.h | 2 +- source/blender/depsgraph/intern/depsgraph_debug.cc | 2 +- 4 files changed, 7 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc index 3df4ee0c3dd..96325fb3822 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc @@ -506,7 +506,7 @@ static void deg_debug_graphviz_graph_nodes(const DebugContext &ctx, deg_debug_graphviz_node(ctx, node); } GHASH_FOREACH_END(); - TimeSourceDepsNode *time_source = graph->find_time_source(NULL); + TimeSourceDepsNode *time_source = graph->find_time_source(); if (time_source != NULL) { deg_debug_graphviz_node(ctx, time_source); } @@ -527,7 +527,7 @@ static void deg_debug_graphviz_graph_relations(const DebugContext &ctx, } GHASH_FOREACH_END(); - TimeSourceDepsNode *time_source = graph->find_time_source(NULL); + TimeSourceDepsNode *time_source = graph->find_time_source(); if (time_source != NULL) { deg_debug_graphviz_node_relations(ctx, time_source); } diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 808e3f80bef..30146544b76 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -269,25 +269,10 @@ RootDepsNode *Depsgraph::add_root_node() return root_node; } -TimeSourceDepsNode *Depsgraph::find_time_source(const ID *id) const +TimeSourceDepsNode *Depsgraph::find_time_source() const { - /* Search for one attached to a particular ID? */ - if (id) { - /* Check if it was added as a component - * (as may be done for subgraphs needing timeoffset). - */ - IDDepsNode *id_node = find_id_node(id); - if (id_node) { - // XXX: review this -// return id_node->find_component(DEPSNODE_TYPE_TIMESOURCE); - } - BLI_assert(!"Not implemented yet"); - } - else { - /* Use "official" timesource. */ - return root_node->time_source; - } - return NULL; + BLI_assert(root_node != NULL); + return root_node->time_source; } IDDepsNode *Depsgraph::find_id_node(const ID *id) const diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h index 8622d378472..1c9ba8c4cb1 100644 --- a/source/blender/depsgraph/intern/depsgraph.h +++ b/source/blender/depsgraph/intern/depsgraph.h @@ -110,7 +110,7 @@ struct Depsgraph { RootDepsNode *add_root_node(); - TimeSourceDepsNode *find_time_source(const ID *id = NULL) const; + TimeSourceDepsNode *find_time_source() const; IDDepsNode *find_id_node(const ID *id) const; IDDepsNode *add_id_node(ID *id, const char *name = ""); diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc index d3b48930779..0a8a57ae09f 100644 --- a/source/blender/depsgraph/intern/depsgraph_debug.cc +++ b/source/blender/depsgraph/intern/depsgraph_debug.cc @@ -232,7 +232,7 @@ void DEG_stats_simple(const Depsgraph *graph, size_t *r_outer, } GHASH_FOREACH_END(); - DEG::TimeSourceDepsNode *time_source = deg_graph->find_time_source(NULL); + DEG::TimeSourceDepsNode *time_source = deg_graph->find_time_source(); if (time_source != NULL) { tot_rels += time_source->inlinks.size(); } -- cgit v1.2.3 From 6799fb387db89ad1f4fc6a5137a12665d29df785 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 1 Jun 2017 15:40:02 +0200 Subject: Depsgraph: Cleanup, use DEG_NODE_TYPE prefix for depsgraph node types --- .../depsgraph/intern/builder/deg_builder.cc | 6 +- .../depsgraph/intern/builder/deg_builder_cycle.cc | 4 +- .../depsgraph/intern/builder/deg_builder_nodes.cc | 76 +++---- .../intern/builder/deg_builder_nodes_rig.cc | 32 +-- .../intern/builder/deg_builder_relations.cc | 228 ++++++++++----------- .../intern/builder/deg_builder_relations_keys.cc | 4 +- .../intern/builder/deg_builder_relations_rig.cc | 84 ++++---- .../intern/builder/deg_builder_transitive.cc | 2 +- .../depsgraph/intern/debug/deg_debug_graphviz.cc | 72 +++---- source/blender/depsgraph/intern/depsgraph.cc | 26 +-- source/blender/depsgraph/intern/depsgraph_build.cc | 30 +-- source/blender/depsgraph/intern/depsgraph_debug.cc | 4 +- source/blender/depsgraph/intern/depsgraph_tag.cc | 2 +- source/blender/depsgraph/intern/depsgraph_types.h | 32 +-- source/blender/depsgraph/intern/eval/deg_eval.cc | 6 +- .../depsgraph/intern/eval/deg_eval_flush.cc | 32 +-- source/blender/depsgraph/intern/nodes/deg_node.cc | 16 +- .../depsgraph/intern/nodes/deg_node_component.cc | 24 +-- .../depsgraph/intern/nodes/deg_node_operation.cc | 4 +- 19 files changed, 342 insertions(+), 342 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc index 143f9908db8..55caad91b4e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder.cc @@ -79,7 +79,7 @@ void deg_graph_build_flush_layers(Depsgraph *graph) node->done = 0; node->num_links_pending = 0; foreach (DepsRelation *rel, node->outlinks) { - if ((rel->from->type == DEPSNODE_TYPE_OPERATION) && + if ((rel->from->type == DEG_NODE_TYPE_OPERATION) && (rel->flag & DEPSREL_FLAG_CYCLIC) == 0) { ++node->num_links_pending; @@ -97,14 +97,14 @@ void deg_graph_build_flush_layers(Depsgraph *graph) BLI_stack_pop(stack, &node); /* Flush layers to parents. */ foreach (DepsRelation *rel, node->inlinks) { - if (rel->from->type == DEPSNODE_TYPE_OPERATION) { + if (rel->from->type == DEG_NODE_TYPE_OPERATION) { OperationDepsNode *from = (OperationDepsNode *)rel->from; from->owner->layers |= node->owner->layers; } } /* Schedule parent nodes. */ foreach (DepsRelation *rel, node->inlinks) { - if (rel->from->type == DEPSNODE_TYPE_OPERATION) { + if (rel->from->type == DEG_NODE_TYPE_OPERATION) { OperationDepsNode *from = (OperationDepsNode *)rel->from; if ((rel->flag & DEPSREL_FLAG_CYCLIC) == 0) { BLI_assert(from->num_links_pending > 0); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc index 1420b5fc8a5..0922f359abe 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc @@ -71,7 +71,7 @@ void deg_graph_detect_cycles(Depsgraph *graph) foreach (OperationDepsNode *node, graph->operations) { bool has_inlinks = false; foreach (DepsRelation *rel, node->inlinks) { - if (rel->from->type == DEPSNODE_TYPE_OPERATION) { + if (rel->from->type == DEG_NODE_TYPE_OPERATION) { has_inlinks = true; } } @@ -95,7 +95,7 @@ void deg_graph_detect_cycles(Depsgraph *graph) bool all_child_traversed = true; for (int i = node->done; i < node->outlinks.size(); ++i) { DepsRelation *rel = node->outlinks[i]; - if (rel->to->type == DEPSNODE_TYPE_OPERATION) { + if (rel->to->type == DEG_NODE_TYPE_OPERATION) { OperationDepsNode *to = (OperationDepsNode *)rel->to; if (to->tag == NODE_IN_STACK) { printf("Dependency cycle detected:\n"); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index ef94dec4b61..3330795d053 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -447,13 +447,13 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob) void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob) { /* local transforms (from transform channels - loc/rot/scale + deltas) */ - add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM, + add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEPSOP_TYPE_INIT, function_bind(BKE_object_eval_local_transform, _1, scene, ob), DEG_OPCODE_TRANSFORM_LOCAL); /* object parent */ if (ob->parent) { - add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM, + add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_parent, _1, scene, ob), DEG_OPCODE_TRANSFORM_PARENT); } @@ -470,12 +470,12 @@ void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob) * * TODO(sergey): Get rid of this node. */ - add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM, + add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_uber_transform, _1, scene, ob), DEG_OPCODE_OBJECT_UBEREVAL); /* object transform is done */ - add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM, + add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEPSOP_TYPE_POST, function_bind(BKE_object_eval_done, _1, ob), DEG_OPCODE_TRANSFORM_FINAL); } @@ -500,7 +500,7 @@ void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob) void DepsgraphNodeBuilder::build_object_constraints(Scene *scene, Object *ob) { /* create node for constraint stack */ - add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM, + add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_constraints, _1, scene, ob), DEG_OPCODE_TRANSFORM_CONSTRAINTS); } @@ -523,7 +523,7 @@ void DepsgraphNodeBuilder::build_animdata(ID *id) /* actions and NLA - as a single unit for now, as it gets complicated to schedule otherwise */ if ((adt->action) || (adt->nla_tracks.first)) { /* create the node */ - add_operation_node(id, DEPSNODE_TYPE_ANIMATION, + add_operation_node(id, DEG_NODE_TYPE_ANIMATION, DEPSOP_TYPE_EXEC, function_bind(BKE_animsys_eval_animdata, _1, id), DEG_OPCODE_ANIMATION, id->name); @@ -554,14 +554,14 @@ OperationDepsNode *DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcu) * and use some tagging magic instead. */ OperationDepsNode *driver_op = find_operation_node(id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_DRIVER, fcu->rna_path ? fcu->rna_path : "", fcu->array_index); if (driver_op == NULL) { driver_op = add_operation_node(id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, function_bind(BKE_animsys_eval_driver, _1, id, fcu), DEG_OPCODE_DRIVER, @@ -589,9 +589,9 @@ void DepsgraphNodeBuilder::build_world(World *world) build_animdata(world_id); /* world itself */ - add_component_node(world_id, DEPSNODE_TYPE_PARAMETERS); + add_component_node(world_id, DEG_NODE_TYPE_PARAMETERS); - add_operation_node(world_id, DEPSNODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, + add_operation_node(world_id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); /* textures */ @@ -627,13 +627,13 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene) /* XXX: is this the right component, or do we want to use another one instead? */ /* init/rebuild operation */ - /*OperationDepsNode *init_node =*/ add_operation_node(&scene->id, DEPSNODE_TYPE_TRANSFORM, + /*OperationDepsNode *init_node =*/ add_operation_node(&scene->id, DEG_NODE_TYPE_TRANSFORM, DEPSOP_TYPE_REBUILD, function_bind(BKE_rigidbody_rebuild_sim, _1, scene), DEG_OPCODE_RIGIDBODY_REBUILD); /* do-sim operation */ // XXX: what happens if we need to split into several groups? - OperationDepsNode *sim_node = add_operation_node(&scene->id, DEPSNODE_TYPE_TRANSFORM, + OperationDepsNode *sim_node = add_operation_node(&scene->id, DEG_NODE_TYPE_TRANSFORM, DEPSOP_TYPE_SIM, function_bind(BKE_rigidbody_eval_simulation, _1, scene), DEG_OPCODE_RIGIDBODY_SIM); @@ -654,7 +654,7 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene) /* 2) create operation for flushing results */ /* object's transform component - where the rigidbody operation lives */ - add_operation_node(&ob->id, DEPSNODE_TYPE_TRANSFORM, + add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEPSOP_TYPE_EXEC, function_bind(BKE_rigidbody_object_sync_transforms, _1, scene, ob), DEG_OPCODE_TRANSFORM_RIGIDBODY); } @@ -680,7 +680,7 @@ void DepsgraphNodeBuilder::build_particles(Scene *scene, Object *ob) /* component for all particle systems */ ComponentDepsNode *psys_comp = - add_component_node(&ob->id, DEPSNODE_TYPE_EVAL_PARTICLES); + add_component_node(&ob->id, DEG_NODE_TYPE_EVAL_PARTICLES); /* particle systems */ LINKLIST_FOREACH (ParticleSystem *, psys, &ob->particlesystem) { @@ -710,7 +710,7 @@ void DepsgraphNodeBuilder::build_particles(Scene *scene, Object *ob) void DepsgraphNodeBuilder::build_cloth(Scene *scene, Object *object) { ComponentDepsNode *cache_comp = add_component_node(&object->id, - DEPSNODE_TYPE_CACHE); + DEG_NODE_TYPE_CACHE); add_operation_node(cache_comp, DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_cloth, @@ -726,7 +726,7 @@ void DepsgraphNodeBuilder::build_shapekeys(Key *key) { build_animdata(&key->id); - add_operation_node(&key->id, DEPSNODE_TYPE_GEOMETRY, DEPSOP_TYPE_EXEC, NULL, + add_operation_node(&key->id, DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, "Shapekey Eval"); } @@ -742,7 +742,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) * Does this depend on other nodes? */ add_operation_node(&ob->id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_POST, NULL, DEG_OPCODE_PLACEHOLDER, @@ -756,13 +756,13 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) * TODO(sergey): Get rid of this node. */ add_operation_node(&ob->id, - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_POST, function_bind(BKE_object_eval_uber_data, _1, scene, ob), DEG_OPCODE_GEOMETRY_UBEREVAL); add_operation_node(&ob->id, - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_INIT, NULL, DEG_OPCODE_PLACEHOLDER, @@ -773,7 +773,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) /* Modifiers */ LINKLIST_FOREACH (ModifierData *, md, &ob->modifiers) { add_operation_node(&ob->id, - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_modifier, _1, @@ -822,7 +822,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) /* evaluation operations */ add_operation_node(obdata, - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_INIT, function_bind(BKE_mesh_eval_geometry, _1, @@ -841,7 +841,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) /* metaball evaluation operations */ /* NOTE: only the motherball gets evaluated! */ add_operation_node(obdata, - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_INIT, function_bind(BKE_mball_eval_geometry, _1, @@ -859,7 +859,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) /* Curve/nurms evaluation operations. */ /* - calculate curve geometry (including path) */ add_operation_node(obdata, - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_INIT, function_bind(BKE_curve_eval_geometry, _1, @@ -870,7 +870,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) /* Calculate curve path - this is used by constraints, etc. */ if (ELEM(ob->type, OB_CURVE, OB_FONT)) { add_operation_node(obdata, - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_EXEC, function_bind(BKE_curve_eval_path, _1, @@ -899,7 +899,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) { /* Lattice evaluation operations. */ add_operation_node(obdata, - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_INIT, function_bind(BKE_lattice_eval_geometry, _1, @@ -910,12 +910,12 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) } } - add_operation_node(obdata, DEPSNODE_TYPE_GEOMETRY, + add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_POST, NULL, DEG_OPCODE_PLACEHOLDER, "Eval Done"); /* Parameters for driver sources. */ - add_operation_node(obdata, DEPSNODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, + add_operation_node(obdata, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); } @@ -931,12 +931,12 @@ void DepsgraphNodeBuilder::build_camera(Object *ob) build_animdata(&cam->id); - add_operation_node(camera_id, DEPSNODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, + add_operation_node(camera_id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); if (cam->dof_ob != NULL) { /* TODO(sergey): For now parametrs are on object level. */ - add_operation_node(&ob->id, DEPSNODE_TYPE_PARAMETERS, + add_operation_node(&ob->id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, "Camera DOF"); @@ -955,10 +955,10 @@ void DepsgraphNodeBuilder::build_lamp(Object *ob) build_animdata(&la->id); /* node for obdata */ - add_component_node(lamp_id, DEPSNODE_TYPE_PARAMETERS); + add_component_node(lamp_id, DEG_NODE_TYPE_PARAMETERS); /* TODO(sergey): Is it really how we're supposed to work with drivers? */ - add_operation_node(lamp_id, DEPSNODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, + add_operation_node(lamp_id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); /* lamp's nodetree */ @@ -981,7 +981,7 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree) build_animdata(ntree_id); /* Parameters for drivers. */ - add_operation_node(ntree_id, DEPSNODE_TYPE_PARAMETERS, DEPSOP_TYPE_POST, NULL, + add_operation_node(ntree_id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_POST, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); /* nodetree's nodes... */ @@ -1021,7 +1021,7 @@ void DepsgraphNodeBuilder::build_material(Material *ma) /* material itself */ add_id_node(ma_id); - add_operation_node(ma_id, DEPSNODE_TYPE_SHADING, + add_operation_node(ma_id, DEG_NODE_TYPE_SHADING, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, "Material Update"); @@ -1078,7 +1078,7 @@ void DepsgraphNodeBuilder::build_image(Image *image) { add_id_node(image_id); /* Placeholder so we can add relations and tag ID node for update. */ add_operation_node(image_id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, @@ -1090,10 +1090,10 @@ void DepsgraphNodeBuilder::build_compositor(Scene *scene) /* For now, just a plain wrapper? */ // TODO: create compositing component? // XXX: component type undefined! - //graph->get_node(&scene->id, NULL, DEPSNODE_TYPE_COMPOSITING, NULL); + //graph->get_node(&scene->id, NULL, DEG_NODE_TYPE_COMPOSITING, NULL); /* for now, nodetrees are just parameters; compositing occurs in internals of renderer... */ - add_component_node(&scene->id, DEPSNODE_TYPE_PARAMETERS); + add_component_node(&scene->id, DEG_NODE_TYPE_PARAMETERS); build_nodetree(scene->nodetree); } @@ -1115,8 +1115,8 @@ void DepsgraphNodeBuilder::build_cachefile(CacheFile *cache_file) { ID *cache_file_id = &cache_file->id; - add_component_node(cache_file_id, DEPSNODE_TYPE_CACHE); - add_operation_node(cache_file_id, DEPSNODE_TYPE_CACHE, + add_component_node(cache_file_id, DEG_NODE_TYPE_CACHE); + add_operation_node(cache_file_id, DEG_NODE_TYPE_CACHE, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, "Cache File Update"); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc index e307909cb11..29d80290bd3 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -67,7 +67,7 @@ namespace DEG { void DepsgraphNodeBuilder::build_pose_constraints(Scene *scene, Object *ob, bPoseChannel *pchan) { /* create node for constraint stack */ - add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, + add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_EXEC, function_bind(BKE_pose_constraints_evaluate, _1, scene, ob, pchan), DEG_OPCODE_BONE_CONSTRAINTS); @@ -81,14 +81,14 @@ void DepsgraphNodeBuilder::build_ik_pose(Scene *scene, Object *ob, bPoseChannel /* Find the chain's root. */ bPoseChannel *rootchan = BKE_armature_ik_solver_find_root(pchan, data); - if (has_operation_node(&ob->id, DEPSNODE_TYPE_EVAL_POSE, rootchan->name, + if (has_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name, DEG_OPCODE_POSE_IK_SOLVER)) { return; } /* Operation node for evaluating/running IK Solver. */ - add_operation_node(&ob->id, DEPSNODE_TYPE_EVAL_POSE, rootchan->name, + add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name, DEPSOP_TYPE_SIM, function_bind(BKE_pose_iktree_evaluate, _1, scene, ob, rootchan), DEG_OPCODE_POSE_IK_SOLVER); } @@ -104,7 +104,7 @@ void DepsgraphNodeBuilder::build_splineik_pose(Scene *scene, Object *ob, bPoseCh /* Operation node for evaluating/running Spline IK Solver. * Store the "root bone" of this chain in the solver, so it knows where to start. */ - add_operation_node(&ob->id, DEPSNODE_TYPE_EVAL_POSE, rootchan->name, + add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name, DEPSOP_TYPE_SIM, function_bind(BKE_pose_splineik_evaluate, _1, scene, ob, rootchan), DEG_OPCODE_POSE_SPLINE_IK_SOLVER); } @@ -125,7 +125,7 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob) /* Make sure pose is up-to-date with armature updates. */ add_operation_node(&arm->id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, @@ -175,28 +175,28 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob) */ /* pose eval context */ - add_operation_node(&ob->id, DEPSNODE_TYPE_EVAL_POSE, + add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEPSOP_TYPE_INIT, function_bind(BKE_pose_eval_init, _1, scene, ob, ob->pose), DEG_OPCODE_POSE_INIT); - add_operation_node(&ob->id, DEPSNODE_TYPE_EVAL_POSE, + add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEPSOP_TYPE_POST, function_bind(BKE_pose_eval_flush, _1, scene, ob, ob->pose), DEG_OPCODE_POSE_DONE); /* bones */ LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { /* node for bone eval */ - add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, + add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_INIT, NULL, // XXX: BKE_pose_eval_bone_local DEG_OPCODE_BONE_LOCAL); - add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, + add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_EXEC, function_bind(BKE_pose_eval_bone, _1, scene, ob, pchan), // XXX: BKE_pose_eval_bone_pose DEG_OPCODE_BONE_POSE_PARENT); - add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, + add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_OUT, NULL, /* NOTE: dedicated noop for easier relationship construction */ DEG_OPCODE_BONE_READY); - add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, + add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_POST, function_bind(BKE_pose_bone_done, _1, pchan), DEG_OPCODE_BONE_DONE); @@ -247,27 +247,27 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *ob) } add_operation_node(&ob->id, - DEPSNODE_TYPE_EVAL_POSE, + DEG_NODE_TYPE_EVAL_POSE, DEPSOP_TYPE_INIT, function_bind(BKE_pose_eval_proxy_copy, _1, ob), DEG_OPCODE_POSE_INIT); LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { - add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, + add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_INIT, NULL, DEG_OPCODE_BONE_LOCAL); - add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, + add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_BONE_READY); - add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, + add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_POST, NULL, DEG_OPCODE_BONE_DONE); } add_operation_node(&ob->id, - DEPSNODE_TYPE_EVAL_POSE, + DEG_NODE_TYPE_EVAL_POSE, DEPSOP_TYPE_POST, NULL, DEG_OPCODE_POSE_DONE); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index eba4e8907b1..d2188c94027 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -317,10 +317,10 @@ void DepsgraphRelationBuilder::add_collision_relations(const OperationKey &key, { Object *ob1 = collobjs[i]; - ComponentKey trf_key(&ob1->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey trf_key(&ob1->id, DEG_NODE_TYPE_TRANSFORM); add_relation(trf_key, key, name); - ComponentKey coll_key(&ob1->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey coll_key(&ob1->id, DEG_NODE_TYPE_GEOMETRY); add_relation(coll_key, key, name); } @@ -335,30 +335,30 @@ void DepsgraphRelationBuilder::add_forcefield_relations(const OperationKey &key, if (effectors) { for (EffectorCache *eff = (EffectorCache *)effectors->first; eff; eff = eff->next) { if (eff->ob != ob) { - ComponentKey eff_key(&eff->ob->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey eff_key(&eff->ob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(eff_key, key, name); } if (eff->psys) { if (eff->ob != ob) { - ComponentKey eff_key(&eff->ob->id, DEPSNODE_TYPE_EVAL_PARTICLES); + ComponentKey eff_key(&eff->ob->id, DEG_NODE_TYPE_EVAL_PARTICLES); add_relation(eff_key, key, name); /* TODO: remove this when/if EVAL_PARTICLES is sufficient for up to date particles */ - ComponentKey mod_key(&eff->ob->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey mod_key(&eff->ob->id, DEG_NODE_TYPE_GEOMETRY); add_relation(mod_key, key, name); } else if (eff->psys != psys) { - OperationKey eff_key(&eff->ob->id, DEPSNODE_TYPE_EVAL_PARTICLES, DEG_OPCODE_PSYS_EVAL, eff->psys->name); + OperationKey eff_key(&eff->ob->id, DEG_NODE_TYPE_EVAL_PARTICLES, DEG_OPCODE_PSYS_EVAL, eff->psys->name); add_relation(eff_key, key, name); } } if (eff->pd->forcefield == PFIELD_SMOKEFLOW && eff->pd->f_source) { - ComponentKey trf_key(&eff->pd->f_source->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey trf_key(&eff->pd->f_source->id, DEG_NODE_TYPE_TRANSFORM); add_relation(trf_key, key, "Smoke Force Domain"); - ComponentKey eff_key(&eff->pd->f_source->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey eff_key(&eff->pd->f_source->id, DEG_NODE_TYPE_GEOMETRY); add_relation(eff_key, key, "Smoke Force Domain"); } @@ -397,13 +397,13 @@ void DepsgraphRelationBuilder::build_group(Main *bmain, ID *group_id = &group->id; bool group_done = (group_id->tag & LIB_TAG_DOIT) != 0; OperationKey object_local_transform_key(&object->id, - DEPSNODE_TYPE_TRANSFORM, + DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_LOCAL); LINKLIST_FOREACH (GroupObject *, go, &group->gobject) { if (!group_done) { build_object(bmain, scene, go->ob); } - ComponentKey dupli_transform_key(&go->ob->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey dupli_transform_key(&go->ob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(dupli_transform_key, object_local_transform_key, "Dupligroup"); @@ -420,13 +420,13 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o /* Object Transforms */ eDepsOperation_Code base_op = (ob->parent) ? DEG_OPCODE_TRANSFORM_PARENT : DEG_OPCODE_TRANSFORM_LOCAL; - OperationKey base_op_key(&ob->id, DEPSNODE_TYPE_TRANSFORM, base_op); + OperationKey base_op_key(&ob->id, DEG_NODE_TYPE_TRANSFORM, base_op); - OperationKey local_transform_key(&ob->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_LOCAL); - OperationKey parent_transform_key(&ob->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_PARENT); - OperationKey final_transform_key(&ob->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); + OperationKey local_transform_key(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_LOCAL); + OperationKey parent_transform_key(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_PARENT); + OperationKey final_transform_key(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); - OperationKey ob_ubereval_key(&ob->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_OBJECT_UBEREVAL); + OperationKey ob_ubereval_key(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_OBJECT_UBEREVAL); /* parenting */ if (ob->parent != NULL) { @@ -457,7 +457,7 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o /* object constraints */ if (ob->constraints.first != NULL) { OperationKey constraint_key(&ob->id, - DEPSNODE_TYPE_TRANSFORM, + DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_CONSTRAINTS); /* constraint relations */ @@ -465,7 +465,7 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o // XXX: this is broken build_constraints(scene, &ob->id, - DEPSNODE_TYPE_TRANSFORM, + DEG_NODE_TYPE_TRANSFORM, "", &ob->constraints, NULL); @@ -510,7 +510,7 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o // XXX: This should be hooked up by the build_animdata code if (needs_animdata_node(&ob->id)) { - ComponentKey adt_key(&ob->id, DEPSNODE_TYPE_ANIMATION); + ComponentKey adt_key(&ob->id, DEG_NODE_TYPE_ANIMATION); add_relation(adt_key, local_transform_key, "Object Animation"); @@ -557,8 +557,8 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o Key *key = BKE_key_from_object(ob); if (key != NULL) { - ComponentKey geometry_key((ID *)ob->data, DEPSNODE_TYPE_GEOMETRY); - ComponentKey key_key(&key->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey geometry_key((ID *)ob->data, DEG_NODE_TYPE_GEOMETRY); + ComponentKey key_key(&key->id, DEG_NODE_TYPE_GEOMETRY); add_relation(key_key, geometry_key, "Shapekeys"); @@ -582,8 +582,8 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o /* TODO(sergey): This is an inverted relation, matches old depsgraph * behavior and need to be investigated if it still need to be inverted. */ - ComponentKey ob_pose_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE); - ComponentKey proxy_pose_key(&ob->proxy->id, DEPSNODE_TYPE_EVAL_POSE); + ComponentKey ob_pose_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE); + ComponentKey proxy_pose_key(&ob->proxy->id, DEG_NODE_TYPE_EVAL_POSE); add_relation(ob_pose_key, proxy_pose_key, "Proxy"); } @@ -600,14 +600,14 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) */ // XXX: @sergey - it would be good if we got that backwards flushing working // when tagging for updates. - //OperationKey ob_key(&ob->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_PARENT); - ComponentKey ob_key(&ob->id, DEPSNODE_TYPE_TRANSFORM); + //OperationKey ob_key(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_PARENT); + ComponentKey ob_key(&ob->id, DEG_NODE_TYPE_TRANSFORM); /* type-specific links */ switch (ob->partype) { case PARSKEL: /* Armature Deform (Virtual Modifier) */ { - ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey parent_key(&ob->parent->id, DEG_NODE_TYPE_TRANSFORM); add_relation(parent_key, ob_key, "Armature Deform Parent"); break; } @@ -615,7 +615,7 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) case PARVERT1: /* Vertex Parent */ case PARVERT3: { - ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey parent_key(&ob->parent->id, DEG_NODE_TYPE_GEOMETRY); add_relation(parent_key, ob_key, "Vertex Parent"); /* XXX not sure what this is for or how you could be done properly - lukas */ @@ -624,7 +624,7 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) parent_node->customdata_mask |= CD_MASK_ORIGINDEX; } - ComponentKey transform_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey transform_key(&ob->parent->id, DEG_NODE_TYPE_TRANSFORM); add_relation(transform_key, ob_key, "Vertex Parent TFM"); break; } @@ -632,10 +632,10 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) case PARBONE: /* Bone Parent */ { ComponentKey parent_bone_key(&ob->parent->id, - DEPSNODE_TYPE_BONE, + DEG_NODE_TYPE_BONE, ob->parsubstr); OperationKey parent_transform_key(&ob->parent->id, - DEPSNODE_TYPE_TRANSFORM, + DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); add_relation(parent_bone_key, ob_key, @@ -651,8 +651,8 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) if (ob->parent->type == OB_LATTICE) { /* Lattice Deform Parent - Virtual Modifier */ // XXX: no virtual modifiers should be left! - ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); - ComponentKey geom_key(&ob->parent->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey parent_key(&ob->parent->id, DEG_NODE_TYPE_TRANSFORM); + ComponentKey geom_key(&ob->parent->id, DEG_NODE_TYPE_GEOMETRY); add_relation(parent_key, ob_key, "Lattice Deform Parent"); add_relation(geom_key, ob_key, "Lattice Deform Parent Geom"); @@ -662,21 +662,21 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) if (cu->flag & CU_PATH) { /* Follow Path */ - ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey parent_key(&ob->parent->id, DEG_NODE_TYPE_GEOMETRY); add_relation(parent_key, ob_key, "Curve Follow Parent"); - ComponentKey transform_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey transform_key(&ob->parent->id, DEG_NODE_TYPE_TRANSFORM); add_relation(transform_key, ob_key, "Curve Follow TFM"); } else { /* Standard Parent */ - ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey parent_key(&ob->parent->id, DEG_NODE_TYPE_TRANSFORM); add_relation(parent_key, ob_key, "Curve Parent"); } } else { /* Standard Parent */ - ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey parent_key(&ob->parent->id, DEG_NODE_TYPE_TRANSFORM); add_relation(parent_key, ob_key, "Parent"); } break; @@ -693,7 +693,7 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode ListBase *constraints, RootPChanMap *root_map) { OperationKey constraint_op_key(id, component_type, component_subdata, - (component_type == DEPSNODE_TYPE_BONE) ? DEG_OPCODE_BONE_CONSTRAINTS : DEG_OPCODE_TRANSFORM_CONSTRAINTS); + (component_type == DEG_NODE_TYPE_BONE) ? DEG_OPCODE_BONE_CONSTRAINTS : DEG_OPCODE_TRANSFORM_CONSTRAINTS); /* add dependencies for each constraint in turn */ for (bConstraint *con = (bConstraint *)constraints->first; con; con = con->next) { @@ -716,7 +716,7 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode if (data->depth_ob) { // DAG_RL_DATA_OB | DAG_RL_OB_OB - ComponentKey depth_key(&data->depth_ob->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey depth_key(&data->depth_ob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(depth_key, constraint_op_key, cti->name); } } @@ -726,7 +726,7 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode if (depends_on_camera && scene->camera) { // DAG_RL_DATA_OB | DAG_RL_OB_OB - ComponentKey camera_key(&scene->camera->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey camera_key(&scene->camera->id, DEG_NODE_TYPE_TRANSFORM); add_relation(camera_key, constraint_op_key, cti->name); } @@ -742,7 +742,7 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode bTransformCacheConstraint *data = (bTransformCacheConstraint *)con->data; if (data->cache_file) { - ComponentKey cache_key(&data->cache_file->id, DEPSNODE_TYPE_CACHE); + ComponentKey cache_key(&data->cache_file->id, DEG_NODE_TYPE_CACHE); add_relation(cache_key, constraint_op_key, cti->name); } } @@ -760,7 +760,7 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode } else if (ELEM(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO)) { /* these constraints require path geometry data... */ - ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey target_key(&ct->tar->id, DEG_NODE_TYPE_GEOMETRY); add_relation(target_key, constraint_op_key, cti->name); // XXX: type = geom_transform // TODO: path dependency } @@ -780,19 +780,19 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode target_key_opcode = DEG_OPCODE_BONE_DONE; } - OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_BONE, ct->subtarget, target_key_opcode); + OperationKey target_key(&ct->tar->id, DEG_NODE_TYPE_BONE, ct->subtarget, target_key_opcode); add_relation(target_key, constraint_op_key, cti->name); } else { /* different armature - we can safely use the result of that */ - OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_BONE, ct->subtarget, DEG_OPCODE_BONE_DONE); + OperationKey target_key(&ct->tar->id, DEG_NODE_TYPE_BONE, ct->subtarget, DEG_OPCODE_BONE_DONE); add_relation(target_key, constraint_op_key, cti->name); } } else if (ELEM(ct->tar->type, OB_MESH, OB_LATTICE) && (ct->subtarget[0])) { /* vertex group */ /* NOTE: for now, we don't need to represent vertex groups separately... */ - ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey target_key(&ct->tar->id, DEG_NODE_TYPE_GEOMETRY); add_relation(target_key, constraint_op_key, cti->name); if (ct->tar->type == OB_MESH) { @@ -804,11 +804,11 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode } else if (con->type == CONSTRAINT_TYPE_SHRINKWRAP) { /* Constraints which requires the target object surface. */ - ComponentKey target_key(&ct->tar->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey target_key(&ct->tar->id, DEG_NODE_TYPE_GEOMETRY); add_relation(target_key, constraint_op_key, cti->name); /* NOTE: obdata eval now doesn't necessarily depend on the object's transform... */ - ComponentKey target_transform_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey target_transform_key(&ct->tar->id, DEG_NODE_TYPE_TRANSFORM); add_relation(target_transform_key, constraint_op_key, cti->name); } else { @@ -821,18 +821,18 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode * - If however it is a real self targetting case, just make it depend on the * previous constraint (or the pre-constraint state)... */ - if ((ct->tar->type == OB_ARMATURE) && (component_type == DEPSNODE_TYPE_BONE)) { - OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); + if ((ct->tar->type == OB_ARMATURE) && (component_type == DEG_NODE_TYPE_BONE)) { + OperationKey target_key(&ct->tar->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); add_relation(target_key, constraint_op_key, cti->name); } else { - OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_LOCAL); + OperationKey target_key(&ct->tar->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_LOCAL); add_relation(target_key, constraint_op_key, cti->name); } } else { /* normal object dependency */ - OperationKey target_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); + OperationKey target_key(&ct->tar->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); add_relation(target_key, constraint_op_key, cti->name); } } @@ -847,7 +847,7 @@ void DepsgraphRelationBuilder::build_constraints(Scene *scene, ID *id, eDepsNode CONSTRAINT_TYPE_TRANSLIKE)) { /* TODO(sergey): Add used space check. */ - ComponentKey target_transform_key(&ct->tar->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey target_transform_key(&ct->tar->id, DEG_NODE_TYPE_TRANSFORM); add_relation(target_transform_key, constraint_op_key, cti->name); } @@ -866,7 +866,7 @@ void DepsgraphRelationBuilder::build_animdata(ID *id) if (adt == NULL) return; - ComponentKey adt_key(id, DEPSNODE_TYPE_ANIMATION); + ComponentKey adt_key(id, DEG_NODE_TYPE_ANIMATION); /* animation */ if (adt->action || adt->nla_tracks.first) { @@ -882,7 +882,7 @@ void DepsgraphRelationBuilder::build_animdata(ID *id) /* drivers */ LINKLIST_FOREACH (FCurve *, fcu, &adt->drivers) { OperationKey driver_key(id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_DRIVER, fcu->rna_path ? fcu->rna_path : "", fcu->array_index); @@ -923,12 +923,12 @@ void DepsgraphRelationBuilder::build_animdata(ID *id) } if (fcu_prev != NULL) { OperationKey prev_driver_key(id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_DRIVER, fcu_prev->rna_path ? fcu_prev->rna_path : "", fcu_prev->array_index); OperationKey driver_key(id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_DRIVER, fcu->rna_path ? fcu->rna_path : "", fcu->array_index); @@ -950,7 +950,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) { ChannelDriver *driver = fcu->driver; OperationKey driver_key(id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_DRIVER, fcu->rna_path ? fcu->rna_path : "", fcu->array_index); @@ -980,7 +980,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) } if (pchan) { - OperationKey bone_key(id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); + OperationKey bone_key(id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); add_relation(driver_key, bone_key, "[Driver -> Bone]"); } else { @@ -1007,7 +1007,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, bone_name); // NOTE: ob->pose may be NULL if (pchan) { - OperationKey bone_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); + OperationKey bone_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); add_relation(driver_key, bone_key, "[Arm Bone -> Driver -> Bone]"); } } @@ -1028,7 +1028,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) char *modifier_name = BLI_str_quoted_substrN(rna_path, "modifiers["); if (modifier_name) { OperationKey modifier_key(id, - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_MODIFIER, modifier_name); if (has_node(modifier_key)) { @@ -1046,21 +1046,21 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) // XXX: double check where this points Key *shape_key = (Key *)id; - ComponentKey geometry_key(shape_key->from, DEPSNODE_TYPE_GEOMETRY); + ComponentKey geometry_key(shape_key->from, DEG_NODE_TYPE_GEOMETRY); add_relation(driver_key, geometry_key, "[Driver -> ShapeKey Geom]"); } else if (strstr(rna_path, "key_blocks[")) { - ComponentKey geometry_key(id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey geometry_key(id, DEG_NODE_TYPE_GEOMETRY); add_relation(driver_key, geometry_key, "[Driver -> ShapeKey Geom]"); } else { if (GS(id->name) == ID_OB) { /* assume that driver affects a transform... */ - OperationKey local_transform_key(id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_LOCAL); + OperationKey local_transform_key(id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_LOCAL); add_relation(driver_key, local_transform_key, "[Driver -> Transform]"); } else if (GS(id->name) == ID_KE) { - ComponentKey geometry_key(id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey geometry_key(id, DEG_NODE_TYPE_GEOMETRY); add_relation(driver_key, geometry_key, "[Driver -> Shapekey Geometry]"); } } @@ -1094,13 +1094,13 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) { continue; } - OperationKey target_key(dtar->id, DEPSNODE_TYPE_BONE, target_pchan->name, DEG_OPCODE_BONE_DONE); + OperationKey target_key(dtar->id, DEG_NODE_TYPE_BONE, target_pchan->name, DEG_OPCODE_BONE_DONE); add_relation(target_key, driver_key, "[Bone Target -> Driver]"); } } else if (dtar->flag & DTAR_FLAG_STRUCT_REF) { /* get node associated with the object's transforms */ - OperationKey target_key(dtar->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); + OperationKey target_key(dtar->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); add_relation(target_key, driver_key, "[Target -> Driver]"); } else if (dtar->rna_path && strstr(dtar->rna_path, "pose.bones[")) { @@ -1121,7 +1121,7 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) { continue; } - OperationKey bone_key(dtar->id, DEPSNODE_TYPE_BONE, target_pchan->name, DEG_OPCODE_BONE_LOCAL); + OperationKey bone_key(dtar->id, DEG_NODE_TYPE_BONE, target_pchan->name, DEG_OPCODE_BONE_LOCAL); add_relation(bone_key, driver_key, "[RNA Bone -> Driver]"); } } @@ -1170,8 +1170,8 @@ void DepsgraphRelationBuilder::build_world(World *world) /* world's nodetree */ if (world->nodetree != NULL) { build_nodetree(world->nodetree); - ComponentKey ntree_key(&world->nodetree->id, DEPSNODE_TYPE_PARAMETERS); - ComponentKey world_key(world_id, DEPSNODE_TYPE_PARAMETERS); + ComponentKey ntree_key(&world->nodetree->id, DEG_NODE_TYPE_PARAMETERS); + ComponentKey world_key(world_id, DEG_NODE_TYPE_PARAMETERS); add_relation(ntree_key, world_key, "NTree->World Parameters"); } @@ -1181,8 +1181,8 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) { RigidBodyWorld *rbw = scene->rigidbody_world; - OperationKey init_key(&scene->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_RIGIDBODY_REBUILD); - OperationKey sim_key(&scene->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_RIGIDBODY_SIM); + OperationKey init_key(&scene->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_RIGIDBODY_REBUILD); + OperationKey sim_key(&scene->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_RIGIDBODY_SIM); /* rel between the two sim-nodes */ add_relation(init_key, sim_key, "Rigidbody [Init -> SimStep]"); @@ -1211,10 +1211,10 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) * XXX: there's probably a difference between passive and active * - passive don't change, so may need to know full transform... */ - OperationKey rbo_key(&ob->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_RIGIDBODY); + OperationKey rbo_key(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_RIGIDBODY); eDepsOperation_Code trans_opcode = ob->parent ? DEG_OPCODE_TRANSFORM_PARENT : DEG_OPCODE_TRANSFORM_LOCAL; - OperationKey trans_op(&ob->id, DEPSNODE_TYPE_TRANSFORM, trans_opcode); + OperationKey trans_op(&ob->id, DEG_NODE_TYPE_TRANSFORM, trans_opcode); add_relation(sim_key, rbo_key, "Rigidbody Sim Eval -> RBO Sync"); @@ -1228,7 +1228,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) */ if (ob->constraints.first) { OperationKey constraint_key(&ob->id, - DEPSNODE_TYPE_TRANSFORM, + DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_CONSTRAINTS); add_relation(rbo_key, constraint_key, @@ -1241,7 +1241,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) * If it is gone we'll need to reconsider relation here. */ OperationKey uber_key(&ob->id, - DEPSNODE_TYPE_TRANSFORM, + DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_OBJECT_UBEREVAL); add_relation(rbo_key, uber_key, @@ -1268,9 +1268,9 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) /* final result of the constraint object's transform controls how the * constraint affects the physics sim for these objects */ - ComponentKey trans_key(&ob->id, DEPSNODE_TYPE_TRANSFORM); - OperationKey ob1_key(&rbc->ob1->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_RIGIDBODY); - OperationKey ob2_key(&rbc->ob2->id, DEPSNODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_RIGIDBODY); + ComponentKey trans_key(&ob->id, DEG_NODE_TYPE_TRANSFORM); + OperationKey ob1_key(&rbc->ob1->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_RIGIDBODY); + OperationKey ob2_key(&rbc->ob2->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_RIGIDBODY); /* - constrained-objects sync depends on the constraint-holder */ add_relation(trans_key, ob1_key, "RigidBodyConstraint -> RBC.Object_1"); @@ -1286,7 +1286,7 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) { TimeSourceKey time_src_key; OperationKey obdata_ubereval_key(&ob->id, - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_UBEREVAL); /* particle systems */ @@ -1297,7 +1297,7 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) build_animdata(&part->id); /* this particle system */ - OperationKey psys_key(&ob->id, DEPSNODE_TYPE_EVAL_PARTICLES, DEG_OPCODE_PSYS_EVAL, psys->name); + OperationKey psys_key(&ob->id, DEG_NODE_TYPE_EVAL_PARTICLES, DEG_OPCODE_PSYS_EVAL, psys->name); /* XXX: if particle system is later re-enabled, we must do full rebuild? */ if (!psys_check_enabled(ob, psys, G.is_rendering)) @@ -1339,7 +1339,7 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) ruleob = ((BoidRuleFollowLeader *)rule)->ob; if (ruleob) { - ComponentKey ruleob_key(&ruleob->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey ruleob_key(&ruleob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(ruleob_key, psys_key, "Boid Rule"); } } @@ -1347,7 +1347,7 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) } if (part->ren_as == PART_DRAW_OB && part->dup_ob) { - ComponentKey dup_ob_key(&part->dup_ob->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey dup_ob_key(&part->dup_ob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(dup_ob_key, psys_key, "Particle Object Visualization"); @@ -1360,7 +1360,7 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) * TODO(sergey): This relation should be altered once real granular update * is implemented. */ - ComponentKey transform_key(&ob->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey transform_key(&ob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(transform_key, obdata_ubereval_key, "Partcile Eval"); @@ -1374,12 +1374,12 @@ void DepsgraphRelationBuilder::build_cloth(Scene * /*scene*/, ModifierData *md) { OperationKey cache_key(&object->id, - DEPSNODE_TYPE_CACHE, + DEG_NODE_TYPE_CACHE, DEG_OPCODE_PLACEHOLDER, "Cloth Modifier"); /* Cache component affects on modifier. */ OperationKey modifier_key(&object->id, - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_MODIFIER, md->name); add_relation(cache_key, @@ -1390,7 +1390,7 @@ void DepsgraphRelationBuilder::build_cloth(Scene * /*scene*/, /* Shapekeys */ void DepsgraphRelationBuilder::build_shapekeys(ID *obdata, Key *key) { - ComponentKey obdata_key(obdata, DEPSNODE_TYPE_GEOMETRY); + ComponentKey obdata_key(obdata, DEG_NODE_TYPE_GEOMETRY); /* attach animdata to geometry */ build_animdata(&key->id); @@ -1398,7 +1398,7 @@ void DepsgraphRelationBuilder::build_shapekeys(ID *obdata, Key *key) if (key->adt) { // TODO: this should really be handled in build_animdata, since many of these cases will need it if (key->adt->action || key->adt->nla_tracks.first) { - ComponentKey adt_key(&key->id, DEPSNODE_TYPE_ANIMATION); + ComponentKey adt_key(&key->id, DEG_NODE_TYPE_ANIMATION); add_relation(adt_key, obdata_key, "Animation"); } @@ -1407,7 +1407,7 @@ void DepsgraphRelationBuilder::build_shapekeys(ID *obdata, Key *key) /* attach to geometry */ // XXX: aren't shapekeys now done as a pseudo-modifier on object? - //ComponentKey key_key(&key->id, DEPSNODE_TYPE_GEOMETRY); // FIXME: this doesn't exist + //ComponentKey key_key(&key->id, DEG_NODE_TYPE_GEOMETRY); // FIXME: this doesn't exist //add_relation(key_key, obdata_key, "Shapekeys"); } @@ -1436,11 +1436,11 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje ID *obdata = (ID *)ob->data; /* Init operation of object-level geometry evaluation. */ - OperationKey geom_init_key(&ob->id, DEPSNODE_TYPE_GEOMETRY, DEG_OPCODE_PLACEHOLDER, "Eval Init"); + OperationKey geom_init_key(&ob->id, DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_PLACEHOLDER, "Eval Init"); /* get nodes for result of obdata's evaluation, and geometry evaluation on object */ - ComponentKey obdata_geom_key(obdata, DEPSNODE_TYPE_GEOMETRY); - ComponentKey geom_key(&ob->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey obdata_geom_key(obdata, DEG_NODE_TYPE_GEOMETRY); + ComponentKey geom_key(&ob->id, DEG_NODE_TYPE_GEOMETRY); /* link components to each other */ add_relation(obdata_geom_key, geom_key, "Object Geometry Base Data"); @@ -1451,7 +1451,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje LINKLIST_FOREACH (ModifierData *, md, &ob->modifiers) { const ModifierTypeInfo *mti = modifierType_getInfo((ModifierType)md->type); - OperationKey mod_key(&ob->id, DEPSNODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_MODIFIER, md->name); + OperationKey mod_key(&ob->id, DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_MODIFIER, md->name); if (md->prev) { /* Stack relation: modifier depends on previous modifier in the stack */ @@ -1483,7 +1483,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje */ /* XXX: Remove this hack when these links are added as part of build_animdata() instead */ if (modifier_dependsOnTime(md) == false && needs_animdata_node(&ob->id)) { - ComponentKey animation_key(&ob->id, DEPSNODE_TYPE_ANIMATION); + ComponentKey animation_key(&ob->id, DEG_NODE_TYPE_ANIMATION); add_relation(animation_key, mod_key, "Modifier Animation"); } } @@ -1517,10 +1517,10 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje */ if (ob->type != OB_ARMATURE) { /* Armatures does no longer require uber node. */ - OperationKey obdata_ubereval_key(&ob->id, DEPSNODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_UBEREVAL); + OperationKey obdata_ubereval_key(&ob->id, DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_UBEREVAL); if (ob->modifiers.last) { ModifierData *md = (ModifierData *)ob->modifiers.last; - OperationKey mod_key(&ob->id, DEPSNODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_MODIFIER, md->name); + OperationKey mod_key(&ob->id, DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_MODIFIER, md->name); add_relation(mod_key, obdata_ubereval_key, "Object Geometry UberEval"); } else { @@ -1534,8 +1534,8 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje obdata->tag |= LIB_TAG_DOIT; /* Link object data evaluation node to exit operation. */ - OperationKey obdata_geom_eval_key(obdata, DEPSNODE_TYPE_GEOMETRY, DEG_OPCODE_PLACEHOLDER, "Geometry Eval"); - OperationKey obdata_geom_done_key(obdata, DEPSNODE_TYPE_GEOMETRY, DEG_OPCODE_PLACEHOLDER, "Eval Done"); + OperationKey obdata_geom_eval_key(obdata, DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_PLACEHOLDER, "Geometry Eval"); + OperationKey obdata_geom_done_key(obdata, DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_PLACEHOLDER, "Eval Done"); add_relation(obdata_geom_eval_key, obdata_geom_done_key, "ObData Geom Eval Done"); /* type-specific node/links */ @@ -1550,8 +1550,8 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje /* motherball - mom depends on children! */ if (mom != ob) { /* non-motherball -> cannot be directly evaluated! */ - ComponentKey mom_key(&mom->id, DEPSNODE_TYPE_GEOMETRY); - ComponentKey transform_key(&ob->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey mom_key(&mom->id, DEG_NODE_TYPE_GEOMETRY); + ComponentKey transform_key(&ob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(geom_key, mom_key, "Metaball Motherball"); add_relation(transform_key, mom_key, "Metaball Motherball"); } @@ -1566,18 +1566,18 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje /* curve's dependencies */ // XXX: these needs geom data, but where is geom stored? if (cu->bevobj) { - ComponentKey bevob_key(&cu->bevobj->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey bevob_key(&cu->bevobj->id, DEG_NODE_TYPE_GEOMETRY); build_object(bmain, scene, cu->bevobj); add_relation(bevob_key, geom_key, "Curve Bevel"); } if (cu->taperobj) { - ComponentKey taperob_key(&cu->taperobj->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey taperob_key(&cu->taperobj->id, DEG_NODE_TYPE_GEOMETRY); build_object(bmain, scene, cu->taperobj); add_relation(taperob_key, geom_key, "Curve Taper"); } if (ob->type == OB_FONT) { if (cu->textoncurve) { - ComponentKey textoncurve_key(&cu->textoncurve->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey textoncurve_key(&cu->textoncurve->id, DEG_NODE_TYPE_GEOMETRY); build_object(bmain, scene, cu->textoncurve); add_relation(textoncurve_key, geom_key, "Text on Curve"); } @@ -1603,8 +1603,8 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje } if (needs_animdata_node(obdata)) { - ComponentKey animation_key(obdata, DEPSNODE_TYPE_ANIMATION); - ComponentKey parameters_key(obdata, DEPSNODE_TYPE_PARAMETERS); + ComponentKey animation_key(obdata, DEG_NODE_TYPE_ANIMATION); + ComponentKey parameters_key(obdata, DEG_NODE_TYPE_PARAMETERS); add_relation(animation_key, parameters_key, "Geom Parameters"); /* Evaluation usually depends on animation. @@ -1625,18 +1625,18 @@ void DepsgraphRelationBuilder::build_camera(Object *ob) } camera_id->tag |= LIB_TAG_DOIT; - ComponentKey parameters_key(camera_id, DEPSNODE_TYPE_PARAMETERS); + ComponentKey parameters_key(camera_id, DEG_NODE_TYPE_PARAMETERS); if (needs_animdata_node(camera_id)) { - ComponentKey animation_key(camera_id, DEPSNODE_TYPE_ANIMATION); + ComponentKey animation_key(camera_id, DEG_NODE_TYPE_ANIMATION); add_relation(animation_key, parameters_key, "Camera Parameters"); } /* DOF */ if (cam->dof_ob) { - ComponentKey ob_param_key(&ob->id, DEPSNODE_TYPE_PARAMETERS); - ComponentKey dof_ob_key(&cam->dof_ob->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey ob_param_key(&ob->id, DEG_NODE_TYPE_PARAMETERS); + ComponentKey dof_ob_key(&cam->dof_ob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(dof_ob_key, ob_param_key, "Camera DOF"); } } @@ -1651,10 +1651,10 @@ void DepsgraphRelationBuilder::build_lamp(Object *ob) } lamp_id->tag |= LIB_TAG_DOIT; - ComponentKey parameters_key(lamp_id, DEPSNODE_TYPE_PARAMETERS); + ComponentKey parameters_key(lamp_id, DEG_NODE_TYPE_PARAMETERS); if (needs_animdata_node(lamp_id)) { - ComponentKey animation_key(lamp_id, DEPSNODE_TYPE_ANIMATION); + ComponentKey animation_key(lamp_id, DEG_NODE_TYPE_ANIMATION); add_relation(animation_key, parameters_key, "Lamp Parameters"); } @@ -1662,7 +1662,7 @@ void DepsgraphRelationBuilder::build_lamp(Object *ob) /* lamp's nodetree */ if (la->nodetree) { build_nodetree(la->nodetree); - ComponentKey nodetree_key(&la->nodetree->id, DEPSNODE_TYPE_PARAMETERS); + ComponentKey nodetree_key(&la->nodetree->id, DEG_NODE_TYPE_PARAMETERS); add_relation(nodetree_key, parameters_key, "NTree->Lamp Parameters"); } @@ -1681,7 +1681,7 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) build_animdata(ntree_id); OperationKey parameters_key(ntree_id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); @@ -1701,7 +1701,7 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) group_ntree->id.tag |= LIB_TAG_DOIT; } OperationKey group_parameters_key(&group_ntree->id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); add_relation(group_parameters_key, parameters_key, @@ -1711,7 +1711,7 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) } if (needs_animdata_node(ntree_id)) { - ComponentKey animation_key(ntree_id, DEPSNODE_TYPE_ANIMATION); + ComponentKey animation_key(ntree_id, DEG_NODE_TYPE_ANIMATION); add_relation(animation_key, parameters_key, "NTree Parameters"); } @@ -1736,11 +1736,11 @@ void DepsgraphRelationBuilder::build_material(Material *ma) if (ma->nodetree != NULL) { build_nodetree(ma->nodetree); OperationKey ntree_key(&ma->nodetree->id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); OperationKey material_key(&ma->id, - DEPSNODE_TYPE_SHADING, + DEG_NODE_TYPE_SHADING, DEG_OPCODE_PLACEHOLDER, "Material Update"); add_relation(ntree_key, material_key, diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc index feae8bca303..478756e0cff 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc @@ -64,7 +64,7 @@ string TimeSourceKey::identifier() const ComponentKey::ComponentKey() : id(NULL), - type(DEPSNODE_TYPE_UNDEFINED), + type(DEG_NODE_TYPE_UNDEFINED), name("") { } @@ -90,7 +90,7 @@ string ComponentKey::identifier() const OperationKey::OperationKey() : id(NULL), - component_type(DEPSNODE_TYPE_UNDEFINED), + component_type(DEG_NODE_TYPE_UNDEFINED), component_name(""), opcode(DEG_OPCODE_OPERATION), name(""), diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc index df1d19e59dc..2e2dc8d5d3e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -83,7 +83,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, * - see notes on direction of rel below... */ bPoseChannel *rootchan = BKE_armature_ik_solver_find_root(pchan, data); - OperationKey solver_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, rootchan->name, DEG_OPCODE_POSE_IK_SOLVER); + OperationKey solver_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name, DEG_OPCODE_POSE_IK_SOLVER); /* IK target */ // XXX: this should get handled as part of the constraint code @@ -96,24 +96,24 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, * testing IK solver. */ // FIXME: geometry targets... - ComponentKey pose_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE); + ComponentKey pose_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE); if ((data->tar->type == OB_ARMATURE) && (data->subtarget[0])) { /* TODO(sergey): This is only for until granular update stores intermediate result. */ if (data->tar != ob) { /* different armature - can just read the results */ - ComponentKey target_key(&data->tar->id, DEPSNODE_TYPE_BONE, data->subtarget); + ComponentKey target_key(&data->tar->id, DEG_NODE_TYPE_BONE, data->subtarget); add_relation(target_key, pose_key, con->name); } else { /* same armature - we'll use the ready state only, just in case this bone is in the chain we're solving */ - OperationKey target_key(&data->tar->id, DEPSNODE_TYPE_BONE, data->subtarget, DEG_OPCODE_BONE_DONE); + OperationKey target_key(&data->tar->id, DEG_NODE_TYPE_BONE, data->subtarget, DEG_OPCODE_BONE_DONE); add_relation(target_key, solver_key, con->name); } } else if (ELEM(data->tar->type, OB_MESH, OB_LATTICE) && (data->subtarget[0])) { /* vertex group target */ /* NOTE: for now, we don't need to represent vertex groups separately... */ - ComponentKey target_key(&data->tar->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey target_key(&data->tar->id, DEG_NODE_TYPE_GEOMETRY); add_relation(target_key, solver_key, con->name); if (data->tar->type == OB_MESH) { @@ -125,7 +125,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, } else { /* Standard Object Target */ - ComponentKey target_key(&data->tar->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey target_key(&data->tar->id, DEG_NODE_TYPE_TRANSFORM); add_relation(target_key, pose_key, con->name); } @@ -142,13 +142,13 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, if (data->poletar != NULL) { if ((data->poletar->type == OB_ARMATURE) && (data->polesubtarget[0])) { // XXX: same armature issues - ready vs done? - ComponentKey target_key(&data->poletar->id, DEPSNODE_TYPE_BONE, data->polesubtarget); + ComponentKey target_key(&data->poletar->id, DEG_NODE_TYPE_BONE, data->polesubtarget); add_relation(target_key, solver_key, con->name); } else if (ELEM(data->poletar->type, OB_MESH, OB_LATTICE) && (data->polesubtarget[0])) { /* vertex group target */ /* NOTE: for now, we don't need to represent vertex groups separately... */ - ComponentKey target_key(&data->poletar->id, DEPSNODE_TYPE_GEOMETRY); + ComponentKey target_key(&data->poletar->id, DEG_NODE_TYPE_GEOMETRY); add_relation(target_key, solver_key, con->name); if (data->poletar->type == OB_MESH) { @@ -159,7 +159,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, } } else { - ComponentKey target_key(&data->poletar->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey target_key(&data->poletar->id, DEG_NODE_TYPE_TRANSFORM); add_relation(target_key, solver_key, con->name); } } @@ -170,7 +170,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, bPoseChannel *parchan = pchan; /* exclude tip from chain? */ if (!(data->flag & CONSTRAINT_IK_TIP)) { - OperationKey tip_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, + OperationKey tip_transforms_key(&ob->id, DEG_NODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_LOCAL); add_relation(solver_key, tip_transforms_key, "IK Solver Result"); @@ -179,7 +179,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, root_map->add_bone(parchan->name, rootchan->name); - OperationKey parchan_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, + OperationKey parchan_transforms_key(&ob->id, DEG_NODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_READY); add_relation(parchan_transforms_key, solver_key, "IK Solver Owner"); @@ -196,14 +196,14 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, * grab the result with IK solver results... */ if (parchan != pchan) { - OperationKey parent_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_READY); + OperationKey parent_key(&ob->id, DEG_NODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_READY); add_relation(parent_key, solver_key, "IK Chain Parent"); - OperationKey done_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); + OperationKey done_key(&ob->id, DEG_NODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); add_relation(solver_key, done_key, "IK Chain Result"); } else { - OperationKey final_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); + OperationKey final_transforms_key(&ob->id, DEG_NODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); add_relation(solver_key, final_transforms_key, "IK Solver Result"); } parchan->flag |= POSE_DONE; @@ -219,7 +219,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, parchan = parchan->parent; } - OperationKey flush_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); + OperationKey flush_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); add_relation(solver_key, flush_key, "PoseEval Result-Bone Link"); } @@ -231,8 +231,8 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *ob, { bSplineIKConstraint *data = (bSplineIKConstraint *)con->data; bPoseChannel *rootchan = BKE_armature_splineik_solver_find_root(pchan, data); - OperationKey transforms_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY); - OperationKey solver_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, rootchan->name, DEG_OPCODE_POSE_SPLINE_IK_SOLVER); + OperationKey transforms_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY); + OperationKey solver_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name, DEG_OPCODE_POSE_SPLINE_IK_SOLVER); /* attach owner to IK Solver too * - assume that owner is always part of chain @@ -247,13 +247,13 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *ob, * See IK pose for a bit more information. */ // TODO: the bigggest point here is that we need the curve PATH and not just the general geometry... - ComponentKey target_key(&data->tar->id, DEPSNODE_TYPE_GEOMETRY); - ComponentKey pose_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE); + ComponentKey target_key(&data->tar->id, DEG_NODE_TYPE_GEOMETRY); + ComponentKey pose_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE); add_relation(target_key, pose_key, "[Curve.Path -> Spline IK] DepsRel"); } pchan->flag |= POSE_DONE; - OperationKey final_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE); + OperationKey final_transforms_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE); add_relation(solver_key, final_transforms_key, "Spline IK Result"); root_map->add_bone(pchan->name, rootchan->name); @@ -270,15 +270,15 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *ob, * grab the result with IK solver results... */ if (parchan != pchan) { - OperationKey parent_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_READY); + OperationKey parent_key(&ob->id, DEG_NODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_READY); add_relation(parent_key, solver_key, "Spline IK Solver Update"); - OperationKey done_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); + OperationKey done_key(&ob->id, DEG_NODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); add_relation(solver_key, done_key, "IK Chain Result"); } parchan->flag |= POSE_DONE; - OperationKey final_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); + OperationKey final_transforms_key(&ob->id, DEG_NODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); add_relation(solver_key, final_transforms_key, "Spline IK Solver Result"); root_map->add_bone(parchan->name, rootchan->name); @@ -288,7 +288,7 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *ob, if ((segcount == data->chainlen) || (segcount > 255)) break; /* 255 is weak */ } - OperationKey flush_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); + OperationKey flush_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); add_relation(solver_key, flush_key, "PoseEval Result-Bone Link"); } @@ -301,20 +301,20 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob) // TODO: selection status? /* attach links between pose operations */ - OperationKey init_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT); - OperationKey flush_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); + OperationKey init_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT); + OperationKey flush_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); add_relation(init_key, flush_key, "[Pose Init -> Pose Cleanup]"); /* Make sure pose is up-to-date with armature updates. */ OperationKey armature_key(&arm->id, - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_PLACEHOLDER, "Armature Eval"); add_relation(armature_key, init_key, "Data dependency"); if (needs_animdata_node(&ob->id)) { - ComponentKey animation_key(&ob->id, DEPSNODE_TYPE_ANIMATION); + ComponentKey animation_key(&ob->id, DEG_NODE_TYPE_ANIMATION); add_relation(animation_key, init_key, "Rig Animation"); } @@ -370,18 +370,18 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob) /* TODO(sergey): Once partial updates are possible use relation between * object transform and solver itself in it's build function. */ - ComponentKey pose_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE); - ComponentKey local_transform_key(&ob->id, DEPSNODE_TYPE_TRANSFORM); + ComponentKey pose_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE); + ComponentKey local_transform_key(&ob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(local_transform_key, pose_key, "Local Transforms"); } /* links between operations for each bone */ LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { - OperationKey bone_local_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); - OperationKey bone_pose_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_POSE_PARENT); - OperationKey bone_ready_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY); - OperationKey bone_done_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE); + OperationKey bone_local_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); + OperationKey bone_pose_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_POSE_PARENT); + OperationKey bone_ready_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY); + OperationKey bone_done_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE); pchan->flag &= ~POSE_DONE; @@ -403,17 +403,17 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob) parent_key_opcode = DEG_OPCODE_BONE_DONE; } - OperationKey parent_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->parent->name, parent_key_opcode); + OperationKey parent_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->parent->name, parent_key_opcode); add_relation(parent_key, bone_pose_key, "[Parent Bone -> Child Bone]"); } /* constraints */ if (pchan->constraints.first != NULL) { /* constraints stack and constraint dependencies */ - build_constraints(scene, &ob->id, DEPSNODE_TYPE_BONE, pchan->name, &pchan->constraints, &root_map); + build_constraints(scene, &ob->id, DEG_NODE_TYPE_BONE, pchan->name, &pchan->constraints, &root_map); /* pose -> constraints */ - OperationKey constraints_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_CONSTRAINTS); + OperationKey constraints_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_CONSTRAINTS); add_relation(bone_pose_key, constraints_key, "Constraints Stack"); /* constraints -> ready */ @@ -439,12 +439,12 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob) void DepsgraphRelationBuilder::build_proxy_rig(Object *ob) { - OperationKey pose_init_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT); - OperationKey pose_done_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); + OperationKey pose_init_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT); + OperationKey pose_done_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { - OperationKey bone_local_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); - OperationKey bone_ready_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY); - OperationKey bone_done_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE); + OperationKey bone_local_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); + OperationKey bone_ready_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY); + OperationKey bone_done_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE); add_relation(pose_init_key, bone_local_key, "Pose Init -> Bone Local"); add_relation(bone_local_key, bone_ready_key, "Local -> Ready"); add_relation(bone_ready_key, bone_done_key, "Ready -> Done"); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc b/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc index da71db09f3d..5c825b29354 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc @@ -105,7 +105,7 @@ void deg_graph_transitive_reduction(Depsgraph *graph) /* Increment in advance, so we can safely remove the relation. */ ++it_rel; - if (rel->from->type == DEPSNODE_TYPE_TIMESOURCE) { + if (rel->from->type == DEG_NODE_TYPE_TIMESOURCE) { /* HACK: time source nodes don't get "done" flag set/cleared. */ /* TODO: there will be other types in future, so iterators above * need modifying. diff --git a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc index 96325fb3822..8cc9634f1a3 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc @@ -77,19 +77,19 @@ static const char *deg_debug_colors_light[] = { #ifdef COLOR_SCHEME_NODE_TYPE static const int deg_debug_node_type_color_map[][2] = { - {DEPSNODE_TYPE_ROOT, 0}, - {DEPSNODE_TYPE_TIMESOURCE, 1}, - {DEPSNODE_TYPE_ID_REF, 2}, + {DEG_NODE_TYPE_ROOT, 0}, + {DEG_NODE_TYPE_TIMESOURCE, 1}, + {DEG_NODE_TYPE_ID_REF, 2}, /* Outer Types */ - {DEPSNODE_TYPE_PARAMETERS, 3}, - {DEPSNODE_TYPE_PROXY, 4}, - {DEPSNODE_TYPE_ANIMATION, 5}, - {DEPSNODE_TYPE_TRANSFORM, 6}, - {DEPSNODE_TYPE_GEOMETRY, 7}, - {DEPSNODE_TYPE_SEQUENCER, 8}, - {DEPSNODE_TYPE_SHADING, 9}, - {DEPSNODE_TYPE_CACHE, 10}, + {DEG_NODE_TYPE_PARAMETERS, 3}, + {DEG_NODE_TYPE_PROXY, 4}, + {DEG_NODE_TYPE_ANIMATION, 5}, + {DEG_NODE_TYPE_TRANSFORM, 6}, + {DEG_NODE_TYPE_GEOMETRY, 7}, + {DEG_NODE_TYPE_SEQUENCER, 8}, + {DEG_NODE_TYPE_SHADING, 9}, + {DEG_NODE_TYPE_CACHE, 10}, {-1, 0} }; #endif @@ -99,9 +99,9 @@ static int deg_debug_node_color_index(const DepsNode *node) #ifdef COLOR_SCHEME_NODE_CLASS /* Some special types. */ switch (node->type) { - case DEPSNODE_TYPE_ID_REF: + case DEG_NODE_TYPE_ID_REF: return 5; - case DEPSNODE_TYPE_OPERATION: + case DEG_NODE_TYPE_OPERATION: { OperationDepsNode *op_node = (OperationDepsNode *)node; if (op_node->is_noop()) @@ -285,7 +285,7 @@ static void deg_debug_graphviz_node_single(const DebugContext &ctx, const char *shape = "box"; string name = node->identifier(); float priority = -1.0f; - if (node->type == DEPSNODE_TYPE_ID_REF) { + if (node->type == DEG_NODE_TYPE_ID_REF) { IDDepsNode *id_node = (IDDepsNode *)node; char buf[256]; BLI_snprintf(buf, sizeof(buf), " (Layers: %u)", id_node->layers); @@ -321,7 +321,7 @@ static void deg_debug_graphviz_node_cluster_begin(const DebugContext &ctx, const DepsNode *node) { string name = node->identifier(); - if (node->type == DEPSNODE_TYPE_ID_REF) { + if (node->type == DEG_NODE_TYPE_ID_REF) { IDDepsNode *id_node = (IDDepsNode *)node; char buf[256]; BLI_snprintf(buf, sizeof(buf), " (Layers: %u)", id_node->layers); @@ -362,7 +362,7 @@ static void deg_debug_graphviz_node(const DebugContext &ctx, const DepsNode *node) { switch (node->type) { - case DEPSNODE_TYPE_ID_REF: + case DEG_NODE_TYPE_ID_REF: { const IDDepsNode *id_node = (const IDDepsNode *)node; if (BLI_ghash_size(id_node->components) == 0) { @@ -379,17 +379,17 @@ static void deg_debug_graphviz_node(const DebugContext &ctx, } break; } - case DEPSNODE_TYPE_PARAMETERS: - case DEPSNODE_TYPE_ANIMATION: - case DEPSNODE_TYPE_TRANSFORM: - case DEPSNODE_TYPE_PROXY: - case DEPSNODE_TYPE_GEOMETRY: - case DEPSNODE_TYPE_SEQUENCER: - case DEPSNODE_TYPE_EVAL_POSE: - case DEPSNODE_TYPE_BONE: - case DEPSNODE_TYPE_SHADING: - case DEPSNODE_TYPE_CACHE: - case DEPSNODE_TYPE_EVAL_PARTICLES: + case DEG_NODE_TYPE_PARAMETERS: + case DEG_NODE_TYPE_ANIMATION: + case DEG_NODE_TYPE_TRANSFORM: + case DEG_NODE_TYPE_PROXY: + case DEG_NODE_TYPE_GEOMETRY: + case DEG_NODE_TYPE_SEQUENCER: + case DEG_NODE_TYPE_EVAL_POSE: + case DEG_NODE_TYPE_BONE: + case DEG_NODE_TYPE_SHADING: + case DEG_NODE_TYPE_CACHE: + case DEG_NODE_TYPE_EVAL_PARTICLES: { ComponentDepsNode *comp_node = (ComponentDepsNode *)node; if (!comp_node->operations.empty()) { @@ -413,19 +413,19 @@ static void deg_debug_graphviz_node(const DebugContext &ctx, static bool deg_debug_graphviz_is_cluster(const DepsNode *node) { switch (node->type) { - case DEPSNODE_TYPE_ID_REF: + case DEG_NODE_TYPE_ID_REF: { const IDDepsNode *id_node = (const IDDepsNode *)node; return BLI_ghash_size(id_node->components) > 0; } - case DEPSNODE_TYPE_PARAMETERS: - case DEPSNODE_TYPE_ANIMATION: - case DEPSNODE_TYPE_TRANSFORM: - case DEPSNODE_TYPE_PROXY: - case DEPSNODE_TYPE_GEOMETRY: - case DEPSNODE_TYPE_SEQUENCER: - case DEPSNODE_TYPE_EVAL_POSE: - case DEPSNODE_TYPE_BONE: + case DEG_NODE_TYPE_PARAMETERS: + case DEG_NODE_TYPE_ANIMATION: + case DEG_NODE_TYPE_TRANSFORM: + case DEG_NODE_TYPE_PROXY: + case DEG_NODE_TYPE_GEOMETRY: + case DEG_NODE_TYPE_SEQUENCER: + case DEG_NODE_TYPE_EVAL_POSE: + case DEG_NODE_TYPE_BONE: { ComponentDepsNode *comp_node = (ComponentDepsNode *)node; return !comp_node->operations.empty(); diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 30146544b76..330f8a0dcb6 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -128,7 +128,7 @@ static bool pointer_to_component_node_criteria(const PointerRNA *ptr, bPoseChannel *pchan = (bPoseChannel *)ptr->data; /* Bone - generally, we just want the bone component... */ - *type = DEPSNODE_TYPE_BONE; + *type = DEG_NODE_TYPE_BONE; *subdata = pchan->name; return true; @@ -138,7 +138,7 @@ static bool pointer_to_component_node_criteria(const PointerRNA *ptr, /* armature-level bone, but it ends up going to bone component anyway */ // TODO: the ID in thise case will end up being bArmature, not Object as needed! - *type = DEPSNODE_TYPE_BONE; + *type = DEG_NODE_TYPE_BONE; *subdata = bone->name; //*id = ... @@ -152,7 +152,7 @@ static bool pointer_to_component_node_criteria(const PointerRNA *ptr, if (BLI_findindex(&ob->constraints, con) != -1) { /* object transform */ // XXX: for now, we can't address the specific constraint or the constraint stack... - *type = DEPSNODE_TYPE_TRANSFORM; + *type = DEG_NODE_TYPE_TRANSFORM; return true; } else if (ob->pose) { @@ -160,7 +160,7 @@ static bool pointer_to_component_node_criteria(const PointerRNA *ptr, for (pchan = (bPoseChannel *)ob->pose->chanbase.first; pchan; pchan = pchan->next) { if (BLI_findindex(&pchan->constraints, con) != -1) { /* bone transforms */ - *type = DEPSNODE_TYPE_BONE; + *type = DEG_NODE_TYPE_BONE; *subdata = pchan->name; return true; } @@ -175,7 +175,7 @@ static bool pointer_to_component_node_criteria(const PointerRNA *ptr, * so although we have unique ops for modifiers, * we can't lump them together */ - *type = DEPSNODE_TYPE_BONE; + *type = DEG_NODE_TYPE_BONE; //*subdata = md->name; return true; @@ -192,14 +192,14 @@ static bool pointer_to_component_node_criteria(const PointerRNA *ptr, strstr(prop_identifier, "scale") || strstr(prop_identifier, "matrix_")) { - *type = DEPSNODE_TYPE_TRANSFORM; + *type = DEG_NODE_TYPE_TRANSFORM; return true; } else if (strstr(prop_identifier, "data")) { /* We access object.data, most likely a geometry. * Might be a bone tho.. */ - *type = DEPSNODE_TYPE_GEOMETRY; + *type = DEG_NODE_TYPE_GEOMETRY; return true; } } @@ -209,21 +209,21 @@ static bool pointer_to_component_node_criteria(const PointerRNA *ptr, /* ShapeKeys are currently handled as geometry on the geometry that owns it */ *id = key->from; // XXX - *type = DEPSNODE_TYPE_PARAMETERS; + *type = DEG_NODE_TYPE_PARAMETERS; return true; } else if (RNA_struct_is_a(ptr->type, &RNA_Sequence)) { Sequence *seq = (Sequence *)ptr->data; /* Sequencer strip */ - *type = DEPSNODE_TYPE_SEQUENCER; + *type = DEG_NODE_TYPE_SEQUENCER; *subdata = seq->name; // xxx? return true; } if (prop) { /* All unknown data effectively falls under "parameter evaluation" */ - *type = DEPSNODE_TYPE_PARAMETERS; + *type = DEG_NODE_TYPE_PARAMETERS; return true; } @@ -263,7 +263,7 @@ static void id_node_deleter(void *value) RootDepsNode *Depsgraph::add_root_node() { if (!root_node) { - DepsNodeFactory *factory = deg_get_node_factory(DEPSNODE_TYPE_ROOT); + DepsNodeFactory *factory = deg_get_node_factory(DEG_NODE_TYPE_ROOT); root_node = (RootDepsNode *)factory->create_node(NULL, "", "Root (Scene)"); } return root_node; @@ -284,7 +284,7 @@ IDDepsNode *Depsgraph::add_id_node(ID *id, const char *name) { IDDepsNode *id_node = find_id_node(id); if (!id_node) { - DepsNodeFactory *factory = deg_get_node_factory(DEPSNODE_TYPE_ID_REF); + DepsNodeFactory *factory = deg_get_node_factory(DEG_NODE_TYPE_ID_REF); id_node = (IDDepsNode *)factory->create_node(id, "", name); id->tag |= LIB_TAG_DOIT; /* register */ @@ -318,7 +318,7 @@ DepsRelation *Depsgraph::add_new_relation(OperationDepsNode *from, /* TODO(sergey): Find a better place for this. */ #ifdef WITH_OPENSUBDIV ComponentDepsNode *comp_node = from->owner; - if (comp_node->type == DEPSNODE_TYPE_GEOMETRY) { + if (comp_node->type == DEG_NODE_TYPE_GEOMETRY) { IDDepsNode *id_to = to->owner->owner; IDDepsNode *id_from = from->owner->owner; if (id_to != id_from && (id_to->id->tag & LIB_TAG_ID_RECALC_ALL)) { diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 9abdc3cf0eb..9434387ecb8 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -81,29 +81,29 @@ static DEG::eDepsNode_Type deg_build_scene_component_type( eDepsSceneComponentType component) { switch (component) { - case DEG_SCENE_COMP_PARAMETERS: return DEG::DEPSNODE_TYPE_PARAMETERS; - case DEG_SCENE_COMP_ANIMATION: return DEG::DEPSNODE_TYPE_ANIMATION; - case DEG_SCENE_COMP_SEQUENCER: return DEG::DEPSNODE_TYPE_SEQUENCER; + case DEG_SCENE_COMP_PARAMETERS: return DEG::DEG_NODE_TYPE_PARAMETERS; + case DEG_SCENE_COMP_ANIMATION: return DEG::DEG_NODE_TYPE_ANIMATION; + case DEG_SCENE_COMP_SEQUENCER: return DEG::DEG_NODE_TYPE_SEQUENCER; } - return DEG::DEPSNODE_TYPE_UNDEFINED; + return DEG::DEG_NODE_TYPE_UNDEFINED; } static DEG::eDepsNode_Type deg_build_object_component_type( eDepsObjectComponentType component) { switch (component) { - case DEG_OB_COMP_PARAMETERS: return DEG::DEPSNODE_TYPE_PARAMETERS; - case DEG_OB_COMP_PROXY: return DEG::DEPSNODE_TYPE_PROXY; - case DEG_OB_COMP_ANIMATION: return DEG::DEPSNODE_TYPE_ANIMATION; - case DEG_OB_COMP_TRANSFORM: return DEG::DEPSNODE_TYPE_TRANSFORM; - case DEG_OB_COMP_GEOMETRY: return DEG::DEPSNODE_TYPE_GEOMETRY; - case DEG_OB_COMP_EVAL_POSE: return DEG::DEPSNODE_TYPE_EVAL_POSE; - case DEG_OB_COMP_BONE: return DEG::DEPSNODE_TYPE_BONE; - case DEG_OB_COMP_EVAL_PARTICLES: return DEG::DEPSNODE_TYPE_EVAL_PARTICLES; - case DEG_OB_COMP_SHADING: return DEG::DEPSNODE_TYPE_SHADING; - case DEG_OB_COMP_CACHE: return DEG::DEPSNODE_TYPE_CACHE; + case DEG_OB_COMP_PARAMETERS: return DEG::DEG_NODE_TYPE_PARAMETERS; + case DEG_OB_COMP_PROXY: return DEG::DEG_NODE_TYPE_PROXY; + case DEG_OB_COMP_ANIMATION: return DEG::DEG_NODE_TYPE_ANIMATION; + case DEG_OB_COMP_TRANSFORM: return DEG::DEG_NODE_TYPE_TRANSFORM; + case DEG_OB_COMP_GEOMETRY: return DEG::DEG_NODE_TYPE_GEOMETRY; + case DEG_OB_COMP_EVAL_POSE: return DEG::DEG_NODE_TYPE_EVAL_POSE; + case DEG_OB_COMP_BONE: return DEG::DEG_NODE_TYPE_BONE; + case DEG_OB_COMP_EVAL_PARTICLES: return DEG::DEG_NODE_TYPE_EVAL_PARTICLES; + case DEG_OB_COMP_SHADING: return DEG::DEG_NODE_TYPE_SHADING; + case DEG_OB_COMP_CACHE: return DEG::DEG_NODE_TYPE_CACHE; } - return DEG::DEPSNODE_TYPE_UNDEFINED; + return DEG::DEG_NODE_TYPE_UNDEFINED; } static DEG::DepsNodeHandle *get_handle(DepsNodeHandle *handle) diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc index 0a8a57ae09f..6f0a82b5cc2 100644 --- a/source/blender/depsgraph/intern/depsgraph_debug.cc +++ b/source/blender/depsgraph/intern/depsgraph_debug.cc @@ -165,7 +165,7 @@ bool DEG_debug_consistency_check(Depsgraph *graph) return false; } foreach (DEG::DepsRelation *rel, node->outlinks) { - if (rel->to->type == DEG::DEPSNODE_TYPE_OPERATION) { + if (rel->to->type == DEG::DEG_NODE_TYPE_OPERATION) { DEG::OperationDepsNode *to = (DEG::OperationDepsNode *)rel->to; BLI_assert(to->num_links_pending < to->inlinks.size()); ++to->num_links_pending; @@ -177,7 +177,7 @@ bool DEG_debug_consistency_check(Depsgraph *graph) foreach (DEG::OperationDepsNode *node, deg_graph->operations) { int num_links_pending = 0; foreach (DEG::DepsRelation *rel, node->inlinks) { - if (rel->from->type == DEG::DEPSNODE_TYPE_OPERATION) { + if (rel->from->type == DEG::DEG_NODE_TYPE_OPERATION) { ++num_links_pending; } } diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 8c4c0b8c8a5..ee45ce536c6 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -337,7 +337,7 @@ void DEG_graph_on_visible_update(Main *bmain, Scene *scene) { id_node->tag_update(graph); DEG::ComponentDepsNode *anim_comp = - id_node->find_component(DEG::DEPSNODE_TYPE_ANIMATION); + id_node->find_component(DEG::DEG_NODE_TYPE_ANIMATION); if (anim_comp != NULL && object->recalc & OB_RECALC_TIME) { anim_comp->tag_update(graph); } diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h index 3c74ecfc52c..120ace6a9d8 100644 --- a/source/blender/depsgraph/intern/depsgraph_types.h +++ b/source/blender/depsgraph/intern/depsgraph_types.h @@ -82,53 +82,53 @@ typedef enum eDepsNode_Class { /* Types of Nodes */ typedef enum eDepsNode_Type { /* Fallback type for invalid return value */ - DEPSNODE_TYPE_UNDEFINED = -1, + DEG_NODE_TYPE_UNDEFINED = -1, /* Inner Node (Operation) */ - DEPSNODE_TYPE_OPERATION = 0, + DEG_NODE_TYPE_OPERATION = 0, /* **** Generic Types **** */ /* "Current Scene" - basically whatever kicks off the evaluation process. */ - DEPSNODE_TYPE_ROOT, + DEG_NODE_TYPE_ROOT, /* Time-Source */ - DEPSNODE_TYPE_TIMESOURCE, + DEG_NODE_TYPE_TIMESOURCE, /* ID-Block reference - used as landmarks/collection point for components, * but not usually part of main graph. */ - DEPSNODE_TYPE_ID_REF, + DEG_NODE_TYPE_ID_REF, /* **** Outer Types **** */ /* Parameters Component - Default when nothing else fits * (i.e. just SDNA property setting). */ - DEPSNODE_TYPE_PARAMETERS, + DEG_NODE_TYPE_PARAMETERS, /* Generic "Proxy-Inherit" Component. */ - DEPSNODE_TYPE_PROXY, + DEG_NODE_TYPE_PROXY, /* Animation Component * * XXX: merge in with parameters? */ - DEPSNODE_TYPE_ANIMATION, + DEG_NODE_TYPE_ANIMATION, /* Transform Component (Parenting/Constraints) */ - DEPSNODE_TYPE_TRANSFORM, + DEG_NODE_TYPE_TRANSFORM, /* Geometry Component (DerivedMesh/Displist) */ - DEPSNODE_TYPE_GEOMETRY, + DEG_NODE_TYPE_GEOMETRY, /* Sequencer Component (Scene Only) */ - DEPSNODE_TYPE_SEQUENCER, + DEG_NODE_TYPE_SEQUENCER, /* **** Evaluation-Related Outer Types (with Subdata) **** */ /* Pose Component - Owner/Container of Bones Eval */ - DEPSNODE_TYPE_EVAL_POSE, + DEG_NODE_TYPE_EVAL_POSE, /* Bone Component - Child/Subcomponent of Pose */ - DEPSNODE_TYPE_BONE, + DEG_NODE_TYPE_BONE, /* Particle Systems Component */ - DEPSNODE_TYPE_EVAL_PARTICLES, + DEG_NODE_TYPE_EVAL_PARTICLES, /* Material Shading Component */ - DEPSNODE_TYPE_SHADING, + DEG_NODE_TYPE_SHADING, /* Cache Component */ - DEPSNODE_TYPE_CACHE, + DEG_NODE_TYPE_CACHE, } eDepsNode_Type; /* Identifiers for common operations (as an enum). */ diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index 54947ddbb5e..e8dbe8e84eb 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -152,7 +152,7 @@ static void calculate_pending_func(void *data_v, int i) (node->flag & DEPSOP_FLAG_NEEDS_UPDATE) != 0) { foreach (DepsRelation *rel, node->inlinks) { - if (rel->from->type == DEPSNODE_TYPE_OPERATION && + if (rel->from->type == DEG_NODE_TYPE_OPERATION && (rel->flag & DEPSREL_FLAG_CYCLIC) == 0) { OperationDepsNode *from = (OperationDepsNode *)rel->from; @@ -197,7 +197,7 @@ static void calculate_eval_priority(OperationDepsNode *node) foreach (DepsRelation *rel, node->outlinks) { OperationDepsNode *to = (OperationDepsNode *)rel->to; - BLI_assert(to->type == DEPSNODE_TYPE_OPERATION); + BLI_assert(to->type == DEG_NODE_TYPE_OPERATION); calculate_eval_priority(to); node->eval_priority += to->eval_priority; } @@ -265,7 +265,7 @@ static void schedule_children(TaskPool *pool, { foreach (DepsRelation *rel, node->outlinks) { OperationDepsNode *child = (OperationDepsNode *)rel->to; - BLI_assert(child->type == DEPSNODE_TYPE_OPERATION); + BLI_assert(child->type == DEG_NODE_TYPE_OPERATION); if (child->scheduled) { /* Happens when having cyclic dependencies. */ continue; diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index 89a61ecaca9..963c16c3a13 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -165,28 +165,28 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) * layers visibility update has proper flags to work with. */ switch (comp_node->type) { - case DEPSNODE_TYPE_UNDEFINED: - case DEPSNODE_TYPE_OPERATION: - case DEPSNODE_TYPE_ROOT: - case DEPSNODE_TYPE_TIMESOURCE: - case DEPSNODE_TYPE_ID_REF: - case DEPSNODE_TYPE_PARAMETERS: - case DEPSNODE_TYPE_SEQUENCER: + case DEG_NODE_TYPE_UNDEFINED: + case DEG_NODE_TYPE_OPERATION: + case DEG_NODE_TYPE_ROOT: + case DEG_NODE_TYPE_TIMESOURCE: + case DEG_NODE_TYPE_ID_REF: + case DEG_NODE_TYPE_PARAMETERS: + case DEG_NODE_TYPE_SEQUENCER: /* Ignore, does not translate to object component. */ break; - case DEPSNODE_TYPE_ANIMATION: + case DEG_NODE_TYPE_ANIMATION: object->recalc |= OB_RECALC_TIME; break; - case DEPSNODE_TYPE_TRANSFORM: + case DEG_NODE_TYPE_TRANSFORM: object->recalc |= OB_RECALC_OB; break; - case DEPSNODE_TYPE_GEOMETRY: - case DEPSNODE_TYPE_EVAL_POSE: - case DEPSNODE_TYPE_BONE: - case DEPSNODE_TYPE_EVAL_PARTICLES: - case DEPSNODE_TYPE_SHADING: - case DEPSNODE_TYPE_CACHE: - case DEPSNODE_TYPE_PROXY: + case DEG_NODE_TYPE_GEOMETRY: + case DEG_NODE_TYPE_EVAL_POSE: + case DEG_NODE_TYPE_BONE: + case DEG_NODE_TYPE_EVAL_PARTICLES: + case DEG_NODE_TYPE_SHADING: + case DEG_NODE_TYPE_CACHE: + case DEG_NODE_TYPE_PROXY: object->recalc |= OB_RECALC_DATA; break; } diff --git a/source/blender/depsgraph/intern/nodes/deg_node.cc b/source/blender/depsgraph/intern/nodes/deg_node.cc index dc2d1a4e0ae..bd9d0b37e2e 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node.cc @@ -60,9 +60,9 @@ namespace DEG { DepsNode::TypeInfo::TypeInfo(eDepsNode_Type type, const char *tname) { this->type = type; - if (type == DEPSNODE_TYPE_OPERATION) + if (type == DEG_NODE_TYPE_OPERATION) this->tclass = DEPSNODE_CLASS_OPERATION; - else if (type < DEPSNODE_TYPE_PARAMETERS) + else if (type < DEG_NODE_TYPE_PARAMETERS) this->tclass = DEPSNODE_CLASS_GENERIC; else this->tclass = DEPSNODE_CLASS_COMPONENT; @@ -124,19 +124,19 @@ RootDepsNode::~RootDepsNode() TimeSourceDepsNode *RootDepsNode::add_time_source(const char *name) { if (!time_source) { - DepsNodeFactory *factory = deg_get_node_factory(DEPSNODE_TYPE_TIMESOURCE); + DepsNodeFactory *factory = deg_get_node_factory(DEG_NODE_TYPE_TIMESOURCE); time_source = (TimeSourceDepsNode *)factory->create_node(NULL, "", name); /*time_source->owner = this;*/ // XXX } return time_source; } -DEG_DEPSNODE_DEFINE(RootDepsNode, DEPSNODE_TYPE_ROOT, "Root DepsNode"); +DEG_DEPSNODE_DEFINE(RootDepsNode, DEG_NODE_TYPE_ROOT, "Root DepsNode"); static DepsNodeFactoryImpl DNTI_ROOT; /* Time Source Node ======================================= */ -DEG_DEPSNODE_DEFINE(TimeSourceDepsNode, DEPSNODE_TYPE_TIMESOURCE, "Time Source"); +DEG_DEPSNODE_DEFINE(TimeSourceDepsNode, DEG_NODE_TYPE_TIMESOURCE, "Time Source"); static DepsNodeFactoryImpl DNTI_TIMESOURCE; /* ID Node ================================================ */ @@ -262,8 +262,8 @@ void IDDepsNode::tag_update(Depsgraph *graph) GHASH_FOREACH_BEGIN(ComponentDepsNode *, comp_node, components) { /* TODO(sergey): What about drievrs? */ - bool do_component_tag = comp_node->type != DEPSNODE_TYPE_ANIMATION; - if (comp_node->type == DEPSNODE_TYPE_ANIMATION) { + bool do_component_tag = comp_node->type != DEG_NODE_TYPE_ANIMATION; + if (comp_node->type == DEG_NODE_TYPE_ANIMATION) { AnimData *adt = BKE_animdata_from_id(id); /* Animation data might be null if relations are tagged for update. */ if (adt != NULL && (adt->recalc & ADT_RECALC_ANIM)) { @@ -286,7 +286,7 @@ void IDDepsNode::finalize_build() GHASH_FOREACH_END(); } -DEG_DEPSNODE_DEFINE(IDDepsNode, DEPSNODE_TYPE_ID_REF, "ID Node"); +DEG_DEPSNODE_DEFINE(IDDepsNode, DEG_NODE_TYPE_ID_REF, "ID Node"); static DepsNodeFactoryImpl DNTI_ID_REF; void deg_register_base_depsnodes() diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.cc b/source/blender/depsgraph/intern/nodes/deg_node_component.cc index 136c66b9516..ce44a82b75d 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.cc @@ -206,7 +206,7 @@ OperationDepsNode *ComponentDepsNode::add_operation(eDepsOperation_Type optype, { OperationDepsNode *op_node = has_operation(opcode, name, name_tag); if (!op_node) { - DepsNodeFactory *factory = deg_get_node_factory(DEPSNODE_TYPE_OPERATION); + DepsNodeFactory *factory = deg_get_node_factory(DEG_NODE_TYPE_OPERATION); op_node = (OperationDepsNode *)factory->create_node(this->owner->id, "", name); /* register opnode in this component's operation set */ @@ -336,37 +336,37 @@ void ComponentDepsNode::finalize_build() /* Parameter Component Defines ============================ */ -DEG_DEPSNODE_DEFINE(ParametersComponentDepsNode, DEPSNODE_TYPE_PARAMETERS, "Parameters Component"); +DEG_DEPSNODE_DEFINE(ParametersComponentDepsNode, DEG_NODE_TYPE_PARAMETERS, "Parameters Component"); static DepsNodeFactoryImpl DNTI_PARAMETERS; /* Animation Component Defines ============================ */ -DEG_DEPSNODE_DEFINE(AnimationComponentDepsNode, DEPSNODE_TYPE_ANIMATION, "Animation Component"); +DEG_DEPSNODE_DEFINE(AnimationComponentDepsNode, DEG_NODE_TYPE_ANIMATION, "Animation Component"); static DepsNodeFactoryImpl DNTI_ANIMATION; /* Transform Component Defines ============================ */ -DEG_DEPSNODE_DEFINE(TransformComponentDepsNode, DEPSNODE_TYPE_TRANSFORM, "Transform Component"); +DEG_DEPSNODE_DEFINE(TransformComponentDepsNode, DEG_NODE_TYPE_TRANSFORM, "Transform Component"); static DepsNodeFactoryImpl DNTI_TRANSFORM; /* Proxy Component Defines ================================ */ -DEG_DEPSNODE_DEFINE(ProxyComponentDepsNode, DEPSNODE_TYPE_PROXY, "Proxy Component"); +DEG_DEPSNODE_DEFINE(ProxyComponentDepsNode, DEG_NODE_TYPE_PROXY, "Proxy Component"); static DepsNodeFactoryImpl DNTI_PROXY; /* Geometry Component Defines ============================= */ -DEG_DEPSNODE_DEFINE(GeometryComponentDepsNode, DEPSNODE_TYPE_GEOMETRY, "Geometry Component"); +DEG_DEPSNODE_DEFINE(GeometryComponentDepsNode, DEG_NODE_TYPE_GEOMETRY, "Geometry Component"); static DepsNodeFactoryImpl DNTI_GEOMETRY; /* Sequencer Component Defines ============================ */ -DEG_DEPSNODE_DEFINE(SequencerComponentDepsNode, DEPSNODE_TYPE_SEQUENCER, "Sequencer Component"); +DEG_DEPSNODE_DEFINE(SequencerComponentDepsNode, DEG_NODE_TYPE_SEQUENCER, "Sequencer Component"); static DepsNodeFactoryImpl DNTI_SEQUENCER; /* Pose Component ========================================= */ -DEG_DEPSNODE_DEFINE(PoseComponentDepsNode, DEPSNODE_TYPE_EVAL_POSE, "Pose Eval Component"); +DEG_DEPSNODE_DEFINE(PoseComponentDepsNode, DEG_NODE_TYPE_EVAL_POSE, "Pose Eval Component"); static DepsNodeFactoryImpl DNTI_EVAL_POSE; /* Bone Component ========================================= */ @@ -388,22 +388,22 @@ void BoneComponentDepsNode::init(const ID *id, const char *subdata) this->pchan = BKE_pose_channel_find_name(ob->pose, subdata); } -DEG_DEPSNODE_DEFINE(BoneComponentDepsNode, DEPSNODE_TYPE_BONE, "Bone Component"); +DEG_DEPSNODE_DEFINE(BoneComponentDepsNode, DEG_NODE_TYPE_BONE, "Bone Component"); static DepsNodeFactoryImpl DNTI_BONE; /* Particles Component Defines ============================ */ -DEG_DEPSNODE_DEFINE(ParticlesComponentDepsNode, DEPSNODE_TYPE_EVAL_PARTICLES, "Particles Component"); +DEG_DEPSNODE_DEFINE(ParticlesComponentDepsNode, DEG_NODE_TYPE_EVAL_PARTICLES, "Particles Component"); static DepsNodeFactoryImpl DNTI_EVAL_PARTICLES; /* Shading Component Defines ============================ */ -DEG_DEPSNODE_DEFINE(ShadingComponentDepsNode, DEPSNODE_TYPE_SHADING, "Shading Component"); +DEG_DEPSNODE_DEFINE(ShadingComponentDepsNode, DEG_NODE_TYPE_SHADING, "Shading Component"); static DepsNodeFactoryImpl DNTI_SHADING; /* Cache Component Defines ============================ */ -DEG_DEPSNODE_DEFINE(CacheComponentDepsNode, DEPSNODE_TYPE_CACHE, "Cache Component"); +DEG_DEPSNODE_DEFINE(CacheComponentDepsNode, DEG_NODE_TYPE_CACHE, "Cache Component"); static DepsNodeFactoryImpl DNTI_CACHE; diff --git a/source/blender/depsgraph/intern/nodes/deg_node_operation.cc b/source/blender/depsgraph/intern/nodes/deg_node_operation.cc index cbf397bc7a9..5af5ef1b4d1 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_operation.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node_operation.cc @@ -65,7 +65,7 @@ string OperationDepsNode::identifier() const string OperationDepsNode::full_identifier() const { string owner_str = ""; - if (owner->type == DEPSNODE_TYPE_BONE) { + if (owner->type == DEG_NODE_TYPE_BONE) { owner_str = string(owner->owner->name) + "." + owner->name; } else { @@ -84,7 +84,7 @@ void OperationDepsNode::tag_update(Depsgraph *graph) graph->add_entry_tag(this); } -DEG_DEPSNODE_DEFINE(OperationDepsNode, DEPSNODE_TYPE_OPERATION, "Operation"); +DEG_DEPSNODE_DEFINE(OperationDepsNode, DEG_NODE_TYPE_OPERATION, "Operation"); static DepsNodeFactoryImpl DNTI_OPERATION; void deg_register_operation_depsnodes() -- cgit v1.2.3 From 3a7361ec395293477bb395832459339348fb8e8b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 1 Jun 2017 15:42:53 +0200 Subject: Depsgraph: Cleanup, use DEG_NODE_CLASS prefix for node classes --- .../depsgraph/intern/debug/deg_debug_graphviz.cc | 22 +++++++++++----------- source/blender/depsgraph/intern/depsgraph_types.h | 6 +++--- source/blender/depsgraph/intern/nodes/deg_node.cc | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc index 8cc9634f1a3..8da3e097d07 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc @@ -114,9 +114,9 @@ static int deg_debug_node_color_index(const DepsNode *node) } /* Do others based on class. */ switch (node->tclass) { - case DEPSNODE_CLASS_OPERATION: + case DEG_NODE_CLASS_OPERATION: return 4; - case DEPSNODE_CLASS_COMPONENT: + case DEG_NODE_CLASS_COMPONENT: return 1; default: return 9; @@ -200,7 +200,7 @@ static void deg_debug_graphviz_node_color(const DebugContext &ctx, const char *color_update = "dodgerblue3"; const char *color = color_default; if (ctx.show_tags) { - if (node->tclass == DEPSNODE_CLASS_OPERATION) { + if (node->tclass == DEG_NODE_CLASS_OPERATION) { OperationDepsNode *op_node = (OperationDepsNode *)node; if (op_node->flag & DEPSOP_FLAG_DIRECTLY_MODIFIED) { color = color_modified; @@ -221,7 +221,7 @@ static void deg_debug_graphviz_node_penwidth(const DebugContext &ctx, float penwidth_update = 4.0f; float penwidth = penwidth_default; if (ctx.show_tags) { - if (node->tclass == DEPSNODE_CLASS_OPERATION) { + if (node->tclass == DEG_NODE_CLASS_OPERATION) { OperationDepsNode *op_node = (OperationDepsNode *)node; if (op_node->flag & DEPSOP_FLAG_DIRECTLY_MODIFIED) { penwidth = penwidth_modified; @@ -259,7 +259,7 @@ static void deg_debug_graphviz_node_style(const DebugContext &ctx, const DepsNod { const char *base_style = "filled"; /* default style */ if (ctx.show_tags) { - if (node->tclass == DEPSNODE_CLASS_OPERATION) { + if (node->tclass == DEG_NODE_CLASS_OPERATION) { OperationDepsNode *op_node = (OperationDepsNode *)node; if (op_node->flag & (DEPSOP_FLAG_DIRECTLY_MODIFIED | DEPSOP_FLAG_NEEDS_UPDATE)) { base_style = "striped"; @@ -267,13 +267,13 @@ static void deg_debug_graphviz_node_style(const DebugContext &ctx, const DepsNod } } switch (node->tclass) { - case DEPSNODE_CLASS_GENERIC: + case DEG_NODE_CLASS_GENERIC: deg_debug_fprintf(ctx, "\"%s\"", base_style); break; - case DEPSNODE_CLASS_COMPONENT: + case DEG_NODE_CLASS_COMPONENT: deg_debug_fprintf(ctx, "\"%s\"", base_style); break; - case DEPSNODE_CLASS_OPERATION: + case DEG_NODE_CLASS_OPERATION: deg_debug_fprintf(ctx, "\"%s,rounded\"", base_style); break; } @@ -291,7 +291,7 @@ static void deg_debug_graphviz_node_single(const DebugContext &ctx, BLI_snprintf(buf, sizeof(buf), " (Layers: %u)", id_node->layers); name += buf; } - if (ctx.show_eval_priority && node->tclass == DEPSNODE_CLASS_OPERATION) { + if (ctx.show_eval_priority && node->tclass == DEG_NODE_CLASS_OPERATION) { priority = ((OperationDepsNode *)node)->eval_priority; } deg_debug_fprintf(ctx, "// %s\n", name.c_str()); @@ -439,14 +439,14 @@ static bool deg_debug_graphviz_is_owner(const DepsNode *node, const DepsNode *other) { switch (node->tclass) { - case DEPSNODE_CLASS_COMPONENT: + case DEG_NODE_CLASS_COMPONENT: { ComponentDepsNode *comp_node = (ComponentDepsNode *)node; if (comp_node->owner == other) return true; break; } - case DEPSNODE_CLASS_OPERATION: + case DEG_NODE_CLASS_OPERATION: { OperationDepsNode *op_node = (OperationDepsNode *)node; if (op_node->owner == other) diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h index 120ace6a9d8..6de0f8d7506 100644 --- a/source/blender/depsgraph/intern/depsgraph_types.h +++ b/source/blender/depsgraph/intern/depsgraph_types.h @@ -67,16 +67,16 @@ typedef enum eDepsNode_Class { /* Types generally unassociated with user-visible entities, * but needed for graph functioning. */ - DEPSNODE_CLASS_GENERIC = 0, + DEG_NODE_CLASS_GENERIC = 0, /* [Outer Node] An "aspect" of evaluating/updating an ID-Block, requiring * certain types of evaluation behavior. */ - DEPSNODE_CLASS_COMPONENT = 1, + DEG_NODE_CLASS_COMPONENT = 1, /* [Inner Node] A glorified function-pointer/callback for scheduling up * evaluation operations for components, subject to relationship * requirements. */ - DEPSNODE_CLASS_OPERATION = 2, + DEG_NODE_CLASS_OPERATION = 2, } eDepsNode_Class; /* Types of Nodes */ diff --git a/source/blender/depsgraph/intern/nodes/deg_node.cc b/source/blender/depsgraph/intern/nodes/deg_node.cc index bd9d0b37e2e..be4783e616f 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node.cc @@ -61,11 +61,11 @@ DepsNode::TypeInfo::TypeInfo(eDepsNode_Type type, const char *tname) { this->type = type; if (type == DEG_NODE_TYPE_OPERATION) - this->tclass = DEPSNODE_CLASS_OPERATION; + this->tclass = DEG_NODE_CLASS_OPERATION; else if (type < DEG_NODE_TYPE_PARAMETERS) - this->tclass = DEPSNODE_CLASS_GENERIC; + this->tclass = DEG_NODE_CLASS_GENERIC; else - this->tclass = DEPSNODE_CLASS_COMPONENT; + this->tclass = DEG_NODE_CLASS_COMPONENT; this->tname = tname; } -- cgit v1.2.3 From a72daea36eb1585c5e4d7b6911381c53b480b055 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 1 Jun 2017 16:04:35 +0200 Subject: Depsgraph: use explicit marking of component entry/exit operations This isn't used too often, and haivng such API will let us to skip specifying operation type for all oeprations. --- .../depsgraph/intern/builder/deg_builder_nodes.cc | 37 +++++++++++++++------- .../intern/builder/deg_builder_nodes_rig.cc | 27 +++++++++++----- .../depsgraph/intern/nodes/deg_node_component.cc | 23 +++++++------- .../depsgraph/intern/nodes/deg_node_component.h | 7 ++++ .../depsgraph/intern/nodes/deg_node_operation.cc | 12 +++++++ .../depsgraph/intern/nodes/deg_node_operation.h | 7 ++-- 6 files changed, 80 insertions(+), 33 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 3330795d053..78d0b2b323e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -446,10 +446,13 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob) void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob) { + OperationDepsNode *op_node; + /* local transforms (from transform channels - loc/rot/scale + deltas) */ - add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEPSOP_TYPE_INIT, function_bind(BKE_object_eval_local_transform, _1, scene, ob), DEG_OPCODE_TRANSFORM_LOCAL); + op_node->set_as_entry(); /* object parent */ if (ob->parent) { @@ -475,9 +478,10 @@ void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob) DEG_OPCODE_OBJECT_UBEREVAL); /* object transform is done */ - add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEPSOP_TYPE_POST, function_bind(BKE_object_eval_done, _1, ob), DEG_OPCODE_TRANSFORM_FINAL); + op_node->set_as_exit(); } /** @@ -735,18 +739,20 @@ void DepsgraphNodeBuilder::build_shapekeys(Key *key) void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) { ID *obdata = (ID *)ob->data; + OperationDepsNode *op_node; /* TODO(sergey): This way using this object's properties as driver target * works fine. * * Does this depend on other nodes? */ - add_operation_node(&ob->id, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_POST, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); + op_node->set_as_exit(); /* Temporary uber-update node, which does everything. * It is for the being we're porting old dependencies into the new system. @@ -755,18 +761,20 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) * * TODO(sergey): Get rid of this node. */ - add_operation_node(&ob->id, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_POST, function_bind(BKE_object_eval_uber_data, _1, scene, ob), DEG_OPCODE_GEOMETRY_UBEREVAL); + op_node->set_as_exit(); - add_operation_node(&ob->id, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_INIT, NULL, DEG_OPCODE_PLACEHOLDER, "Eval Init"); + op_node->set_as_entry(); // TODO: "Done" operation @@ -821,7 +829,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) //Mesh *me = (Mesh *)ob->data; /* evaluation operations */ - add_operation_node(obdata, + op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_INIT, function_bind(BKE_mesh_eval_geometry, @@ -829,6 +837,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) (Mesh *)obdata), DEG_OPCODE_PLACEHOLDER, "Geometry Eval"); + op_node->set_as_entry(); break; } @@ -840,7 +849,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) if (mom == ob) { /* metaball evaluation operations */ /* NOTE: only the motherball gets evaluated! */ - add_operation_node(obdata, + op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_INIT, function_bind(BKE_mball_eval_geometry, @@ -848,6 +857,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) (MetaBall *)obdata), DEG_OPCODE_PLACEHOLDER, "Geometry Eval"); + op_node->set_as_entry(); } break; } @@ -858,7 +868,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) { /* Curve/nurms evaluation operations. */ /* - calculate curve geometry (including path) */ - add_operation_node(obdata, + op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_INIT, function_bind(BKE_curve_eval_geometry, @@ -866,6 +876,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) (Curve *)obdata), DEG_OPCODE_PLACEHOLDER, "Geometry Eval"); + op_node->set_as_entry(); /* Calculate curve path - this is used by constraints, etc. */ if (ELEM(ob->type, OB_CURVE, OB_FONT)) { @@ -898,7 +909,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) case OB_LATTICE: { /* Lattice evaluation operations. */ - add_operation_node(obdata, + op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_INIT, function_bind(BKE_lattice_eval_geometry, @@ -906,13 +917,15 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) (Lattice *)obdata), DEG_OPCODE_PLACEHOLDER, "Geometry Eval"); + op_node->set_as_entry(); break; } } - add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, + op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_POST, NULL, DEG_OPCODE_PLACEHOLDER, "Eval Done"); + op_node->set_as_exit(); /* Parameters for driver sources. */ add_operation_node(obdata, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, @@ -977,12 +990,14 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree) /* nodetree itself */ ID *ntree_id = &ntree->id; + OperationDepsNode *op_node; build_animdata(ntree_id); /* Parameters for drivers. */ - add_operation_node(ntree_id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_POST, NULL, + op_node = add_operation_node(ntree_id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_POST, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); + op_node->set_as_exit(); /* nodetree's nodes... */ LINKLIST_FOREACH (bNode *, bnode, &ntree->nodes) { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc index 29d80290bd3..00b9ef8bf6a 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -113,6 +113,7 @@ void DepsgraphNodeBuilder::build_splineik_pose(Scene *scene, Object *ob, bPoseCh void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob) { bArmature *arm = (bArmature *)ob->data; + OperationDepsNode *op_node; /* animation and/or drivers linking posebones to base-armature used to define them * NOTE: AnimData here is really used to control animated deform properties, @@ -175,18 +176,21 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob) */ /* pose eval context */ - add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEPSOP_TYPE_INIT, function_bind(BKE_pose_eval_init, _1, scene, ob, ob->pose), DEG_OPCODE_POSE_INIT); + op_node->set_as_entry(); - add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEPSOP_TYPE_POST, function_bind(BKE_pose_eval_flush, _1, scene, ob, ob->pose), DEG_OPCODE_POSE_DONE); + op_node->set_as_exit(); /* bones */ LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { /* node for bone eval */ - add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_INIT, NULL, // XXX: BKE_pose_eval_bone_local DEG_OPCODE_BONE_LOCAL); + op_node->set_as_entry(); add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_EXEC, function_bind(BKE_pose_eval_bone, _1, scene, ob, pchan), // XXX: BKE_pose_eval_bone_pose @@ -196,9 +200,10 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob) DEPSOP_TYPE_OUT, NULL, /* NOTE: dedicated noop for easier relationship construction */ DEG_OPCODE_BONE_READY); - add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_POST, function_bind(BKE_pose_bone_done, _1, pchan), DEG_OPCODE_BONE_DONE); + op_node->set_as_exit(); /* constraints */ if (pchan->constraints.first != NULL) { @@ -236,6 +241,8 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob) void DepsgraphNodeBuilder::build_proxy_rig(Object *ob) { ID *obdata = (ID *)ob->data; + OperationDepsNode *op_node; + build_animdata(obdata); BLI_assert(ob->pose != NULL); @@ -246,31 +253,35 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *ob) BKE_pose_update_constraint_flags(ob->pose); } - add_operation_node(&ob->id, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEPSOP_TYPE_INIT, function_bind(BKE_pose_eval_proxy_copy, _1, ob), DEG_OPCODE_POSE_INIT); + op_node->set_as_entry(); LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { - add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_INIT, NULL, DEG_OPCODE_BONE_LOCAL); + op_node->set_as_entry(); add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_BONE_READY); - add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEPSOP_TYPE_POST, NULL, DEG_OPCODE_BONE_DONE); + op_node->set_as_exit(); } - add_operation_node(&ob->id, + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEPSOP_TYPE_POST, NULL, DEG_OPCODE_POSE_DONE); + op_node->set_as_exit(); } } // namespace DEG diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.cc b/source/blender/depsgraph/intern/nodes/deg_node_component.cc index ce44a82b75d..80a1ce3f98e 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.cc @@ -213,17 +213,6 @@ OperationDepsNode *ComponentDepsNode::add_operation(eDepsOperation_Type optype, OperationIDKey *key = OBJECT_GUARDED_NEW(OperationIDKey, opcode, name, name_tag); BLI_ghash_insert(operations_map, key, op_node); - /* set as entry/exit node of component (if appropriate) */ - if (optype == DEPSOP_TYPE_INIT) { - BLI_assert(this->entry_operation == NULL); - this->entry_operation = op_node; - } - else if (optype == DEPSOP_TYPE_POST) { - // XXX: review whether DEPSOP_TYPE_OUT is better than DEPSOP_TYPE_POST, or maybe have both? - BLI_assert(this->exit_operation == NULL); - this->exit_operation = op_node; - } - /* set backlink */ op_node->owner = this; } @@ -242,6 +231,18 @@ OperationDepsNode *ComponentDepsNode::add_operation(eDepsOperation_Type optype, return op_node; } +void ComponentDepsNode::set_entry_operation(OperationDepsNode *op_node) +{ + BLI_assert(entry_operation == NULL); + entry_operation = op_node; +} + +void ComponentDepsNode::set_exit_operation(OperationDepsNode *op_node) +{ + BLI_assert(exit_operation == NULL); + exit_operation = op_node; +} + void ComponentDepsNode::clear_operations() { if (operations_map != NULL) { diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.h b/source/blender/depsgraph/intern/nodes/deg_node_component.h index 969771a29c9..0eb4e42950c 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.h +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.h @@ -105,6 +105,13 @@ struct ComponentDepsNode : public DepsNode { const char *name, int name_tag); + /* Entry/exit operations management. + * + * Use those instead of direct set since this will perform sanity checks. + */ + void set_entry_operation(OperationDepsNode *op_node); + void set_exit_operation(OperationDepsNode *op_node); + void clear_operations(); void tag_update(Depsgraph *graph); diff --git a/source/blender/depsgraph/intern/nodes/deg_node_operation.cc b/source/blender/depsgraph/intern/nodes/deg_node_operation.cc index 5af5ef1b4d1..7467264f612 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_operation.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node_operation.cc @@ -84,6 +84,18 @@ void OperationDepsNode::tag_update(Depsgraph *graph) graph->add_entry_tag(this); } +void OperationDepsNode::set_as_entry() +{ + BLI_assert(owner != NULL); + owner->set_entry_operation(this); +} + +void OperationDepsNode::set_as_exit() +{ + BLI_assert(owner != NULL); + owner->set_exit_operation(this); +} + DEG_DEPSNODE_DEFINE(OperationDepsNode, DEG_NODE_TYPE_OPERATION, "Operation"); static DepsNodeFactoryImpl DNTI_OPERATION; diff --git a/source/blender/depsgraph/intern/nodes/deg_node_operation.h b/source/blender/depsgraph/intern/nodes/deg_node_operation.h index f5e034734d9..3ff215a31b2 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_operation.h +++ b/source/blender/depsgraph/intern/nodes/deg_node_operation.h @@ -54,8 +54,6 @@ typedef enum eDepsOperation_Flag { /* Atomic Operation - Base type for all operations */ struct OperationDepsNode : public DepsNode { - - OperationDepsNode(); ~OperationDepsNode(); @@ -69,13 +67,16 @@ struct OperationDepsNode : public DepsNode { OperationDepsNode *get_entry_operation() { return this; } OperationDepsNode *get_exit_operation() { return this; } + /* Set this operation as compoonent's entry/exit operation. */ + void set_as_entry(); + void set_as_exit(); + /* Component that contains the operation. */ ComponentDepsNode *owner; /* Callback for operation. */ DepsEvalOperationCb evaluate; - /* How many inlinks are we still waiting on before we can be evaluated. */ uint32_t num_links_pending; float eval_priority; -- cgit v1.2.3 From df7d38c11127cc1ab84c32db645c72b870fe1a40 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 1 Jun 2017 16:15:23 +0200 Subject: Depsgraph: Remove operation types enum Was only used to indicate entry/exit operation of component, which is now done explicitly. No reason to keep something which is unused and confusing. --- .../depsgraph/intern/builder/deg_builder_nodes.cc | 70 ++++++++-------------- .../depsgraph/intern/builder/deg_builder_nodes.h | 3 - .../intern/builder/deg_builder_nodes_rig.cc | 48 +++++++-------- source/blender/depsgraph/intern/depsgraph_types.h | 26 -------- .../depsgraph/intern/nodes/deg_node_component.cc | 4 +- .../depsgraph/intern/nodes/deg_node_component.h | 3 +- .../depsgraph/intern/nodes/deg_node_operation.h | 3 - 7 files changed, 47 insertions(+), 110 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 78d0b2b323e..1e51b8131e4 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -193,7 +193,6 @@ ComponentDepsNode *DepsgraphNodeBuilder::add_component_node( OperationDepsNode *DepsgraphNodeBuilder::add_operation_node( ComponentDepsNode *comp_node, - eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, const char *name, @@ -203,7 +202,7 @@ OperationDepsNode *DepsgraphNodeBuilder::add_operation_node( name, name_tag); if (op_node == NULL) { - op_node = comp_node->add_operation(optype, op, opcode, name, name_tag); + op_node = comp_node->add_operation(op, opcode, name, name_tag); m_graph->operations.push_back(op_node); } else { @@ -221,20 +220,18 @@ OperationDepsNode *DepsgraphNodeBuilder::add_operation_node( ID *id, eDepsNode_Type comp_type, const char *comp_name, - eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, const char *name, int name_tag) { ComponentDepsNode *comp_node = add_component_node(id, comp_type, comp_name); - return add_operation_node(comp_node, optype, op, opcode, name, name_tag); + return add_operation_node(comp_node, op, opcode, name, name_tag); } OperationDepsNode *DepsgraphNodeBuilder::add_operation_node( ID *id, eDepsNode_Type comp_type, - eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, const char *name, @@ -243,7 +240,6 @@ OperationDepsNode *DepsgraphNodeBuilder::add_operation_node( return add_operation_node(id, comp_type, "", - optype, op, opcode, name, @@ -450,14 +446,14 @@ void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob) /* local transforms (from transform channels - loc/rot/scale + deltas) */ op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, - DEPSOP_TYPE_INIT, function_bind(BKE_object_eval_local_transform, _1, scene, ob), + function_bind(BKE_object_eval_local_transform, _1, scene, ob), DEG_OPCODE_TRANSFORM_LOCAL); op_node->set_as_entry(); /* object parent */ if (ob->parent) { add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, - DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_parent, _1, scene, ob), + function_bind(BKE_object_eval_parent, _1, scene, ob), DEG_OPCODE_TRANSFORM_PARENT); } @@ -474,13 +470,13 @@ void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob) * TODO(sergey): Get rid of this node. */ add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, - DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_uber_transform, _1, scene, ob), + function_bind(BKE_object_eval_uber_transform, _1, scene, ob), DEG_OPCODE_OBJECT_UBEREVAL); /* object transform is done */ op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, - DEPSOP_TYPE_POST, function_bind(BKE_object_eval_done, _1, ob), - DEG_OPCODE_TRANSFORM_FINAL); + function_bind(BKE_object_eval_done, _1, ob), + DEG_OPCODE_TRANSFORM_FINAL); op_node->set_as_exit(); } @@ -505,7 +501,7 @@ void DepsgraphNodeBuilder::build_object_constraints(Scene *scene, Object *ob) { /* create node for constraint stack */ add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, - DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_constraints, _1, scene, ob), + function_bind(BKE_object_eval_constraints, _1, scene, ob), DEG_OPCODE_TRANSFORM_CONSTRAINTS); } @@ -528,7 +524,7 @@ void DepsgraphNodeBuilder::build_animdata(ID *id) if ((adt->action) || (adt->nla_tracks.first)) { /* create the node */ add_operation_node(id, DEG_NODE_TYPE_ANIMATION, - DEPSOP_TYPE_EXEC, function_bind(BKE_animsys_eval_animdata, _1, id), + function_bind(BKE_animsys_eval_animdata, _1, id), DEG_OPCODE_ANIMATION, id->name); // TODO: for each channel affected, we might also want to add some support for running RNA update callbacks on them @@ -566,7 +562,6 @@ OperationDepsNode *DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcu) if (driver_op == NULL) { driver_op = add_operation_node(id, DEG_NODE_TYPE_PARAMETERS, - DEPSOP_TYPE_EXEC, function_bind(BKE_animsys_eval_driver, _1, id, fcu), DEG_OPCODE_DRIVER, fcu->rna_path ? fcu->rna_path : "", @@ -595,7 +590,7 @@ void DepsgraphNodeBuilder::build_world(World *world) /* world itself */ add_component_node(world_id, DEG_NODE_TYPE_PARAMETERS); - add_operation_node(world_id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, + add_operation_node(world_id, DEG_NODE_TYPE_PARAMETERS, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); /* textures */ @@ -632,13 +627,13 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene) /* init/rebuild operation */ /*OperationDepsNode *init_node =*/ add_operation_node(&scene->id, DEG_NODE_TYPE_TRANSFORM, - DEPSOP_TYPE_REBUILD, function_bind(BKE_rigidbody_rebuild_sim, _1, scene), + function_bind(BKE_rigidbody_rebuild_sim, _1, scene), DEG_OPCODE_RIGIDBODY_REBUILD); /* do-sim operation */ // XXX: what happens if we need to split into several groups? OperationDepsNode *sim_node = add_operation_node(&scene->id, DEG_NODE_TYPE_TRANSFORM, - DEPSOP_TYPE_SIM, function_bind(BKE_rigidbody_eval_simulation, _1, scene), + function_bind(BKE_rigidbody_eval_simulation, _1, scene), DEG_OPCODE_RIGIDBODY_SIM); /* XXX: For now, the sim node is the only one that really matters here. If any other @@ -659,7 +654,7 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene) /* 2) create operation for flushing results */ /* object's transform component - where the rigidbody operation lives */ add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM, - DEPSOP_TYPE_EXEC, function_bind(BKE_rigidbody_object_sync_transforms, _1, scene, ob), + function_bind(BKE_rigidbody_object_sync_transforms, _1, scene, ob), DEG_OPCODE_TRANSFORM_RIGIDBODY); } } @@ -697,7 +692,6 @@ void DepsgraphNodeBuilder::build_particles(Scene *scene, Object *ob) /* this particle system */ // TODO: for now, this will just be a placeholder "ubereval" node add_operation_node(psys_comp, - DEPSOP_TYPE_EXEC, function_bind(BKE_particle_system_eval, _1, scene, @@ -716,7 +710,6 @@ void DepsgraphNodeBuilder::build_cloth(Scene *scene, Object *object) ComponentDepsNode *cache_comp = add_component_node(&object->id, DEG_NODE_TYPE_CACHE); add_operation_node(cache_comp, - DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_cloth, _1, scene, @@ -730,7 +723,7 @@ void DepsgraphNodeBuilder::build_shapekeys(Key *key) { build_animdata(&key->id); - add_operation_node(&key->id, DEG_NODE_TYPE_GEOMETRY, DEPSOP_TYPE_EXEC, NULL, + add_operation_node(&key->id, DEG_NODE_TYPE_GEOMETRY, NULL, DEG_OPCODE_PLACEHOLDER, "Shapekey Eval"); } @@ -748,7 +741,6 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) */ op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_PARAMETERS, - DEPSOP_TYPE_POST, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); @@ -763,14 +755,12 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) */ op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_GEOMETRY, - DEPSOP_TYPE_POST, function_bind(BKE_object_eval_uber_data, _1, scene, ob), DEG_OPCODE_GEOMETRY_UBEREVAL); op_node->set_as_exit(); op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_GEOMETRY, - DEPSOP_TYPE_INIT, NULL, DEG_OPCODE_PLACEHOLDER, "Eval Init"); @@ -782,7 +772,6 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) LINKLIST_FOREACH (ModifierData *, md, &ob->modifiers) { add_operation_node(&ob->id, DEG_NODE_TYPE_GEOMETRY, - DEPSOP_TYPE_EXEC, function_bind(BKE_object_eval_modifier, _1, scene, @@ -831,7 +820,6 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) /* evaluation operations */ op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, - DEPSOP_TYPE_INIT, function_bind(BKE_mesh_eval_geometry, _1, (Mesh *)obdata), @@ -851,7 +839,6 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) /* NOTE: only the motherball gets evaluated! */ op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, - DEPSOP_TYPE_INIT, function_bind(BKE_mball_eval_geometry, _1, (MetaBall *)obdata), @@ -870,7 +857,6 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) /* - calculate curve geometry (including path) */ op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, - DEPSOP_TYPE_INIT, function_bind(BKE_curve_eval_geometry, _1, (Curve *)obdata), @@ -882,7 +868,6 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) if (ELEM(ob->type, OB_CURVE, OB_FONT)) { add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, - DEPSOP_TYPE_EXEC, function_bind(BKE_curve_eval_path, _1, (Curve *)obdata), @@ -911,7 +896,6 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) /* Lattice evaluation operations. */ op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, - DEPSOP_TYPE_INIT, function_bind(BKE_lattice_eval_geometry, _1, (Lattice *)obdata), @@ -922,13 +906,12 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob) } } - op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, - DEPSOP_TYPE_POST, NULL, - DEG_OPCODE_PLACEHOLDER, "Eval Done"); + op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, NULL, + DEG_OPCODE_PLACEHOLDER, "Eval Done"); op_node->set_as_exit(); /* Parameters for driver sources. */ - add_operation_node(obdata, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, + add_operation_node(obdata, DEG_NODE_TYPE_PARAMETERS, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); } @@ -944,15 +927,13 @@ void DepsgraphNodeBuilder::build_camera(Object *ob) build_animdata(&cam->id); - add_operation_node(camera_id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, + add_operation_node(camera_id, DEG_NODE_TYPE_PARAMETERS, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); if (cam->dof_ob != NULL) { /* TODO(sergey): For now parametrs are on object level. */ - add_operation_node(&ob->id, DEG_NODE_TYPE_PARAMETERS, - DEPSOP_TYPE_EXEC, NULL, - DEG_OPCODE_PLACEHOLDER, - "Camera DOF"); + add_operation_node(&ob->id, DEG_NODE_TYPE_PARAMETERS, NULL, + DEG_OPCODE_PLACEHOLDER, "Camera DOF"); } } @@ -971,7 +952,7 @@ void DepsgraphNodeBuilder::build_lamp(Object *ob) add_component_node(lamp_id, DEG_NODE_TYPE_PARAMETERS); /* TODO(sergey): Is it really how we're supposed to work with drivers? */ - add_operation_node(lamp_id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, NULL, + add_operation_node(lamp_id, DEG_NODE_TYPE_PARAMETERS, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); /* lamp's nodetree */ @@ -995,7 +976,7 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree) build_animdata(ntree_id); /* Parameters for drivers. */ - op_node = add_operation_node(ntree_id, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_POST, NULL, + op_node = add_operation_node(ntree_id, DEG_NODE_TYPE_PARAMETERS, NULL, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); op_node->set_as_exit(); @@ -1036,8 +1017,7 @@ void DepsgraphNodeBuilder::build_material(Material *ma) /* material itself */ add_id_node(ma_id); - add_operation_node(ma_id, DEG_NODE_TYPE_SHADING, - DEPSOP_TYPE_EXEC, NULL, + add_operation_node(ma_id, DEG_NODE_TYPE_SHADING, NULL, DEG_OPCODE_PLACEHOLDER, "Material Update"); /* material animation */ @@ -1094,7 +1074,6 @@ void DepsgraphNodeBuilder::build_image(Image *image) { /* Placeholder so we can add relations and tag ID node for update. */ add_operation_node(image_id, DEG_NODE_TYPE_PARAMETERS, - DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, "Image Eval"); @@ -1131,8 +1110,7 @@ void DepsgraphNodeBuilder::build_cachefile(CacheFile *cache_file) ID *cache_file_id = &cache_file->id; add_component_node(cache_file_id, DEG_NODE_TYPE_CACHE); - add_operation_node(cache_file_id, DEG_NODE_TYPE_CACHE, - DEPSOP_TYPE_EXEC, NULL, + add_operation_node(cache_file_id, DEG_NODE_TYPE_CACHE, NULL, DEG_OPCODE_PLACEHOLDER, "Cache File Update"); add_id_node(cache_file_id); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 5774d8b6aed..ba8a5d01cb0 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -82,7 +82,6 @@ struct DepsgraphNodeBuilder { const char *comp_name = ""); OperationDepsNode *add_operation_node(ComponentDepsNode *comp_node, - eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, const char *name = "", @@ -90,14 +89,12 @@ struct DepsgraphNodeBuilder { OperationDepsNode *add_operation_node(ID *id, eDepsNode_Type comp_type, const char *comp_name, - eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, const char *name = "", int name_tag = -1); OperationDepsNode *add_operation_node(ID *id, eDepsNode_Type comp_type, - eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, const char *name = "", diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc index 00b9ef8bf6a..7ab52c1fd07 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -68,7 +68,6 @@ void DepsgraphNodeBuilder::build_pose_constraints(Scene *scene, Object *ob, bPos { /* create node for constraint stack */ add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, - DEPSOP_TYPE_EXEC, function_bind(BKE_pose_constraints_evaluate, _1, scene, ob, pchan), DEG_OPCODE_BONE_CONSTRAINTS); } @@ -89,7 +88,7 @@ void DepsgraphNodeBuilder::build_ik_pose(Scene *scene, Object *ob, bPoseChannel /* Operation node for evaluating/running IK Solver. */ add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name, - DEPSOP_TYPE_SIM, function_bind(BKE_pose_iktree_evaluate, _1, scene, ob, rootchan), + function_bind(BKE_pose_iktree_evaluate, _1, scene, ob, rootchan), DEG_OPCODE_POSE_IK_SOLVER); } @@ -105,7 +104,7 @@ void DepsgraphNodeBuilder::build_splineik_pose(Scene *scene, Object *ob, bPoseCh * Store the "root bone" of this chain in the solver, so it knows where to start. */ add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name, - DEPSOP_TYPE_SIM, function_bind(BKE_pose_splineik_evaluate, _1, scene, ob, rootchan), + function_bind(BKE_pose_splineik_evaluate, _1, scene, ob, rootchan), DEG_OPCODE_POSE_SPLINE_IK_SOLVER); } @@ -127,7 +126,6 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob) /* Make sure pose is up-to-date with armature updates. */ add_operation_node(&arm->id, DEG_NODE_TYPE_PARAMETERS, - DEPSOP_TYPE_EXEC, NULL, DEG_OPCODE_PLACEHOLDER, "Armature Eval"); @@ -176,33 +174,36 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob) */ /* pose eval context */ - op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, - DEPSOP_TYPE_INIT, function_bind(BKE_pose_eval_init, _1, scene, ob, ob->pose), DEG_OPCODE_POSE_INIT); + op_node = add_operation_node(&ob->id, + DEG_NODE_TYPE_EVAL_POSE, + function_bind(BKE_pose_eval_init, _1, scene, ob, ob->pose), + DEG_OPCODE_POSE_INIT); op_node->set_as_entry(); - op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, - DEPSOP_TYPE_POST, function_bind(BKE_pose_eval_flush, _1, scene, ob, ob->pose), DEG_OPCODE_POSE_DONE); + op_node = add_operation_node(&ob->id, + DEG_NODE_TYPE_EVAL_POSE, + function_bind(BKE_pose_eval_flush, _1, scene, ob, ob->pose), + DEG_OPCODE_POSE_DONE); op_node->set_as_exit(); /* bones */ LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { /* node for bone eval */ - op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, - DEPSOP_TYPE_INIT, NULL, // XXX: BKE_pose_eval_bone_local - DEG_OPCODE_BONE_LOCAL); + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, NULL, + DEG_OPCODE_BONE_LOCAL); op_node->set_as_entry(); add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, - DEPSOP_TYPE_EXEC, function_bind(BKE_pose_eval_bone, _1, scene, ob, pchan), // XXX: BKE_pose_eval_bone_pose + function_bind(BKE_pose_eval_bone, _1, scene, ob, pchan), DEG_OPCODE_BONE_POSE_PARENT); add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, - DEPSOP_TYPE_OUT, NULL, /* NOTE: dedicated noop for easier relationship construction */ + NULL, /* NOTE: dedicated noop for easier relationship construction */ DEG_OPCODE_BONE_READY); op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, - DEPSOP_TYPE_POST, function_bind(BKE_pose_bone_done, _1, pchan), - DEG_OPCODE_BONE_DONE); + function_bind(BKE_pose_bone_done, _1, pchan), + DEG_OPCODE_BONE_DONE); op_node->set_as_exit(); /* constraints */ @@ -255,32 +256,25 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *ob) op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, - DEPSOP_TYPE_INIT, function_bind(BKE_pose_eval_proxy_copy, _1, ob), DEG_OPCODE_POSE_INIT); op_node->set_as_entry(); LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, - DEPSOP_TYPE_INIT, NULL, - DEG_OPCODE_BONE_LOCAL); + NULL, DEG_OPCODE_BONE_LOCAL); op_node->set_as_entry(); add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, - DEPSOP_TYPE_EXEC, NULL, - DEG_OPCODE_BONE_READY); + NULL, DEG_OPCODE_BONE_READY); op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, - DEPSOP_TYPE_POST, NULL, - DEG_OPCODE_BONE_DONE); + NULL, DEG_OPCODE_BONE_DONE); op_node->set_as_exit(); } - op_node = add_operation_node(&ob->id, - DEG_NODE_TYPE_EVAL_POSE, - DEPSOP_TYPE_POST, - NULL, - DEG_OPCODE_POSE_DONE); + op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, + NULL, DEG_OPCODE_POSE_DONE); op_node->set_as_exit(); } diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h index 6de0f8d7506..c6960bf1351 100644 --- a/source/blender/depsgraph/intern/depsgraph_types.h +++ b/source/blender/depsgraph/intern/depsgraph_types.h @@ -252,30 +252,4 @@ protected: /* String defines for these opcodes, defined in depsgraph_type_defines.cpp */ extern DepsOperationStringifier DEG_OPNAMES; -/* Type of operation */ -typedef enum eDepsOperation_Type { - /* **** Primary operation types **** */ - - /* Initialise evaluation data */ - DEPSOP_TYPE_INIT = 0, - /* Standard evaluation step */ - DEPSOP_TYPE_EXEC = 1, - /* Cleanup evaluation data + flush results */ - DEPSOP_TYPE_POST = 2, - - /* **** Additional operation types **** */ - /* Indicator for outputting a temporary result that other components - * can use. // XXX? - */ - DEPSOP_TYPE_OUT = 3, - /* Indicator for things like IK Solvers and Rigidbody Sim steps which - * modify final results of separate entities at once. - */ - DEPSOP_TYPE_SIM = 4, - /* Rebuild internal evaluation data - used for Rigidbody Reset and - * Armature Rebuild-On-Load. - */ - DEPSOP_TYPE_REBUILD = 5, -} eDepsOperation_Type; - } // namespace DEG diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.cc b/source/blender/depsgraph/intern/nodes/deg_node_component.cc index 80a1ce3f98e..0171fd9ac25 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.cc @@ -198,8 +198,7 @@ OperationDepsNode *ComponentDepsNode::has_operation(eDepsOperation_Code opcode, return has_operation(key); } -OperationDepsNode *ComponentDepsNode::add_operation(eDepsOperation_Type optype, - DepsEvalOperationCb op, +OperationDepsNode *ComponentDepsNode::add_operation(DepsEvalOperationCb op, eDepsOperation_Code opcode, const char *name, int name_tag) @@ -224,7 +223,6 @@ OperationDepsNode *ComponentDepsNode::add_operation(eDepsOperation_Type optype, /* attach extra data */ op_node->evaluate = op; - op_node->optype = optype; op_node->opcode = opcode; op_node->name = name; diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.h b/source/blender/depsgraph/intern/nodes/deg_node_component.h index 0eb4e42950c..f476d8ff202 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.h +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.h @@ -99,8 +99,7 @@ struct ComponentDepsNode : public DepsNode { * \param op: The operation to perform * \param name: Identifier for operation - used to find/locate it again */ - OperationDepsNode *add_operation(eDepsOperation_Type optype, - DepsEvalOperationCb op, + OperationDepsNode *add_operation(DepsEvalOperationCb op, eDepsOperation_Code opcode, const char *name, int name_tag); diff --git a/source/blender/depsgraph/intern/nodes/deg_node_operation.h b/source/blender/depsgraph/intern/nodes/deg_node_operation.h index 3ff215a31b2..1e5c3832d03 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_operation.h +++ b/source/blender/depsgraph/intern/nodes/deg_node_operation.h @@ -82,9 +82,6 @@ struct OperationDepsNode : public DepsNode { float eval_priority; bool scheduled; - /* Stage of evaluation */ - eDepsOperation_Type optype; - /* Identifier for the operation being performed. */ eDepsOperation_Code opcode; -- cgit v1.2.3 From e5d8b04abe0524ea31c1ef158a0cfba83e739b04 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 1 Jun 2017 16:20:48 +0200 Subject: Depsgraph: Cleanup, line wraps after shortening API --- .../intern/builder/deg_builder_relations.cc | 116 ++++++--------------- .../intern/builder/deg_builder_relations_rig.cc | 7 +- 2 files changed, 33 insertions(+), 90 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index d2188c94027..736766b5491 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -404,9 +404,7 @@ void DepsgraphRelationBuilder::build_group(Main *bmain, build_object(bmain, scene, go->ob); } ComponentKey dupli_transform_key(&go->ob->id, DEG_NODE_TYPE_TRANSFORM); - add_relation(dupli_transform_key, - object_local_transform_key, - "Dupligroup"); + add_relation(dupli_transform_key, object_local_transform_key, "Dupligroup"); } group_id->tag |= LIB_TAG_DOIT; } @@ -434,9 +432,7 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o build_object_parent(ob); /* local -> parent */ - add_relation(local_transform_key, - parent_transform_key, - "[ObLocal -> ObParent]"); + add_relation(local_transform_key, parent_transform_key, "[ObLocal -> ObParent]"); } if (ob->modifiers.first != NULL) { @@ -471,20 +467,12 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o NULL); /* operation order */ - add_relation(base_op_key, - constraint_key, - "[ObBase-> Constraint Stack]"); - add_relation(constraint_key, - final_transform_key, - "[ObConstraints -> Done]"); + add_relation(base_op_key, constraint_key, "[ObBase-> Constraint Stack]"); + add_relation(constraint_key, final_transform_key, "[ObConstraints -> Done]"); // XXX - add_relation(constraint_key, - ob_ubereval_key, - "Temp Ubereval"); - add_relation(ob_ubereval_key, - final_transform_key, - "Temp Ubereval"); + add_relation(constraint_key, ob_ubereval_key, "Temp Ubereval"); + add_relation(ob_ubereval_key, final_transform_key, "Temp Ubereval"); } else { /* NOTE: Keep an eye here, we skip some relations here to "streamline" @@ -495,28 +483,20 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o /* Rigid body will hook up another node inbetween, so skip * relation here to avoid transitive relation. */ - add_relation(base_op_key, - ob_ubereval_key, - "Temp Ubereval"); + add_relation(base_op_key, ob_ubereval_key, "Temp Ubereval"); } - add_relation(ob_ubereval_key, - final_transform_key, - "Temp Ubereval"); + add_relation(ob_ubereval_key, final_transform_key, "Temp Ubereval"); } - /* AnimData */ build_animdata(&ob->id); // XXX: This should be hooked up by the build_animdata code if (needs_animdata_node(&ob->id)) { ComponentKey adt_key(&ob->id, DEG_NODE_TYPE_ANIMATION); - add_relation(adt_key, - local_transform_key, - "Object Animation"); + add_relation(adt_key, local_transform_key, "Object Animation"); } - /* object data */ if (ob->data) { ID *obdata_id = (ID *)ob->data; @@ -559,9 +539,7 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o if (key != NULL) { ComponentKey geometry_key((ID *)ob->data, DEG_NODE_TYPE_GEOMETRY); ComponentKey key_key(&key->id, DEG_NODE_TYPE_GEOMETRY); - add_relation(key_key, - geometry_key, - "Shapekeys"); + add_relation(key_key, geometry_key, "Shapekeys"); } } @@ -637,12 +615,8 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob) OperationKey parent_transform_key(&ob->parent->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_FINAL); - add_relation(parent_bone_key, - ob_key, - "Bone Parent"); - add_relation(parent_transform_key, - ob_key, - "Armature Parent"); + add_relation(parent_bone_key, ob_key, "Bone Parent"); + add_relation(parent_transform_key, ob_key, "Armature Parent"); break; } @@ -932,16 +906,13 @@ void DepsgraphRelationBuilder::build_animdata(ID *id) DEG_OPCODE_DRIVER, fcu->rna_path ? fcu->rna_path : "", fcu->array_index); - add_relation(prev_driver_key, - driver_key, - "[Driver Order]"); + add_relation(prev_driver_key, driver_key, "[Driver Order]"); } } /* prevent driver from occurring before own animation... */ if (adt->action || adt->nla_tracks.first) { - add_relation(adt_key, driver_key, - "[AnimData Before Drivers]"); + add_relation(adt_key, driver_key, "[AnimData Before Drivers]"); } } } @@ -1172,8 +1143,7 @@ void DepsgraphRelationBuilder::build_world(World *world) build_nodetree(world->nodetree); ComponentKey ntree_key(&world->nodetree->id, DEG_NODE_TYPE_PARAMETERS); ComponentKey world_key(world_id, DEG_NODE_TYPE_PARAMETERS); - add_relation(ntree_key, world_key, - "NTree->World Parameters"); + add_relation(ntree_key, world_key, "NTree->World Parameters"); } } @@ -1191,9 +1161,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) /* time dependency */ TimeSourceKey time_src_key; - add_relation(time_src_key, - init_key, - "TimeSrc -> Rigidbody Reset/Rebuild (Optional)"); + add_relation(time_src_key, init_key, "TimeSrc -> Rigidbody Reset/Rebuild (Optional)"); /* objects - simulation participants */ if (rbw->group) { @@ -1230,9 +1198,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) OperationKey constraint_key(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_CONSTRAINTS); - add_relation(rbo_key, - constraint_key, - "RBO Sync -> Ob Constraints"); + add_relation(rbo_key, constraint_key, "RBO Sync -> Ob Constraints"); } else { /* Final object transform depends on rigidbody. @@ -1243,15 +1209,11 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) OperationKey uber_key(&ob->id, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_OBJECT_UBEREVAL); - add_relation(rbo_key, - uber_key, - "RBO Sync -> Uber (Temp)"); + add_relation(rbo_key, uber_key, "RBO Sync -> Uber (Temp)"); } /* Needed to get correct base values. */ - add_relation(trans_op, - sim_key, - "Base Ob Transform -> Rigidbody Sim Eval"); + add_relation(trans_op, sim_key, "Base Ob Transform -> Rigidbody Sim Eval"); } } @@ -1306,16 +1268,13 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) /* TODO(sergey): Are all particle systems depends on time? * Hair without dynamics i.e. */ - add_relation(time_src_key, psys_key, - "TimeSrc -> PSys"); + add_relation(time_src_key, psys_key, "TimeSrc -> PSys"); /* TODO(sergey): Currently particle update is just a placeholder, * hook it to the ubereval node so particle system is getting updated * on playback. */ - add_relation(psys_key, - obdata_ubereval_key, - "PSys -> UberEval"); + add_relation(psys_key, obdata_ubereval_key, "PSys -> UberEval"); /* collisions */ if (part->type != PART_HAIR) { @@ -1348,9 +1307,7 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) if (part->ren_as == PART_DRAW_OB && part->dup_ob) { ComponentKey dup_ob_key(&part->dup_ob->id, DEG_NODE_TYPE_TRANSFORM); - add_relation(dup_ob_key, - psys_key, - "Particle Object Visualization"); + add_relation(dup_ob_key, psys_key, "Particle Object Visualization"); } } @@ -1361,9 +1318,7 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob) * is implemented. */ ComponentKey transform_key(&ob->id, DEG_NODE_TYPE_TRANSFORM); - add_relation(transform_key, - obdata_ubereval_key, - "Partcile Eval"); + add_relation(transform_key, obdata_ubereval_key, "Partcile Eval"); /* pointcache */ // TODO... @@ -1382,9 +1337,7 @@ void DepsgraphRelationBuilder::build_cloth(Scene * /*scene*/, DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_MODIFIER, md->name); - add_relation(cache_key, - modifier_key, - "Cloth Cache -> Cloth"); + add_relation(cache_key, modifier_key, "Cloth Cache -> Cloth"); } /* Shapekeys */ @@ -1605,8 +1558,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje if (needs_animdata_node(obdata)) { ComponentKey animation_key(obdata, DEG_NODE_TYPE_ANIMATION); ComponentKey parameters_key(obdata, DEG_NODE_TYPE_PARAMETERS); - add_relation(animation_key, parameters_key, - "Geom Parameters"); + add_relation(animation_key, parameters_key, "Geom Parameters"); /* Evaluation usually depends on animation. * TODO(sergey): Need to re-hook it after granular update is implemented.. */ @@ -1629,8 +1581,7 @@ void DepsgraphRelationBuilder::build_camera(Object *ob) if (needs_animdata_node(camera_id)) { ComponentKey animation_key(camera_id, DEG_NODE_TYPE_ANIMATION); - add_relation(animation_key, parameters_key, - "Camera Parameters"); + add_relation(animation_key, parameters_key, "Camera Parameters"); } /* DOF */ @@ -1655,16 +1606,14 @@ void DepsgraphRelationBuilder::build_lamp(Object *ob) if (needs_animdata_node(lamp_id)) { ComponentKey animation_key(lamp_id, DEG_NODE_TYPE_ANIMATION); - add_relation(animation_key, parameters_key, - "Lamp Parameters"); + add_relation(animation_key, parameters_key, "Lamp Parameters"); } /* lamp's nodetree */ if (la->nodetree) { build_nodetree(la->nodetree); ComponentKey nodetree_key(&la->nodetree->id, DEG_NODE_TYPE_PARAMETERS); - add_relation(nodetree_key, parameters_key, - "NTree->Lamp Parameters"); + add_relation(nodetree_key, parameters_key, "NTree->Lamp Parameters"); } /* textures */ @@ -1704,16 +1653,14 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_PLACEHOLDER, "Parameters Eval"); - add_relation(group_parameters_key, parameters_key, - "Group Node"); + add_relation(group_parameters_key, parameters_key, "Group Node"); } } } if (needs_animdata_node(ntree_id)) { ComponentKey animation_key(ntree_id, DEG_NODE_TYPE_ANIMATION); - add_relation(animation_key, parameters_key, - "NTree Parameters"); + add_relation(animation_key, parameters_key, "NTree Parameters"); } } @@ -1743,8 +1690,7 @@ void DepsgraphRelationBuilder::build_material(Material *ma) DEG_NODE_TYPE_SHADING, DEG_OPCODE_PLACEHOLDER, "Material Update"); - add_relation(ntree_key, material_key, - "Material's NTree"); + add_relation(ntree_key, material_key, "Material's NTree"); } } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc index 2e2dc8d5d3e..506eac25188 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -172,8 +172,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, if (!(data->flag & CONSTRAINT_IK_TIP)) { OperationKey tip_transforms_key(&ob->id, DEG_NODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_LOCAL); - add_relation(solver_key, tip_transforms_key, - "IK Solver Result"); + add_relation(solver_key, tip_transforms_key, "IK Solver Result"); parchan = pchan->parent; } @@ -181,8 +180,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, OperationKey parchan_transforms_key(&ob->id, DEG_NODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_READY); - add_relation(parchan_transforms_key, solver_key, - "IK Solver Owner"); + add_relation(parchan_transforms_key, solver_key, "IK Solver Owner"); /* Walk to the chain's root */ //size_t segcount = 0; @@ -375,7 +373,6 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob) add_relation(local_transform_key, pose_key, "Local Transforms"); } - /* links between operations for each bone */ LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { OperationKey bone_local_key(&ob->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); -- cgit v1.2.3