Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/collada/BCAnimationSampler.cpp
| Show First 20 Lines • Show All 235 Lines • ▼ Show 20 Lines | |||||
| bool BCAnimationSampler::is_animated_by_constraint(Object *ob, | bool BCAnimationSampler::is_animated_by_constraint(Object *ob, | ||||
| ListBase *conlist, | ListBase *conlist, | ||||
| std::set<Object *> &animated_objects) | std::set<Object *> &animated_objects) | ||||
| { | { | ||||
| bConstraint *con; | bConstraint *con; | ||||
| for (con = (bConstraint *)conlist->first; con; con = con->next) { | for (con = (bConstraint *)conlist->first; con; con = con->next) { | ||||
| ListBase targets = {nullptr, nullptr}; | ListBase targets = {nullptr, nullptr}; | ||||
| const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); | |||||
| if (!bc_validateConstraints(con)) { | if (!bc_validateConstraints(con)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (cti && cti->get_constraint_targets) { | if (BKE_constraint_targets_get(con, &targets)) { | ||||
| bConstraintTarget *ct; | bConstraintTarget *ct; | ||||
| Object *obtar; | Object *obtar; | ||||
| cti->get_constraint_targets(con, &targets); | bool found = false; | ||||
| for (ct = (bConstraintTarget *)targets.first; ct; ct = ct->next) { | for (ct = (bConstraintTarget *)targets.first; ct; ct = ct->next) { | ||||
| obtar = ct->tar; | obtar = ct->tar; | ||||
| if (obtar) { | if (obtar) { | ||||
| if (animated_objects.find(obtar) != animated_objects.end()) { | if (animated_objects.find(obtar) != animated_objects.end()) { | ||||
| return true; | found = true; | ||||
| break; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| BKE_constraint_targets_flush(con, &targets, true); | |||||
| return found; | |||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| void BCAnimationSampler::find_depending_animated(std::set<Object *> &animated_objects, | void BCAnimationSampler::find_depending_animated(std::set<Object *> &animated_objects, | ||||
| std::set<Object *> &candidates) | std::set<Object *> &candidates) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 383 Lines • Show Last 20 Lines | |||||