Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
| Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_action.h" | #include "BKE_action.h" | ||||
| #include "BKE_armature.h" | #include "BKE_armature.h" | ||||
| #include "BKE_animsys.h" | #include "BKE_animsys.h" | ||||
| #include "BKE_collection.h" | #include "BKE_collection.h" | ||||
| #include "BKE_constraint.h" | #include "BKE_constraint.h" | ||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| #include "BKE_effect.h" | #include "BKE_effect.h" | ||||
| #include "BKE_fcurve.h" | #include "BKE_fcurve.h" | ||||
| #include "BKE_gpencil.h" | |||||
| #include "BKE_gpencil_modifier.h" | |||||
| #include "BKE_idcode.h" | #include "BKE_idcode.h" | ||||
| #include "BKE_key.h" | #include "BKE_key.h" | ||||
| #include "BKE_lattice.h" | #include "BKE_lattice.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_mask.h" | #include "BKE_mask.h" | ||||
| #include "BKE_material.h" | #include "BKE_material.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_mball.h" | #include "BKE_mball.h" | ||||
| #include "BKE_modifier.h" | #include "BKE_modifier.h" | ||||
| #include "BKE_movieclip.h" | #include "BKE_movieclip.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "BKE_pointcache.h" | #include "BKE_pointcache.h" | ||||
| #include "BKE_rigidbody.h" | #include "BKE_rigidbody.h" | ||||
| #include "BKE_shader_fx.h" | |||||
| #include "BKE_sound.h" | #include "BKE_sound.h" | ||||
| #include "BKE_tracking.h" | #include "BKE_tracking.h" | ||||
| #include "BKE_world.h" | #include "BKE_world.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_types.h" | #include "RNA_types.h" | ||||
| } /* extern "C" */ | } /* extern "C" */ | ||||
| ▲ Show 20 Lines • Show All 405 Lines • ▼ Show 20 Lines | if (object->parent != NULL) { | ||||
| build_object(-1, object->parent, DEG_ID_LINKED_INDIRECTLY); | build_object(-1, object->parent, DEG_ID_LINKED_INDIRECTLY); | ||||
| } | } | ||||
| /* Modifiers. */ | /* Modifiers. */ | ||||
| if (object->modifiers.first != NULL) { | if (object->modifiers.first != NULL) { | ||||
| BuilderWalkUserData data; | BuilderWalkUserData data; | ||||
| data.builder = this; | data.builder = this; | ||||
| modifiers_foreachIDLink(object, modifier_walk, &data); | modifiers_foreachIDLink(object, modifier_walk, &data); | ||||
| } | } | ||||
| /* Grease Pencil Modifiers. */ | |||||
| if (object->greasepencil_modifiers.first != NULL) { | |||||
| BuilderWalkUserData data; | |||||
| data.builder = this; | |||||
| BKE_gpencil_modifiers_foreachIDLink(object, modifier_walk, &data); | |||||
| } | |||||
| /* Shadr FX. */ | |||||
| if (object->shader_fx.first != NULL) { | |||||
| BuilderWalkUserData data; | |||||
| data.builder = this; | |||||
| BKE_shaderfx_foreachIDLink(object, modifier_walk, &data); | |||||
| } | |||||
| /* Constraints. */ | /* Constraints. */ | ||||
| if (object->constraints.first != NULL) { | if (object->constraints.first != NULL) { | ||||
| 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 data. */ | /* Object data. */ | ||||
| build_object_data(object); | build_object_data(object); | ||||
| /* Build animation data, | /* Build animation data, | ||||
| * | * | ||||
| * Do it now because it's possible object data will affect | * Do it now because it's possible object data will affect | ||||
| * on object's level animation, for example in case of rebuilding | * on object's level animation, for example in case of rebuilding | ||||
| * pose for proxy. | * pose for proxy. | ||||
| */ | */ | ||||
| OperationDepsNode *op_node = add_operation_node(&object->id, | OperationDepsNode *op_node = add_operation_node(&object->id, | ||||
| DEG_NODE_TYPE_PARAMETERS, | DEG_NODE_TYPE_PARAMETERS, | ||||
| NULL, | NULL, | ||||
| DEG_OPCODE_PARAMETERS_EVAL); | DEG_OPCODE_PARAMETERS_EVAL); | ||||
| op_node->set_as_exit(); | op_node->set_as_exit(); | ||||
| build_animdata(&object->id); | build_animdata(&object->id); | ||||
| /* Particle systems. */ | /* Particle systems. */ | ||||
| if (object->particlesystem.first != NULL) { | if (object->particlesystem.first != NULL) { | ||||
| build_particles(object); | build_particles(object); | ||||
| } | } | ||||
| /* Grease pencil. */ | |||||
| if (object->gpd != NULL) { | |||||
| build_gpencil(object->gpd); | |||||
| } | |||||
| /* Proxy object to copy from. */ | /* Proxy object to copy from. */ | ||||
| if (object->proxy_from != NULL) { | if (object->proxy_from != NULL) { | ||||
| build_object(-1, object->proxy_from, DEG_ID_LINKED_INDIRECTLY); | build_object(-1, object->proxy_from, DEG_ID_LINKED_INDIRECTLY); | ||||
| } | } | ||||
| if (object->proxy_group != NULL) { | if (object->proxy_group != NULL) { | ||||
| build_object(-1, object->proxy_group, DEG_ID_LINKED_INDIRECTLY); | build_object(-1, object->proxy_group, DEG_ID_LINKED_INDIRECTLY); | ||||
| } | } | ||||
| /* Object dupligroup. */ | /* Object dupligroup. */ | ||||
| Show All 34 Lines | void DepsgraphNodeBuilder::build_object_data(Object *object) | ||||
| /* type-specific data. */ | /* type-specific data. */ | ||||
| switch (object->type) { | switch (object->type) { | ||||
| case OB_MESH: | case OB_MESH: | ||||
| case OB_CURVE: | case OB_CURVE: | ||||
| case OB_FONT: | case OB_FONT: | ||||
| case OB_SURF: | case OB_SURF: | ||||
| case OB_MBALL: | case OB_MBALL: | ||||
| case OB_LATTICE: | case OB_LATTICE: | ||||
| case OB_GPENCIL: | |||||
| build_object_data_geometry(object); | build_object_data_geometry(object); | ||||
| /* TODO(sergey): Only for until we support granular | /* TODO(sergey): Only for until we support granular | ||||
| * update of curves. | * update of curves. | ||||
| */ | */ | ||||
| if (object->type == OB_FONT) { | if (object->type == OB_FONT) { | ||||
| Curve *curve = (Curve *)object->data; | Curve *curve = (Curve *)object->data; | ||||
| if (curve->textoncurve) { | if (curve->textoncurve) { | ||||
| id_node->eval_flags |= DAG_EVAL_NEED_CURVE_PATH; | id_node->eval_flags |= DAG_EVAL_NEED_CURVE_PATH; | ||||
| ▲ Show 20 Lines • Show All 605 Lines • ▼ Show 20 Lines | case ID_LT: | ||||
| function_bind(BKE_lattice_eval_geometry, | function_bind(BKE_lattice_eval_geometry, | ||||
| _1, | _1, | ||||
| (Lattice *)obdata_cow), | (Lattice *)obdata_cow), | ||||
| DEG_OPCODE_PLACEHOLDER, | DEG_OPCODE_PLACEHOLDER, | ||||
| "Geometry Eval"); | "Geometry Eval"); | ||||
| op_node->set_as_entry(); | op_node->set_as_entry(); | ||||
| break; | break; | ||||
| } | } | ||||
| case ID_GD: | |||||
| { | |||||
| /* GPencil evaluation operations. */ | |||||
| op_node = add_operation_node(obdata, | |||||
| DEG_NODE_TYPE_GEOMETRY, | |||||
| function_bind(BKE_gpencil_eval_geometry, | |||||
| _1, | |||||
| (bGPdata *)obdata_cow), | |||||
| DEG_OPCODE_PLACEHOLDER, | |||||
| "Geometry Eval"); | |||||
| op_node->set_as_entry(); | |||||
| break; | |||||
| } | |||||
| default: | default: | ||||
| BLI_assert(!"Should not happen"); | BLI_assert(!"Should not happen"); | ||||
| break; | break; | ||||
| } | } | ||||
| op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, NULL, | op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, NULL, | ||||
| DEG_OPCODE_PLACEHOLDER, "Eval Done"); | DEG_OPCODE_PLACEHOLDER, "Eval Done"); | ||||
| op_node->set_as_exit(); | op_node->set_as_exit(); | ||||
| /* Parameters for driver sources. */ | /* Parameters for driver sources. */ | ||||
| ▲ Show 20 Lines • Show All 339 Lines • Show Last 20 Lines | |||||