Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.cc
| Show First 20 Lines • Show All 2,542 Lines • ▼ Show 20 Lines | static void copy_object_pose(Object *obn, const Object *ob, const int flag) | ||||
| LISTBASE_FOREACH (bPoseChannel *, chan, &obn->pose->chanbase) { | LISTBASE_FOREACH (bPoseChannel *, chan, &obn->pose->chanbase) { | ||||
| chan->flag &= ~(POSE_LOC | POSE_ROT | POSE_SIZE); | chan->flag &= ~(POSE_LOC | POSE_ROT | POSE_SIZE); | ||||
| /* XXX Remapping object pointing onto itself should be handled by generic | /* XXX Remapping object pointing onto itself should be handled by generic | ||||
| * BKE_library_remap stuff, but... | * BKE_library_remap stuff, but... | ||||
| * the flush_constraint_targets callback am not sure about, so will delay that for now. */ | * the flush_constraint_targets callback am not sure about, so will delay that for now. */ | ||||
| LISTBASE_FOREACH (bConstraint *, con, &chan->constraints) { | LISTBASE_FOREACH (bConstraint *, con, &chan->constraints) { | ||||
| const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); | |||||
| ListBase targets = {nullptr, nullptr}; | ListBase targets = {nullptr, nullptr}; | ||||
| if (cti && cti->get_constraint_targets) { | if (BKE_constraint_targets_get(con, &targets)) { | ||||
| cti->get_constraint_targets(con, &targets); | |||||
| LISTBASE_FOREACH (bConstraintTarget *, ct, &targets) { | LISTBASE_FOREACH (bConstraintTarget *, ct, &targets) { | ||||
| if (ct->tar == ob) { | if (ct->tar == ob) { | ||||
| ct->tar = obn; | ct->tar = obn; | ||||
| } | } | ||||
| } | } | ||||
| if (cti->flush_constraint_targets) { | BKE_constraint_targets_flush(con, &targets, false); | ||||
| cti->flush_constraint_targets(con, &targets, false); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| bool BKE_object_pose_context_check(const Object *ob) | bool BKE_object_pose_context_check(const Object *ob) | ||||
| { | { | ||||
| if ((ob) && (ob->type == OB_ARMATURE) && (ob->pose) && (ob->mode & OB_MODE_POSE)) { | if ((ob) && (ob->type == OB_ARMATURE) && (ob->pose) && (ob->mode & OB_MODE_POSE)) { | ||||
| ▲ Show 20 Lines • Show All 3,093 Lines • ▼ Show 20 Lines | if (parent_recursion) { | ||||
| /* skip subframe if object is parented | /* skip subframe if object is parented | ||||
| * to vertex of a dynamic paint canvas */ | * to vertex of a dynamic paint canvas */ | ||||
| if (no_update && (ELEM(ob->partype, PARVERT1, PARVERT3))) { | if (no_update && (ELEM(ob->partype, PARVERT1, PARVERT3))) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* also update constraint targets */ | /* also update constraint targets */ | ||||
| LISTBASE_FOREACH (bConstraint *, con, &ob->constraints) { | LISTBASE_FOREACH (bConstraint *, con, &ob->constraints) { | ||||
| const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); | |||||
| ListBase targets = {nullptr, nullptr}; | ListBase targets = {nullptr, nullptr}; | ||||
| if (cti && cti->get_constraint_targets) { | if (BKE_constraint_targets_get(con, &targets)) { | ||||
| cti->get_constraint_targets(con, &targets); | |||||
| LISTBASE_FOREACH (bConstraintTarget *, ct, &targets) { | LISTBASE_FOREACH (bConstraintTarget *, ct, &targets) { | ||||
| if (ct->tar) { | if (ct->tar) { | ||||
| BKE_object_modifier_update_subframe( | BKE_object_modifier_update_subframe( | ||||
| depsgraph, scene, ct->tar, false, recursion, frame, type); | depsgraph, scene, ct->tar, false, recursion, frame, type); | ||||
| } | } | ||||
| } | } | ||||
| /* free temp targets */ | /* free temp targets */ | ||||
| if (cti->flush_constraint_targets) { | BKE_constraint_targets_flush(con, &targets, false); | ||||
| cti->flush_constraint_targets(con, &targets, false); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* was originally ID_RECALC_ALL - TODO: which flags are really needed??? */ | /* was originally ID_RECALC_ALL - TODO: which flags are really needed??? */ | ||||
| /* TODO(sergey): What about animation? */ | /* TODO(sergey): What about animation? */ | ||||
| const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(depsgraph, | const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(depsgraph, | ||||
| frame); | frame); | ||||
| ▲ Show 20 Lines • Show All 131 Lines • Show Last 20 Lines | |||||