[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46360] trunk/blender/source/blender/ blenkernel/intern: style cleanup: blenkernel

Campbell Barton ideasman42 at gmail.com
Sun May 6 19:22:55 CEST 2012


Revision: 46360
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46360
Author:   campbellbarton
Date:     2012-05-06 17:22:54 +0000 (Sun, 06 May 2012)
Log Message:
-----------
style cleanup: blenkernel

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/anim.c
    trunk/blender/source/blender/blenkernel/intern/blender.c
    trunk/blender/source/blender/blenkernel/intern/bvhutils.c
    trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c
    trunk/blender/source/blender/blenkernel/intern/colortools.c
    trunk/blender/source/blender/blenkernel/intern/constraint.c
    trunk/blender/source/blender/blenkernel/intern/context.c
    trunk/blender/source/blender/blenkernel/intern/depsgraph.c
    trunk/blender/source/blender/blenkernel/intern/displist.c
    trunk/blender/source/blender/blenkernel/intern/fcurve.c
    trunk/blender/source/blender/blenkernel/intern/fmodifier.c
    trunk/blender/source/blender/blenkernel/intern/idprop.c
    trunk/blender/source/blender/blenkernel/intern/image_gen.c
    trunk/blender/source/blender/blenkernel/intern/library.c
    trunk/blender/source/blender/blenkernel/intern/modifier.c
    trunk/blender/source/blender/blenkernel/intern/multires.c
    trunk/blender/source/blender/blenkernel/intern/packedFile.c
    trunk/blender/source/blender/blenkernel/intern/property.c
    trunk/blender/source/blender/blenkernel/intern/texture.c

Modified: trunk/blender/source/blender/blenkernel/intern/anim.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/anim.c	2012-05-06 17:19:16 UTC (rev 46359)
+++ trunk/blender/source/blender/blenkernel/intern/anim.c	2012-05-06 17:22:54 UTC (rev 46360)
@@ -88,23 +88,23 @@
 		return;
 		
 	/* ghosting settings */
-	avs->ghost_bc= avs->ghost_ac= 10;
+	avs->ghost_bc = avs->ghost_ac = 10;
 	
-	avs->ghost_sf= 1; // xxx - take from scene instead?
-	avs->ghost_ef= 250; // xxx - take from scene instead?
+	avs->ghost_sf = 1; // xxx - take from scene instead?
+	avs->ghost_ef = 250; // xxx - take from scene instead?
 	
-	avs->ghost_step= 1;
+	avs->ghost_step = 1;
 	
 	
 	/* path settings */
-	avs->path_bc= avs->path_ac= 10;
+	avs->path_bc = avs->path_ac = 10;
 	
-	avs->path_sf= 1; // xxx - take from scene instead?
-	avs->path_ef= 250; // xxx - take from scene instead?
+	avs->path_sf = 1; // xxx - take from scene instead?
+	avs->path_ef = 250; // xxx - take from scene instead?
 	
-	avs->path_viewflag= (MOTIONPATH_VIEW_KFRAS|MOTIONPATH_VIEW_KFNOS);
+	avs->path_viewflag = (MOTIONPATH_VIEW_KFRAS | MOTIONPATH_VIEW_KFNOS);
 	
-	avs->path_step= 1;
+	avs->path_step = 1;
 }
 
 /* ------------------- */
@@ -121,8 +121,8 @@
 		MEM_freeN(mpath->points);
 	
 	/* reset the relevant parameters */
-	mpath->points= NULL;
-	mpath->length= 0;
+	mpath->points = NULL;
+	mpath->length = 0;
 }
 
 /* Free the given motion path instance and its data 
@@ -162,22 +162,22 @@
 	/* get destination data */
 	if (pchan) {
 		/* paths for posechannel - assume that posechannel belongs to the object */
-		avs= &ob->pose->avs;
-		dst= &pchan->mpath;
+		avs = &ob->pose->avs;
+		dst = &pchan->mpath;
 	}
 	else {
 		/* paths for object */
-		avs= &ob->avs;
-		dst= &ob->mpath;
+		avs = &ob->avs;
+		dst = &ob->mpath;
 	}
 
 	/* avoid 0 size allocs */
 	if (avs->path_sf >= avs->path_ef) {
 		BKE_reportf(reports, RPT_ERROR,
-					"Motion Path frame extents invalid for %s (%d to %d).%s\n",
-					(pchan)? pchan->name : ob->id.name,
-					avs->path_sf, avs->path_ef,
-					(avs->path_sf == avs->path_ef)? " Cannot have single-frame paths." : "");
+		            "Motion Path frame extents invalid for %s (%d to %d).%s\n",
+		            (pchan) ? pchan->name : ob->id.name,
+		            avs->path_sf, avs->path_ef,
+		            (avs->path_sf == avs->path_ef) ? " Cannot have single-frame paths." : "");
 		return NULL;
 	}
 
