[Bf-blender-cvs] [86e0485] master: Cleanup: Use more meaningful names and move calculation into am if statement

Sergey Sharybin noreply at git.blender.org
Fri Aug 26 13:58:20 CEST 2016


Commit: 86e0485b2e5e02bbe5465e051afebea9e7838605
Author: Sergey Sharybin
Date:   Fri Aug 26 13:57:46 2016 +0200
Branches: master
https://developer.blender.org/rB86e0485b2e5e02bbe5465e051afebea9e7838605

Cleanup: Use more meaningful names and move calculation into am if statement

===================================================================

M	source/blender/blenkernel/intern/armature_update.c
M	source/blender/blenkernel/intern/scene.c

===================================================================

diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index aebd564..3bc81a6 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -617,9 +617,9 @@ void BKE_pose_eval_bone(EvaluationContext *UNUSED(eval_ctx),
 				/* pass */
 			}
 			else {
-				/* TODO(sergey): Use time source node for time. */
-				float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 				if ((pchan->flag & POSE_DONE) == 0) {
+					/* TODO(sergey): Use time source node for time. */
+					float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 					BKE_pose_where_is_bone(scene, ob, pchan, ctime, 1);
 				}
 			}
@@ -641,8 +641,8 @@ void BKE_pose_constraints_evaluate(EvaluationContext *UNUSED(eval_ctx),
 		/* IK are being solved separately/ */
 	}
 	else {
-		float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 		if ((pchan->flag & POSE_DONE) == 0) {
+			float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 			BKE_pose_where_is_bone(scene, ob, pchan, ctime, 1);
 		}
 	}
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index e610c56..847884e 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1561,8 +1561,8 @@ static void print_threads_statistics(ThreadedObjectUpdateState *state)
 	tot_thread = BLI_system_thread_count();
 
 	for (i = 0; i < tot_thread; i++) {
-		int total_objects = 0;
-		double total_time = 0.0;
+		int thread_total_objects = 0;
+		double thread_total_time = 0.0;
 		StatisicsEntry *entry;
 
 		if (state->has_updated_objects) {
@@ -1571,11 +1571,14 @@ static void print_threads_statistics(ThreadedObjectUpdateState *state)
 			     entry;
 			     entry = entry->next)
 			{
-				total_objects++;
-				total_time += entry->duration;
+				thread_total_objects++;
+				thread_total_time += entry->duration;
 			}
 
-			printf("Thread %d: total %d objects in %f sec.\n", i, total_objects, total_time);
+			printf("Thread %d: total %d objects in %f sec.\n",
+			       i,
+			       thread_total_objects,
+			       thread_total_time);
 
 			for (entry = state->statistics[i].first;
 			     entry;




More information about the Bf-blender-cvs mailing list