[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3815] contrib/py/scripts/addons/ space_view3d_paint_bprojection.py: Cehck if Object has material and UVMap before allow to add new BProjection plane .

Gaia Clary gaia.clary at machinimatrix.org
Thu Oct 4 16:12:44 CEST 2012


Revision: 3815
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3815
Author:   gaiaclary
Date:     2012-10-04 14:12:44 +0000 (Thu, 04 Oct 2012)
Log Message:
-----------
Cehck if Object has material and UVMap before allow to add new BProjection plane. Add useful hints in UI

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-10-04 13:17:38 UTC (rev 3814)
+++ contrib/py/scripts/addons/space_view3d_paint_bprojection.py	2012-10-04 14:12:44 UTC (rev 3815)
@@ -54,7 +54,7 @@
         em.scale = Vector((prop*scale[0], scale[1], 1))
     pos_cur = em.location - sd.cursor_location
     rot_cur1 = em.rotation_euler.to_quaternion()
-    em.location = v + ob.location            
+    em.location = v + ob.location
     em.rotation_euler = Quaternion.to_euler(vr*quat)   
     if em.custom_c3d:
         if em.custom_old_scale != em.custom_scale:
@@ -608,9 +608,15 @@
         else:
             ob = context.object
             col = layout.column(align = True)
-            col.operator("object.addbprojectionplane", text="Add BProjection plane")
-            col = layout.column(align = True)
-            col.prop(ob, "custom_sub",text="Subdivision level")
+            
+            if ob.active_material is None:
+                col.label(text="Add a material first!", icon="ERROR")
+            elif ob.data.uv_textures.active is None:
+                col.label(text="Create UVMap first!!", icon="ERROR")
+            else:
+                col.operator("object.addbprojectionplane", text="Add BProjection plane")
+                col = layout.column(align = True)
+                col.prop(ob, "custom_sub",text="Subdivision level")
                    
 
 # Oprerator Class to apply the image to the plane             
@@ -1011,7 +1017,7 @@
  
     first_time = True
     tmp_level = -1
-    
+
     def vect_sphere(self, context, mx, my):
         width = context.area.regions[4].width
         height = context.area.regions[4].height



More information about the Bf-extensions-cvs mailing list