@@ -187,7 +187,7 @@
 	if (*dst != NULL) {
 		int expected_length = avs->path_ef - avs->path_sf;
 		
-		mpath= *dst;
+		mpath = *dst;
 		
 		/* path is "valid" if length is valid, but must also be of the same length as is being requested */
 		if ((mpath->start_frame != mpath->end_frame) && (mpath->length > 0)) {
@@ -204,15 +204,15 @@
 	}
 	else {
 		/* create a new motionpath, and assign it */
-		mpath= MEM_callocN(sizeof(bMotionPath), "bMotionPath");
-		*dst= mpath;
+		mpath = MEM_callocN(sizeof(bMotionPath), "bMotionPath");
+		*dst = mpath;
 	}
 	
 	/* set settings from the viz settings */
-	mpath->start_frame= avs->path_sf;
-	mpath->end_frame= avs->path_ef;
+	mpath->start_frame = avs->path_sf;
+	mpath->end_frame = avs->path_ef;
 	
-	mpath->length= mpath->end_frame - mpath->start_frame;
+	mpath->length = mpath->end_frame - mpath->start_frame;
 	
 	if (avs->path_bakeflag & MOTIONPATH_BAKE_HEADS)
 		mpath->flag |= MOTIONPATH_FLAG_BHEAD;
@@ -220,7 +220,7 @@
 		mpath->flag &= ~MOTIONPATH_FLAG_BHEAD;
 	
 	/* allocate a cache */
-	mpath->points= MEM_callocN(sizeof(bMotionPathVert)*mpath->length, "bMotionPathVerts");
+	mpath->points = MEM_callocN(sizeof(bMotionPathVert) * mpath->length, "bMotionPathVerts");
 	
 	/* tag viz settings as currently having some path(s) which use it */
 	avs->path_bakeflag |= MOTIONPATH_BAKE_HAS_PATHS;
@@ -235,16 +235,16 @@
 typedef struct MPathTarget {
 	struct MPathTarget *next, *prev;
 	
-	bMotionPath *mpath;			/* motion path in question */
+	bMotionPath *mpath;         /* motion path in question */
 	
-	Object *ob;					/* source object */
-	bPoseChannel *pchan;		/* source posechannel (if applicable) */
+	Object *ob;                 /* source object */
+	bPoseChannel *pchan;        /* source posechannel (if applicable) */
 } MPathTarget;
 
 /* ........ */
 
 /* get list of motion paths to be baked for the given object
- * 	- assumes the given list is ready to be used
+ *  - assumes the given list is ready to be used
  */
 // TODO: it would be nice in future to be able to update objects dependent on these bones too?
 void animviz_get_object_motionpaths(Object *ob, ListBase *targets)
@@ -254,27 +254,27 @@
 	/* object itself first */
 	if ((ob->avs.recalc & ANIMVIZ_RECALC_PATHS) && (ob->mpath)) {
 		/* new target for object */
-		mpt= MEM_callocN(sizeof(MPathTarget), "MPathTarget Ob");
+		mpt = MEM_callocN(sizeof(MPathTarget), "MPathTarget Ob");
 		BLI_addtail(targets, mpt);
 		
-		mpt->mpath= ob->mpath;
-		mpt->ob= ob;
+		mpt->mpath = ob->mpath;
+		mpt->ob = ob;
 	}
 	
 	/* bones */
 	if ((ob->pose) && (ob->pose->avs.recalc & ANIMVIZ_RECALC_PATHS)) {
-		bArmature *arm= ob->data;
+		bArmature *arm = ob->data;
 		bPoseChannel *pchan;
 		
-		for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+		for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
 			if ((pchan->bone) && (arm->layer & pchan->bone->layer) && (pchan->mpath)) {
 				/* new target for bone */
-				mpt= MEM_callocN(sizeof(MPathTarget), "MPathTarget PoseBone");
+				mpt = MEM_callocN(sizeof(MPathTarget), "MPathTarget PoseBone");
 				BLI_addtail(targets, mpt);
 				
-				mpt->mpath= pchan->mpath;
-				mpt->ob= ob;
-				mpt->pchan= pchan;
+				mpt->mpath = pchan->mpath;
+				mpt->ob = ob;
+				mpt->pchan = pchan;
 			}
 		}
 	}
@@ -296,12 +296,12 @@
 	MPathTarget *mpt;
 	
 	/* make sure our temp-tag isn't already in use */
-	for (base= scene->base.first; base; base= base->next)
+	for (base = scene->base.first; base; base = base->next)
 		base->object->flag &= ~BA_TEMP_TAG;
 	
 	/* for each target, dump its object to the start of the list if it wasn't moved already */
