[Bf-extensions-cvs] [5456f52] master: Enable profiling of the patch update step as well.

Lukas Tönne noreply at git.blender.org
Sat Dec 20 13:17:36 CET 2014


Commit: 5456f5299c6c133881af9298b11c9e8f7158eb3f
Author: Lukas Tönne
Date:   Fri Dec 19 14:11:25 2014 +0100
Branches: master
https://developer.blender.org/rBAC5456f5299c6c133881af9298b11c9e8f7158eb3f

Enable profiling of the patch update step as well.

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

M	object_physics_meadow/meadow.py

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

diff --git a/object_physics_meadow/meadow.py b/object_physics_meadow/meadow.py
index e3f2768..37703b6 100644
--- a/object_physics_meadow/meadow.py
+++ b/object_physics_meadow/meadow.py
@@ -82,6 +82,19 @@ def delete_blobs(context, groundob):
 ### Patch copies for simulation ###
 def make_patches(context, gridob, groundob):
     scene = context.scene
+
+    if use_profiling:
+        prof = cProfile.Profile()
+        prof.enable()
+    
     template_objects = [ob for ob in scene.objects if ob.meadow.type == 'TEMPLATE']
     patch.make_patches(context, groundob, gridob, template_objects)
     blob.setup_blob_duplis(context, groundob, 0.333 * groundob.meadow.patch_radius)
+
+    if use_profiling:
+        prof.disable()
+
+        s = io.StringIO()
+        ps = pstats.Stats(prof, stream=s).sort_stats('tottime')
+        ps.print_stats()
+        print(s.getvalue())



More information about the Bf-extensions-cvs mailing list