BProjection: make change for subdividing the plan
authorGeo Kgeo <kgeogeo@hotmail.com>
Thu, 21 Jun 2012 12:50:16 +0000 (12:50 +0000)
committerGeo Kgeo <kgeogeo@hotmail.com>
Thu, 21 Jun 2012 12:50:16 +0000 (12:50 +0000)
space_view3d_paint_bprojection.py

index c160564df921d70811cdf8ab3337f6cc6cebcdb8..e05e877b5ec579675881ab28475ce11cc4ca8bee 100644 (file)
@@ -310,7 +310,7 @@ def createcustomprops(context):
     
                                 
     Ob.custom_sub = IntProperty(name="Subdivide", description="Number of subdivision of the plan",
-                                     min=1, max=20, default=10)                                
+                                     min=0, max=20, default=0)                                
     
     # UV properties
     Ob.custom_scaleuv = FloatVectorProperty(name="ScaleUV", description="Scale the texture's UV",
@@ -724,7 +724,8 @@ class AddBProjectionPlane(Operator):
                 ob.data.edges[len(ob.data.edges)-1-i].crease = 1
             bpy.ops.object.editmode_toggle()
 
-            bpy.ops.mesh.subdivide(number_cuts = em.custom_sub)
+            if em.custom_sub > 0:
+                bpy.ops.mesh.subdivide(number_cuts = em.custom_sub)
     
             em.select = True
             bpy.ops.object.hook_add_selob()
@@ -1309,4 +1310,4 @@ def unregister():
     bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
-    register()
\ No newline at end of file
+    register()