-	for (mpt= targets->first; mpt; mpt= mpt->next) {
-		for (base=scene->base.first; base; base=baseNext) {
+	for (mpt = targets->first; mpt; mpt = mpt->next) {
+		for (base = scene->base.first; base; base = baseNext) {
 			baseNext = base->next;
 			
 			if ((base->object == mpt->ob) && !(mpt->ob->flag & BA_TEMP_TAG)) {
@@ -322,7 +322,7 @@
 static void motionpaths_calc_update_scene(Scene *scene)
 {
 #if 1 // 'production' optimisations always on
-	Base *base, *last=NULL;
+	Base *base, *last = NULL;
 	
 	/* only stuff that moves or needs display still */
 	DAG_scene_update_flags(G.main, scene, scene->lay, TRUE);
@@ -331,7 +331,7 @@
 	 *	- all those afterwards are assumed to not be relevant for our calculations
 	 */
 	// optimize further by moving out...
-	for (base=scene->base.first; base; base=base->next) {
+	for (base = scene->base.first; base; base = base->next) {
 		if (base->object->flag & BA_TEMP_TAG)
 			last = base;
 	}
@@ -339,7 +339,7 @@
 	/* perform updates for tagged objects */
 	// XXX: this will break if rigs depend on scene or other data that 
 	// is animated but not attached to/updatable from objects
-	for (base=scene->base.first; base; base=base->next) {
+	for (base = scene->base.first; base; base = base->next) {
 		/* update this object */
 		BKE_object_handle_update(scene, base->object);
 		
@@ -348,11 +348,11 @@
 			break;
 	}
 #else // original, 'always correct' version
-	/* do all updates 
-	 *	- if this is too slow, resort to using a more efficient way 
-	 * 	  that doesn't force complete update, but for now, this is the
-	 *	  most accurate way!
-	 */
+	  /* do all updates
+	   *  - if this is too slow, resort to using a more efficient way
+	   *    that doesn't force complete update, but for now, this is the
+	   *    most accurate way!
+	   */
 	BKE_scene_update_for_newframe(G.main, scene, scene->lay); // XXX this is the best way we can get anything moving
 #endif
 }
@@ -365,8 +365,8 @@
 	MPathTarget *mpt;
 	
 	/* for each target, check if it can be baked on the current frame */
-	for (mpt= targets->first; mpt; mpt= mpt->next) {	
-		bMotionPath *mpath= mpt->mpath;
+	for (mpt = targets->first; mpt; mpt = mpt->next) {
+		bMotionPath *mpath = mpt->mpath;
 		bMotionPathVert *mpv;
 		
 		/* current frame must be within the range the cache works for 
@@ -376,7 +376,7 @@
 			continue;
 		
 		/* get the relevant cache vert to write to */
-		mpv= mpath->points + (CFRA - mpath->start_frame);
+		mpv = mpath->points + (CFRA - mpath->start_frame);
 		
 		/* pose-channel or object path baking? */
 		if (mpt->pchan) {
@@ -421,10 +421,10 @@
 	// TODO: this method could be improved...
 	//	1) max range for standard baking
 	//	2) minimum range for recalc baking (i.e. between keyframes, but how?)
-	for (mpt= targets->first; mpt; mpt= mpt->next) {
+	for (mpt = targets->first; mpt; mpt = mpt->next) {
 		/* try to increase area to do (only as much as needed) */
-		sfra= MIN2(sfra, mpt->mpath->start_frame);
-		efra= MAX2(efra, mpt->mpath->end_frame);
+		sfra = MIN2(sfra, mpt->mpath->start_frame);
+		efra = MAX2(efra, mpt->mpath->end_frame);
 	}
 	if (efra <= sfra) return;
 	
@@ -433,7 +433,7 @@
 	motionpaths_calc_optimise_depsgraph(scene, targets);
 	
 	/* calculate path over requested range */
-	for (CFRA=sfra; CFRA<=efra; CFRA++) {
+	for (CFRA = sfra; CFRA <= efra; CFRA++) {
 		/* update relevant data for new frame */
 		motionpaths_calc_update_scene(scene);
 		
@@ -442,18 +442,18 @@
 	}
 	
 	/* reset original environment */
-	CFRA= cfra;
+	CFRA = cfra;
 	motionpaths_calc_update_scene(scene);
 	
 	/* clear recalc flags from targets */
-	for (mpt= targets->first; mpt; mpt= mpt->next) {
+	for (mpt = targets->first; mpt; mpt = mpt->next) {
 		bAnimVizSettings *avs;
 		
 		/* get pointer to animviz settings for each target */
 		if (mpt->pchan)
-			avs= &mpt->ob->pose->avs;
+			avs = &mpt->ob->pose->avs;
 		else	
-			avs= &mpt->ob->avs;
+			avs = &mpt->ob->avs;
 		
 		/* clear the flag requesting recalculation of targets */
 		avs->recalc &= ~ANIMVIZ_RECALC_PATHS;
@@ -474,7 +474,7 @@
 }
 
 /* calculate a curve-deform path for a curve 
- * 	- only called from displist.c -> do_makeDispListCurveTypes
+ *  - only called from displist.c -> do_makeDispListCurveTypes
  */
 void calc_curvepath(Object *ob)
 {
@@ -485,92 +485,92 @@
 	Nurb *nu;
 	Path *path;
 	float *fp, *dist, *maxdist, xyz[3];
-	float fac, d=0, fac1, fac2;
-	int a, tot, cycl=0;

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list