[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4058] contrib/py/scripts/addons/ space_view3d_paint_bprojection.py: Bprojection: add a field for the level of subsurf to use when navigating in 3D view

geo kgeo kgeogeo at hotmail.com
Sun Dec 16 21:04:35 CET 2012


Revision: 4058
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4058
Author:   kgeogeo
Date:     2012-12-16 20:04:33 +0000 (Sun, 16 Dec 2012)
Log Message:
-----------
Bprojection: add a field for the level of subsurf to use when navigating in 3D view

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

Modified: contrib/py/scripts/addons/space_view3d_paint_bprojection.py
===================================================================
--- contrib/py/scripts/addons/space_view3d_paint_bprojection.py	2012-12-16 12:58:37 UTC (rev 4057)
+++ contrib/py/scripts/addons/space_view3d_paint_bprojection.py	2012-12-16 20:04:33 UTC (rev 4058)
@@ -254,6 +254,8 @@
         em.custom_active_view = self.custom_active_view
 
 class custom_props(bpy.types.PropertyGroup):
+    custom_fnlevel = IntProperty(name="Fast navigate level", description="Increase or decrease the SubSurf level, decrease make navigation faster", default=0)
+    
     custom_location = FloatVectorProperty(name="Location", description="Location of the plane",
                                           default=(0,0,-1.0),
                                           subtype = 'XYZ', 
@@ -309,6 +311,8 @@
 def createcustomprops(context):
     Ob = bpy.types.Object
     
+    Ob.custom_fnlevel = IntProperty(name="Fast navigate level", description="Increase or decrease the SubSurf level, decrease make navigation faster", default=0)
+    
     # plane properties 
     Ob.custom_location = FloatVectorProperty(name="Location", description="Location of the plane",
                                            default  = (0, 0, -1.0),
@@ -637,6 +641,10 @@
                         row = box.column(align =True)
                         row.prop(matBProjection,'alpha', slider = True)
                         row = box.column(align =True)
+                    
+                    row.prop(ob,"custom_fnlevel")
+                    row = box.column(align =True)
+                        
     
                 if ob == bpy.data.objects[em.custom_active_object]:    
                     for item in em.custom_props:
@@ -1226,7 +1234,10 @@
         for sub in context.object.modifiers:
             if sub.type in ['SUBSURF', 'MULTIRES']:
                 self.tmp_level = sub.levels
-                sub.levels = 0
+                if sub.levels - self.tmp_level <0:
+                    sub.levels = 0
+                else:
+                    sub.levels += bpy.context.object.custom_fnlevel
         return {'RUNNING_MODAL'}
             
 
@@ -1283,7 +1294,10 @@
         for sub in context.object.modifiers:
             if sub.type in ['SUBSURF', 'MULTIRES']:
                 self.tmp_level = sub.levels
-                sub.levels = 0  
+                if sub.levels - self.tmp_level <0:
+                    sub.levels = 0
+                else:
+                    sub.levels += bpy.context.object.custom_fnlevel 
                       
         return {'RUNNING_MODAL'}
         



More information about the Bf-extensions-cvs mailing list