|
|
|
|
@@ -327,9 +327,9 @@ static void dag_add_driver_relation(Ipo *ipo, DagForest *dag, DagNode *node, int
|
|
|
|
|
ob = *oba;
|
|
|
|
|
node1 = dag_get_node(dag, ob);
|
|
|
|
|
if (ob->type == OB_ARMATURE)
|
|
|
|
|
dag_add_relation(dag, node1, node, isdata?DAG_RL_DATA_DATA:DAG_RL_DATA_OB);
|
|
|
|
|
dag_add_relation(dag, node1, node, isdata?DAG_RL_DATA_DATA:DAG_RL_DATA_OB, "Python Ipo Driver");
|
|
|
|
|
else
|
|
|
|
|
dag_add_relation(dag, node1, node, isdata?DAG_RL_OB_DATA:DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag, node1, node, isdata?DAG_RL_OB_DATA:DAG_RL_OB_OB, "Python Ipo Driver");
|
|
|
|
|
oba++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -340,9 +340,9 @@ static void dag_add_driver_relation(Ipo *ipo, DagForest *dag, DagNode *node, int
|
|
|
|
|
else if (icu->driver->ob) {
|
|
|
|
|
node1 = dag_get_node(dag, icu->driver->ob);
|
|
|
|
|
if(icu->driver->blocktype==ID_AR)
|
|
|
|
|
dag_add_relation(dag, node1, node, isdata?DAG_RL_DATA_DATA:DAG_RL_DATA_OB);
|
|
|
|
|
dag_add_relation(dag, node1, node, isdata?DAG_RL_DATA_DATA:DAG_RL_DATA_OB, "Ipo Driver");
|
|
|
|
|
else
|
|
|
|
|
dag_add_relation(dag, node1, node, isdata?DAG_RL_OB_DATA:DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag, node1, node, isdata?DAG_RL_OB_DATA:DAG_RL_OB_OB, "Ipo Driver");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -363,7 +363,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
|
|
|
|
|
if ((ob->data) && (mask&DAG_RL_DATA)) {
|
|
|
|
|
node2 = dag_get_node(dag,ob->data);
|
|
|
|
|
dag_add_relation(dag,node,node2,DAG_RL_DATA);
|
|
|
|
|
dag_add_relation(dag,node,node2,DAG_RL_DATA, "Object-Data Relation");
|
|
|
|
|
node2->first_ancestor = ob;
|
|
|
|
|
node2->ancestor_count += 1;
|
|
|
|
|
}
|
|
|
|
|
@@ -388,11 +388,11 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
node3 = dag_get_node(dag, ct->tar);
|
|
|
|
|
|
|
|
|
|
if (ct->subtarget[0])
|
|
|
|
|
dag_add_relation(dag,node3,node, DAG_RL_OB_DATA|DAG_RL_DATA_DATA);
|
|
|
|
|
dag_add_relation(dag,node3,node, DAG_RL_OB_DATA|DAG_RL_DATA_DATA, cti->name);
|
|
|
|
|
else if(ELEM(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO))
|
|
|
|
|
dag_add_relation(dag,node3,node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag,node3,node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, cti->name);
|
|
|
|
|
else
|
|
|
|
|
dag_add_relation(dag,node3,node, DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag,node3,node, DAG_RL_OB_DATA, cti->name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -440,7 +440,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
for(amod= strip->modifiers.first; amod; amod= amod->next) {
|
|
|
|
|
if(amod->ob) {
|
|
|
|
|
node2 = dag_get_node(dag, amod->ob);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "NLA Strip Modifier");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -460,46 +460,46 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
|
|
|
|
|
switch(ob->partype) {
|
|
|
|
|
case PARSKEL:
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Parent");
|
|
|
|
|
break;
|
|
|
|
|
case PARVERT1: case PARVERT3: case PARBONE:
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB, "Vertex Parent");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
if(ob->parent->type==OB_LATTICE)
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Lattice Parent");
|
|
|
|
|
else if(ob->parent->type==OB_CURVE) {
|
|
|
|
|
Curve *cu= ob->parent->data;
|
|
|
|
|
if(cu->flag & CU_PATH)
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB, "Curve Parent");
|
|
|
|
|
else
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Curve Parent");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Curve Parent");
|
|
|
|
|
}
|
|
|
|
|
/* exception case: parent is duplivert */
|
|
|
|
|
if(ob->type==OB_MBALL && (ob->parent->transflag & OB_DUPLIVERTS)) {
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Duplivert");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addtoroot = 0;
|
|
|
|
|
}
|
|
|
|
|
if (ob->track) {
|
|
|
|
|
node2 = dag_get_node(dag,ob->track);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Track To");
|
|
|
|
|
addtoroot = 0;
|
|
|
|
|
}
|
|
|
|
|
if (ob->proxy) {
|
|
|
|
|
node2 = dag_get_node(dag, ob->proxy);
|
|
|
|
|
dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA|DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Proxy");
|
|
|
|
|
/* inverted relation, so addtoroot shouldn't be set to zero */
|
|
|
|
|
}
|
|
|
|
|
if (ob->type==OB_CAMERA) {
|
|
|
|
|
Camera *cam = (Camera *)ob->data;
|
|
|
|
|
if (cam->dof_ob) {
|
|
|
|
|
node2 = dag_get_node(dag, cam->dof_ob);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Camera DoF");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (ob->transflag & OB_DUPLI) {
|
|
|
|
|
@@ -509,7 +509,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
if(go->ob) {
|
|
|
|
|
node2 = dag_get_node(dag, go->ob);
|
|
|
|
|
/* node2 changes node1, this keeps animations updated in groups?? not logical? */
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Dupligroup");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -526,7 +526,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
Object *ob1= base->object;
|
|
|
|
|
if((ob1->pd->deflect) && (ob1 != ob)) {
|
|
|
|
|
node2 = dag_get_node(dag, ob1);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Softbody Collision");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -537,18 +537,18 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
Object *mom= find_basis_mball(ob);
|
|
|
|
|
if(mom!=ob) {
|
|
|
|
|
node2 = dag_get_node(dag, mom);
|
|
|
|
|
dag_add_relation(dag,node,node2,DAG_RL_DATA_DATA|DAG_RL_OB_DATA); // mom depends on children!
|
|
|
|
|
dag_add_relation(dag,node,node2,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Metaball"); // mom depends on children!
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (ob->type==OB_CURVE) {
|
|
|
|
|
Curve *cu= ob->data;
|
|
|
|
|
if(cu->bevobj) {
|
|
|
|
|
node2 = dag_get_node(dag, cu->bevobj);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Bevel");
|
|
|
|
|
}
|
|
|
|
|
if(cu->taperobj) {
|
|
|
|
|
node2 = dag_get_node(dag, cu->taperobj);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Taper");
|
|
|
|
|
}
|
|
|
|
|
if(cu->ipo)
|
|
|
|
|
dag_add_driver_relation(cu->ipo, dag, node, 1);
|
|
|
|
|
@@ -558,7 +558,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
Curve *cu= ob->data;
|
|
|
|
|
if(cu->textoncurve) {
|
|
|
|
|
node2 = dag_get_node(dag, cu->textoncurve);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Texture On Curve");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(ob->type==OB_MESH) {
|
|
|
|
|
@@ -569,7 +569,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
|
|
|
|
|
/* ob location depends on itself */
|
|
|
|
|
if((paf->flag & PAF_STATIC)==0)
|
|
|
|
|
dag_add_relation(dag, node, node, DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag, node, node, DAG_RL_OB_DATA, "Particle-Object Relation");
|
|
|
|
|
|
|
|
|
|
listb= pdInitEffectors(ob, paf->group); /* note, makes copy... */
|
|
|
|
|
if(listb) {
|
|
|
|
|
@@ -580,9 +580,9 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
if(pd->forcefield) {
|
|
|
|
|
node2 = dag_get_node(dag, ob1);
|
|
|
|
|
if(pd->forcefield==PFIELD_GUIDE)
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Particle Field");
|
|
|
|
|
else
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_OB_DATA, "Particle Field");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -599,25 +599,25 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
for(; psys; psys=psys->next) {
|
|
|
|
|
ParticleSettings *part= psys->part;
|
|
|
|
|
|
|
|
|
|
dag_add_relation(dag, node, node, DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag, node, node, DAG_RL_OB_DATA, "Particle-Object Relation");
|
|
|
|
|
|
|
|
|
|
if(part->phystype==PART_PHYS_KEYED && psys->keyed_ob &&
|
|
|
|
|
BLI_findlink(&psys->keyed_ob->particlesystem,psys->keyed_psys-1)) {
|
|
|
|
|
node2 = dag_get_node(dag, psys->keyed_ob);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA, "Particle Keyed Physics");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(part->draw_as == PART_DRAW_OB && part->dup_ob) {
|
|
|
|
|
node2 = dag_get_node(dag, part->dup_ob);
|
|
|
|
|
dag_add_relation(dag, node, node2, DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Object Visualisation");
|
|
|
|
|
if(part->dup_ob->type == OB_MBALL)
|
|
|
|
|
dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA);
|
|
|
|
|
dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA, "Particle Object Visualisation");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(part->draw_as == PART_DRAW_GR && part->dup_group) {
|
|
|
|
|
for(go=part->dup_group->gobject.first; go; go=go->next) {
|
|
|
|
|
node2 = dag_get_node(dag, go->ob);
|
|
|
|
|
dag_add_relation(dag, node, node2, DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Group Visualisation");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -632,22 +632,22 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
if(nec->type & PSYS_EC_EFFECTOR) {
|
|
|
|
|
node2 = dag_get_node(dag, ob1);
|
|
|
|
|
if(ob1->pd->forcefield==PFIELD_GUIDE)
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Particle Field");
|
|
|
|
|
else
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_OB_DATA, "Particle Field");
|
|
|
|
|
}
|
|
|
|
|
else if(nec->type & PSYS_EC_DEFLECT) {
|
|
|
|
|
node2 = dag_get_node(dag, ob1);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Particle Collision");
|
|
|
|
|
}
|
|
|
|
|
else if(nec->type & PSYS_EC_PARTICLE) {
|
|
|
|
|
node2 = dag_get_node(dag, ob1);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA, "Particle Field");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(nec->type & PSYS_EC_REACTOR) {
|
|
|
|
|
node2 = dag_get_node(dag, ob1);
|
|
|
|
|
dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA);
|
|
|
|
|
dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA, "Particle Reactor");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -672,12 +672,12 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
|
|
|
|
|
node2 = dag_get_node(dag, obt);
|
|
|
|
|
if (ELEM(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO))
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, cti->name);
|
|
|
|
|
else {
|
|
|
|
|
if (ELEM3(obt->type, OB_ARMATURE, OB_MESH, OB_LATTICE) && (ct->subtarget[0]))
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, cti->name);
|
|
|
|
|
else
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_OB_OB);
|
|
|
|
|
dag_add_relation(dag, node2, node, DAG_RL_OB_OB, cti->name);
|
|
|
|
|
}
|
|
|
|
|
addtoroot = 0;
|
|
|
|
|
}
|
|
|
|
|
@@ -688,7 +688,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (addtoroot == 1 )
|
|
|
|
|
dag_add_relation(dag,scenenode,node,DAG_RL_SCENE);
|
|
|
|
|
dag_add_relation(dag,scenenode,node,DAG_RL_SCENE, "Scene Relation");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct DagForest *build_dag(struct Scene *sce, short mask)
|
|
|
|
|
@@ -879,7 +879,7 @@ DagNode * dag_get_sub_node (DagForest *forest,void * fob)
|
|
|
|
|
return node;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel)
|
|
|
|
|
void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, char *name)
|
|
|
|
|
{
|
|
|
|
|
DagAdjList *itA = fob1->child;
|
|
|
|
|
|
|
|
|
|
@@ -897,10 +897,11 @@ void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel
|
|
|
|
|
itA->type = rel;
|
|
|
|
|
itA->count = 1;
|
|
|
|
|
itA->next = fob1->child;
|
|
|
|
|
itA->name = name;
|
|
|
|
|
fob1->child = itA;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void dag_add_parent_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel)
|
|
|
|
|
static void dag_add_parent_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, char *name)
|
|
|
|
|
{
|
|
|
|
|
DagAdjList *itA = fob2->parent;
|
|
|
|
|
|
|
|
|
|
@@ -918,9 +919,66 @@ static void dag_add_parent_relation(DagForest *forest, DagNode *fob1, DagNode *f
|
|
|
|
|
itA->type = rel;
|
|
|
|
|
itA->count = 1;
|
|
|
|
|
itA->next = fob2->parent;
|
|
|
|
|
itA->name = name;
|
|
|
|
|
fob2->parent = itA;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *dag_node_name(DagNode *node)
|
|
|
|
|
{
|
|
|
|
|
if(node->ob == NULL)
|
|
|
|
|
return "null";
|
|
|
|
|
else if(ugly_hack_sorry)
|
|
|
|
|
return ((ID*)(node->ob))->name+2;
|
|
|
|
|
else
|
|
|
|
|
return ((bPoseChannel*)(node->ob))->name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
static void dag_node_print_dependencies(DagNode *node)
|
|
|
|
|
{
|
|
|
|
|
DagAdjList *itA;
|
|
|
|
|
|
|
|
|
|
printf("%s depends on:\n", dag_node_name(node));
|
|
|
|
|
|
|
|
|
|
for(itA= node->parent; itA; itA= itA->next)
|
|
|
|
|
printf(" %s through %s\n", dag_node_name(itA->node), itA->name);
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static int dag_node_print_dependency_recurs(DagNode *node, DagNode *endnode)
|
|
|
|
|
{
|
|
|
|
|
DagAdjList *itA;
|
|
|
|
|
|
|
|
|
|
if(node->color == DAG_BLACK)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
node->color= DAG_BLACK;
|
|
|
|
|
|
|
|
|
|
if(node == endnode)
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
for(itA= node->parent; itA; itA= itA->next) {
|
|
|
|
|
if(dag_node_print_dependency_recurs(itA->node, endnode)) {
|
|
|
|
|
printf(" %s depends on %s through %s.\n", dag_node_name(node), dag_node_name(itA->node), itA->name);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void dag_node_print_dependency_cycle(DagForest *dag, DagNode *startnode, DagNode *endnode, char *name)
|
|
|
|
|
{
|
|
|
|
|
DagNode *node;
|
|
|
|
|
|
|
|
|
|
for(node = dag->DagNode.first; node; node= node->next)
|
|
|
|
|
node->color= DAG_WHITE;
|
|
|
|
|
|
|
|
|
|
printf(" %s depends on %s through %s.\n", dag_node_name(endnode), dag_node_name(startnode), name);
|
|
|
|
|
dag_node_print_dependency_recurs(startnode, endnode);
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* MainDAG is the DAG of all objects in current scene
|
|
|
|
|
@@ -2204,9 +2262,10 @@ static void pose_check_cycle(DagForest *dag)
|
|
|
|
|
bPoseChannel *pchan= (bPoseChannel *)node->ob;
|
|
|
|
|
bPoseChannel *parchan= (bPoseChannel *)itA->node->ob;
|
|
|
|
|
|
|
|
|
|
if(pchan && parchan)
|
|
|
|
|
if(pchan->parent!=parchan)
|
|
|
|
|
printf("Cycle in %s to %s\n", pchan->name, parchan->name);
|
|
|
|
|
if(pchan && parchan) {
|
|
|
|
|
printf("Cycle detected:\n");
|
|
|
|
|
dag_node_print_dependency_cycle(dag, itA->node, node, itA->name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -2240,8 +2299,8 @@ void DAG_pose_sort(Object *ob)
|
|
|
|
|
|
|
|
|
|
if(pchan->parent) {
|
|
|
|
|
node2 = dag_get_node(dag, pchan->parent);
|
|
|
|
|
dag_add_relation(dag, node2, node, 0);
|
|
|
|
|
dag_add_parent_relation(dag, node2, node, 0);
|
|
|
|
|
dag_add_relation(dag, node2, node, 0, "Parent Relation");
|
|
|
|
|
dag_add_parent_relation(dag, node2, node, 0, "Parent Relation");
|
|
|
|
|
addtoroot = 0;
|
|
|
|
|
}
|
|
|
|
|
for (con = pchan->constraints.first; con; con=con->next) {
|
|
|
|
|
@@ -2259,8 +2318,8 @@ void DAG_pose_sort(Object *ob)
|
|
|
|
|
bPoseChannel *target= get_pose_channel(ob->pose, icu->driver->name);
|
|
|
|
|
if(target) {
|
|
|
|
|
node2 = dag_get_node(dag, target);
|
|
|
|
|
dag_add_relation(dag, node2, node, 0);
|
|
|
|
|
dag_add_parent_relation(dag, node2, node, 0);
|
|
|
|
|
dag_add_relation(dag, node2, node, 0, "Ipo Driver");
|
|
|
|
|
dag_add_parent_relation(dag, node2, node, 0, "Ipo Driver");
|
|
|
|
|
|
|
|
|
|
/* uncommented this line, results in dependencies
|
|
|
|
|
* not being added properly for this constraint,
|
|
|
|
|
@@ -2279,9 +2338,9 @@ void DAG_pose_sort(Object *ob)
|
|
|
|
|
bPoseChannel *target= get_pose_channel(ob->pose, ct->subtarget);
|
|
|
|
|
if (target) {
|
|
|
|
|
node2= dag_get_node(dag, target);
|
|
|
|
|
dag_add_relation(dag, node2, node, 0);
|
|
|
|
|
dag_add_parent_relation(dag, node2, node, 0);
|
|
|
|
|
|
|
|
|
|
dag_add_relation(dag, node2, node, 0, "IK Constraint");
|
|
|
|
|
dag_add_parent_relation(dag, node2, node, 0, "IK Constraint");
|
|
|
|
|
|
|
|
|
|
if (con->type==CONSTRAINT_TYPE_KINEMATIC) {
|
|
|
|
|
bKinematicConstraint *data = (bKinematicConstraint *)con->data;
|
|
|
|
|
bPoseChannel *parchan;
|
|
|
|
|
@@ -2296,8 +2355,8 @@ void DAG_pose_sort(Object *ob)
|
|
|
|
|
/* Walk to the chain's root */
|
|
|
|
|
while (parchan) {
|
|
|
|
|
node3= dag_get_node(dag, parchan);
|
|
|
|
|
dag_add_relation(dag, node2, node3, 0);
|
|
|
|
|
dag_add_parent_relation(dag, node2, node3, 0);
|
|
|
|
|
dag_add_relation(dag, node2, node3, 0, "IK Constraint");
|
|
|
|
|
dag_add_parent_relation(dag, node2, node3, 0, "IK Constraint");
|
|
|
|
|
|
|
|
|
|
segcount++;
|
|
|
|
|
if (segcount==data->rootbone || segcount>255) break; // 255 is weak
|
|
|
|
|
@@ -2313,8 +2372,8 @@ void DAG_pose_sort(Object *ob)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (addtoroot == 1 ) {
|
|
|
|
|
dag_add_relation(dag, rootnode, node, 0);
|
|
|
|
|
dag_add_parent_relation(dag, rootnode, node, 0);
|
|
|
|
|
dag_add_relation(dag, rootnode, node, 0, "Root Bone Relation");
|
|
|
|
|
dag_add_parent_relation(dag, rootnode, node, 0, "Root Bone Relation");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|