Merge remote-tracking branch 'origin' into blender2.8
[blender.git] / source / blender / collada / AnimationExporter.cpp
index 9c65aa4d2c5a20d3bff66048184953dc3efec345..53c1afd173f32df2f2c7a14395383992715c00d3 100644 (file)
@@ -1928,15 +1928,21 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i
 
 bool AnimationExporter::validateConstraints(bConstraint *con)
 {
-       bool valid = true;
        const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
        /* these we can skip completely (invalid constraints...) */
-       if (cti == NULL) valid = false;
-       if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) valid = false;
+       if (cti == NULL)
+               return false;
+       if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF))
+               return false;
+
        /* these constraints can't be evaluated anyway */
-       if (cti->evaluate_constraint == NULL) valid = false;
+       if (cti->evaluate_constraint == NULL)
+               return false;
+
        /* influence == 0 should be ignored */
-       if (con->enforce == 0.0f) valid = false;
+       if (con->enforce == 0.0f)
+               return false;
 
-       return valid;
+       /* validation passed */
+       return true;
 }