[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48207] branches/soc-2012-bratwurst/source /blender/collada: Refactoring.

Sukhitha Jayathilake pr.jayathilake at gmail.com
Fri Jun 22 20:19:31 CEST 2012


Revision: 48207
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48207
Author:   phabtar
Date:     2012-06-22 18:19:30 +0000 (Fri, 22 Jun 2012)
Log Message:
-----------
Refactoring.

Modified Paths:
--------------
    branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.cpp
    branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.h

Modified: branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.cpp
===================================================================
--- branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.cpp	2012-06-22 17:51:47 UTC (rev 48206)
+++ branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.cpp	2012-06-22 18:19:30 UTC (rev 48207)
@@ -154,17 +154,11 @@
 	bConstraint *con;
 	for (con = (bConstraint*)conlist->first; con; con = con->next) {
 		ListBase targets = {NULL, NULL};
+		
 		bConstraintTypeInfo *cti = constraint_get_typeinfo(con);
-		/* these we can skip completely (invalid constraints...) */
-		if (cti == NULL) continue;
-		if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) continue;
-		/* these constraints can't be evaluated anyway */
-		if (cti->evaluate_constraint == NULL) continue;
-		/* influence == 0 should be ignored */
-		if (con->enforce == 0.0f) continue;
 		
-		
-	
+		if(!validateConstraints(con)) continue;
+
 		if (cti && cti->get_constraint_targets) {
 			bConstraintTarget *ct;
 			Object *obtar;
@@ -1410,3 +1404,18 @@
 
 	enable_fcurves(ob_arm->adt->action, NULL);
 }
+
+bool AnimationExporter::validateConstraints(bConstraint *con){
+	
+	bool valid = true;
+	bConstraintTypeInfo *cti = constraint_get_typeinfo(con);
+	/* these we can skip completely (invalid constraints...) */
+	if (cti == NULL) valid = false;
+	if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) valid = false;
+	/* these constraints can't be evaluated anyway */
+	if (cti->evaluate_constraint == NULL) valid = false;
+	/* influence == 0 should be ignored */
+	if (con->enforce == 0.0f) valid = false;
+
+	return valid;
+}
\ No newline at end of file

Modified: branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.h
===================================================================
--- branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.h	2012-06-22 17:51:47 UTC (rev 48206)
+++ branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.h	2012-06-22 18:19:30 UTC (rev 48207)
@@ -175,4 +175,6 @@
 	std::string getObjectBoneName(Object *ob, const FCurve * fcu);
 
 	void getBakedPoseData(Object *obarm, int startFrame, int endFrame, bool ActionBake, bool ActionBakeFirstFrame);
+
+	bool validateConstraints(bConstraint *con);
 };




More information about the Bf-blender-cvs mailing list