Depsgraph: Cleanup, comments wrapping and spacing between lines
Should make it easier to read. No functional changes expected.
This commit is contained in:
@@ -692,7 +692,7 @@ void DepsgraphRelationBuilder::build_object(Object *object)
|
|||||||
|
|
||||||
const BuilderStack::ScopedEntry stack_entry = stack_.trace(object->id);
|
const BuilderStack::ScopedEntry stack_entry = stack_.trace(object->id);
|
||||||
|
|
||||||
/* Object Transforms */
|
/* Object Transforms. */
|
||||||
OperationCode base_op = (object->parent) ? OperationCode::TRANSFORM_PARENT :
|
OperationCode base_op = (object->parent) ? OperationCode::TRANSFORM_PARENT :
|
||||||
OperationCode::TRANSFORM_LOCAL;
|
OperationCode::TRANSFORM_LOCAL;
|
||||||
OperationKey base_op_key(&object->id, NodeType::TRANSFORM, base_op);
|
OperationKey base_op_key(&object->id, NodeType::TRANSFORM, base_op);
|
||||||
@@ -705,9 +705,12 @@ void DepsgraphRelationBuilder::build_object(Object *object)
|
|||||||
OperationKey final_transform_key(
|
OperationKey final_transform_key(
|
||||||
&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_FINAL);
|
&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_FINAL);
|
||||||
OperationKey ob_eval_key(&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_EVAL);
|
OperationKey ob_eval_key(&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_EVAL);
|
||||||
|
|
||||||
add_relation(init_transform_key, local_transform_key, "Transform Init");
|
add_relation(init_transform_key, local_transform_key, "Transform Init");
|
||||||
|
|
||||||
/* Various flags, flushing from bases/collections. */
|
/* Various flags, flushing from bases/collections. */
|
||||||
build_object_layer_component_relations(object);
|
build_object_layer_component_relations(object);
|
||||||
|
|
||||||
/* Parenting. */
|
/* Parenting. */
|
||||||
if (object->parent != nullptr) {
|
if (object->parent != nullptr) {
|
||||||
/* Make sure parent object's relations are built. */
|
/* Make sure parent object's relations are built. */
|
||||||
@@ -717,30 +720,35 @@ void DepsgraphRelationBuilder::build_object(Object *object)
|
|||||||
/* Local -> parent. */
|
/* Local -> parent. */
|
||||||
add_relation(local_transform_key, parent_transform_key, "ObLocal -> ObParent");
|
add_relation(local_transform_key, parent_transform_key, "ObLocal -> ObParent");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Modifiers. */
|
/* Modifiers. */
|
||||||
if (object->modifiers.first != nullptr) {
|
if (object->modifiers.first != nullptr) {
|
||||||
BuilderWalkUserData data;
|
BuilderWalkUserData data;
|
||||||
data.builder = this;
|
data.builder = this;
|
||||||
BKE_modifiers_foreach_ID_link(object, modifier_walk, &data);
|
BKE_modifiers_foreach_ID_link(object, modifier_walk, &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Grease Pencil Modifiers. */
|
/* Grease Pencil Modifiers. */
|
||||||
if (object->greasepencil_modifiers.first != nullptr) {
|
if (object->greasepencil_modifiers.first != nullptr) {
|
||||||
BuilderWalkUserData data;
|
BuilderWalkUserData data;
|
||||||
data.builder = this;
|
data.builder = this;
|
||||||
BKE_gpencil_modifiers_foreach_ID_link(object, modifier_walk, &data);
|
BKE_gpencil_modifiers_foreach_ID_link(object, modifier_walk, &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Shader FX. */
|
/* Shader FX. */
|
||||||
if (object->shader_fx.first != nullptr) {
|
if (object->shader_fx.first != nullptr) {
|
||||||
BuilderWalkUserData data;
|
BuilderWalkUserData data;
|
||||||
data.builder = this;
|
data.builder = this;
|
||||||
BKE_shaderfx_foreach_ID_link(object, modifier_walk, &data);
|
BKE_shaderfx_foreach_ID_link(object, modifier_walk, &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Constraints. */
|
/* Constraints. */
|
||||||
if (object->constraints.first != nullptr) {
|
if (object->constraints.first != nullptr) {
|
||||||
BuilderWalkUserData data;
|
BuilderWalkUserData data;
|
||||||
data.builder = this;
|
data.builder = this;
|
||||||
BKE_constraints_id_loop(&object->constraints, constraint_walk, &data);
|
BKE_constraints_id_loop(&object->constraints, constraint_walk, &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Object constraints. */
|
/* Object constraints. */
|
||||||
OperationKey object_transform_simulation_init_key(
|
OperationKey object_transform_simulation_init_key(
|
||||||
&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_SIMULATION_INIT);
|
&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_SIMULATION_INIT);
|
||||||
@@ -767,30 +775,39 @@ void DepsgraphRelationBuilder::build_object(Object *object)
|
|||||||
final_transform_key,
|
final_transform_key,
|
||||||
"Simulation -> Final Transform");
|
"Simulation -> Final Transform");
|
||||||
}
|
}
|
||||||
|
|
||||||
build_idproperties(object->id.properties);
|
build_idproperties(object->id.properties);
|
||||||
|
|
||||||
/* Animation data */
|
/* Animation data */
|
||||||
build_animdata(&object->id);
|
build_animdata(&object->id);
|
||||||
|
|
||||||
/* Object data. */
|
/* Object data. */
|
||||||
build_object_data(object);
|
build_object_data(object);
|
||||||
|
|
||||||
/* Particle systems. */
|
/* Particle systems. */
|
||||||
if (object->particlesystem.first != nullptr) {
|
if (object->particlesystem.first != nullptr) {
|
||||||
build_particle_systems(object);
|
build_particle_systems(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Force field Texture. */
|
/* Force field Texture. */
|
||||||
if ((object->pd != nullptr) && (object->pd->forcefield == PFIELD_TEXTURE) &&
|
if ((object->pd != nullptr) && (object->pd->forcefield == PFIELD_TEXTURE) &&
|
||||||
(object->pd->tex != nullptr)) {
|
(object->pd->tex != nullptr)) {
|
||||||
build_texture(object->pd->tex);
|
build_texture(object->pd->tex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Object dupligroup. */
|
/* Object dupligroup. */
|
||||||
if (object->instance_collection != nullptr) {
|
if (object->instance_collection != nullptr) {
|
||||||
build_collection(nullptr, object, object->instance_collection);
|
build_collection(nullptr, object, object->instance_collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Point caches. */
|
/* Point caches. */
|
||||||
build_object_pointcache(object);
|
build_object_pointcache(object);
|
||||||
|
|
||||||
/* Synchronization back to original object. */
|
/* Synchronization back to original object. */
|
||||||
OperationKey synchronize_key(
|
OperationKey synchronize_key(
|
||||||
&object->id, NodeType::SYNCHRONIZATION, OperationCode::SYNCHRONIZE_TO_ORIGINAL);
|
&object->id, NodeType::SYNCHRONIZATION, OperationCode::SYNCHRONIZE_TO_ORIGINAL);
|
||||||
add_relation(final_transform_key, synchronize_key, "Synchronize to Original");
|
add_relation(final_transform_key, synchronize_key, "Synchronize to Original");
|
||||||
|
|
||||||
/* Parameters. */
|
/* Parameters. */
|
||||||
build_parameters(&object->id);
|
build_parameters(&object->id);
|
||||||
}
|
}
|
||||||
@@ -2460,7 +2477,10 @@ void DepsgraphRelationBuilder::build_camera(Camera *camera)
|
|||||||
ComponentKey dof_ob_key(&camera->dof.focus_object->id, NodeType::TRANSFORM);
|
ComponentKey dof_ob_key(&camera->dof.focus_object->id, NodeType::TRANSFORM);
|
||||||
add_relation(dof_ob_key, camera_parameters_key, "Camera DOF");
|
add_relation(dof_ob_key, camera_parameters_key, "Camera DOF");
|
||||||
if (camera->dof.focus_subtarget[0]) {
|
if (camera->dof.focus_subtarget[0]) {
|
||||||
OperationKey target_key(&camera->dof.focus_object->id, NodeType::BONE, camera->dof.focus_subtarget, OperationCode::BONE_DONE);
|
OperationKey target_key(&camera->dof.focus_object->id,
|
||||||
|
NodeType::BONE,
|
||||||
|
camera->dof.focus_subtarget,
|
||||||
|
OperationCode::BONE_DONE);
|
||||||
add_relation(target_key, camera_parameters_key, "Camera DOF subtarget");
|
add_relation(target_key, camera_parameters_key, "Camera DOF subtarget");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,13 +203,16 @@ const char *operationCodeAsString(OperationCode opcode);
|
|||||||
enum OperationFlag {
|
enum OperationFlag {
|
||||||
/* Node needs to be updated. */
|
/* Node needs to be updated. */
|
||||||
DEPSOP_FLAG_NEEDS_UPDATE = (1 << 0),
|
DEPSOP_FLAG_NEEDS_UPDATE = (1 << 0),
|
||||||
|
|
||||||
/* Node was directly modified, causing need for update. */
|
/* Node was directly modified, causing need for update. */
|
||||||
DEPSOP_FLAG_DIRECTLY_MODIFIED = (1 << 1),
|
DEPSOP_FLAG_DIRECTLY_MODIFIED = (1 << 1),
|
||||||
|
|
||||||
/* Node was updated due to user input. */
|
/* Node was updated due to user input. */
|
||||||
DEPSOP_FLAG_USER_MODIFIED = (1 << 2),
|
DEPSOP_FLAG_USER_MODIFIED = (1 << 2),
|
||||||
/* Node may not be removed, even when it has no evaluation callback and no
|
|
||||||
* outgoing relations. This is for NO-OP nodes that are purely used to indicate a
|
/* Node may not be removed, even when it has no evaluation callback and no outgoing relations.
|
||||||
* relation between components/IDs, and not for connecting to an operation. */
|
* This is for NO-OP nodes that are purely used to indicate a relation between components/IDs,
|
||||||
|
* and not for connecting to an operation. */
|
||||||
DEPSOP_FLAG_PINNED = (1 << 3),
|
DEPSOP_FLAG_PINNED = (1 << 3),
|
||||||
|
|
||||||
/* Set of flags which gets flushed along the relations. */
|
/* Set of flags which gets flushed along the relations. */
|
||||||
|
|||||||
Reference in New Issue
Block a user