Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
| Show First 20 Lines • Show All 1,246 Lines • ▼ Show 20 Lines | void DepsgraphRelationBuilder::build_animdata(ID *id) | ||||
| build_animdata_curves(id); | build_animdata_curves(id); | ||||
| /* Drivers. */ | /* Drivers. */ | ||||
| build_animdata_drivers(id); | build_animdata_drivers(id); | ||||
| if (check_id_has_anim_component(id)) { | if (check_id_has_anim_component(id)) { | ||||
| ComponentKey animation_key(id, NodeType::ANIMATION); | ComponentKey animation_key(id, NodeType::ANIMATION); | ||||
| ComponentKey parameters_key(id, NodeType::PARAMETERS); | ComponentKey parameters_key(id, NodeType::PARAMETERS); | ||||
| add_relation(animation_key, parameters_key, "Animation -> Parameters"); | add_relation(animation_key, parameters_key, "Animation -> Parameters"); | ||||
| build_animdata_force(id); | |||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_animdata_curves(ID *id) | void DepsgraphRelationBuilder::build_animdata_curves(ID *id) | ||||
| { | { | ||||
| AnimData *adt = BKE_animdata_from_id(id); | AnimData *adt = BKE_animdata_from_id(id); | ||||
| if (adt == nullptr) { | if (adt == nullptr) { | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | void DepsgraphRelationBuilder::build_animation_images(ID *id) | ||||
| if (BKE_image_user_id_has_animation(id)) { | if (BKE_image_user_id_has_animation(id)) { | ||||
| OperationKey image_animation_key( | OperationKey image_animation_key( | ||||
| id, NodeType::IMAGE_ANIMATION, OperationCode::IMAGE_ANIMATION); | id, NodeType::IMAGE_ANIMATION, OperationCode::IMAGE_ANIMATION); | ||||
| TimeSourceKey time_src_key; | TimeSourceKey time_src_key; | ||||
| add_relation(time_src_key, image_animation_key, "TimeSrc -> Image Animation"); | add_relation(time_src_key, image_animation_key, "TimeSrc -> Image Animation"); | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_animdata_force(ID *id) | |||||
| { | |||||
| if (GS(id->name) != ID_OB) { | |||||
| return; | |||||
| } | |||||
| const Object *object = (Object *)id; | |||||
| if (object->pd == nullptr || object->pd->forcefield == PFIELD_NULL) { | |||||
| return; | |||||
| } | |||||
| /* Updates to animation data (in the UI, for example by altering FCurve Modifier parameters | |||||
| * animating force field strength) may need to rebuild the rigid body world. */ | |||||
| ComponentKey animation_key(id, NodeType::ANIMATION); | |||||
| OperationKey rigidbody_key(&scene_->id, NodeType::TRANSFORM, OperationCode::RIGIDBODY_REBUILD); | |||||
| add_relation(animation_key, rigidbody_key, "Animation -> Rigid Body"); | |||||
| } | |||||
| void DepsgraphRelationBuilder::build_action(bAction *action) | void DepsgraphRelationBuilder::build_action(bAction *action) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(action)) { | if (built_map_.checkIsBuiltAndTag(action)) { | ||||
| return; | return; | ||||
| } | } | ||||
| build_idproperties(action->id.properties); | build_idproperties(action->id.properties); | ||||
| if (!BLI_listbase_is_empty(&action->curves)) { | if (!BLI_listbase_is_empty(&action->curves)) { | ||||
| TimeSourceKey time_src_key; | TimeSourceKey time_src_key; | ||||
| ▲ Show 20 Lines • Show All 1,511 Lines • Show Last 20 Lines | |||||