[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4726] contrib/py/scripts/addons/ oscurart_mesh_cache_tools.py: Add Progress Bar!

Eugenio Pignataro info at oscurart.com.ar
Mon Sep 2 17:06:38 CEST 2013


Revision: 4726
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4726
Author:   oscurart
Date:     2013-09-02 15:06:38 +0000 (Mon, 02 Sep 2013)
Log Message:
-----------
Add Progress Bar!

Modified Paths:
--------------
    contrib/py/scripts/addons/oscurart_mesh_cache_tools.py

Modified: contrib/py/scripts/addons/oscurart_mesh_cache_tools.py
===================================================================
--- contrib/py/scripts/addons/oscurart_mesh_cache_tools.py	2013-09-02 07:46:31 UTC (rev 4725)
+++ contrib/py/scripts/addons/oscurart_mesh_cache_tools.py	2013-09-02 15:06:38 UTC (rev 4726)
@@ -63,6 +63,7 @@
 
     for ob in bpy.data.groups[bpy.context.scene.muu_pc2_group].objects[:]:
         pc2list = []
+        bpy.context.window_manager.progress_begin(start,end/2) #progressbar
         if ob.type == "MESH":
             with open("%s/%s.pc2" % (os.path.normpath(folderpath), ob.name), mode="wb") as file:
                 #encabezado
@@ -74,6 +75,7 @@
                 obmat = ob.matrix_world
                 for frame in range((end + 1) - start):
                     print("Percentage of %s bake: %s " % (ob.name, frame / end * 100))
+                    bpy.context.window_manager.progress_update(frame / end * 100) #progressbarUpdate
                     bpy.context.scene.frame_set(frame)
                     me = bpy.data.meshes.new_from_object(
                         scene=bpy.context.scene,
@@ -104,7 +106,7 @@
                     file.write(struct.pack("<3f", *frame))
                 print("%s File Compiled Write finished!" % (ob.name))
                 del(pc2list)
-
+        bpy.context.window_manager.progress_end()#progressBarClose
     print("Bake Finished!")
 
 class OscPc2ExporterBatch(bpy.types.Operator):



More information about the Bf-extensions-cvs mailing list