[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4344] contrib/py/scripts/addons/ space_view3d_paint_bprojection.py: BProjection: solve a few bug and make the plan attached to the view when panning and zooming

geo kgeo kgeogeo at hotmail.com
Tue Mar 5 19:20:56 CET 2013


Revision: 4344
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4344
Author:   kgeogeo
Date:     2013-03-05 18:20:55 +0000 (Tue, 05 Mar 2013)
Log Message:
-----------
BProjection: solve a few bug and make the plan attached to the view when panning and zooming

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	2013-03-05 11:27:01 UTC (rev 4343)
+++ contrib/py/scripts/addons/space_view3d_paint_bprojection.py	2013-03-05 18:20:55 UTC (rev 4344)
@@ -1126,7 +1126,6 @@
 class BP_Paint(bpy.types.Operator):
     bl_idname = "paint.bp_paint"
     bl_label = "Paint BProjection Plane"
-    
     first_mouse = Vector((0,0))
     
     @classmethod
@@ -1141,8 +1140,6 @@
         center = view3d_utils.location_3d_to_region_2d(context.region, sd.region_3d, em.location)
         vec_init = self.first_mouse - center        
         vec_act = Vector((event.mouse_region_x, event.mouse_region_y)) - center               
-        
-        print(event.type)
             
         if event.type == 'MOUSEMOVE':#'INBETWEEN_MOUSEMOVE':                
              
@@ -1179,6 +1176,7 @@
         
         self.v_offset =  Vector((context.region.width, context.region.height)) - Vector((event.mouse_region_x, event.mouse_region_y))
         move_bp(self,context,Vector((event.mouse_region_x, event.mouse_region_y)) - self.v_offset,self.first_mouse)
+        
         em.custom_c3d = False
         self.alpha = bpy.data.materials['Material for BProjection'].alpha
         
@@ -1192,13 +1190,13 @@
         return {'RUNNING_MODAL'}  
 
 # Oprerator Class toggle the alpha of the plane             
-temp_alpha = 1.0
+temp_alpha = 0
 class ApplyImage(Operator):
     bl_idname = "object.bp_toggle_alpha"
     bl_label = "Toggle Alpha of the BP"
     
     def execute(self, context):        
-        global temp_alpha
+        global temp_alpha  
         if temp_alpha != 0:
             bpy.data.materials['Material for BProjection'].alpha = temp_alpha 
             temp_alpha = 0
@@ -1778,7 +1776,8 @@
         loc = vbl - v       
         sd.region_3d.view_location += loc         
         loc.rotate(vr)
-        em.custom_location += loc
+        if not em.custom_style_clone:
+            em.custom_location += loc
 
         self.first_mouse.x = event.mouse_region_x
         self.first_mouse.y = event.mouse_region_y
@@ -1854,9 +1853,11 @@
         r3d.view_location *= fac
         r3d.view_location += ob.location
         vres = Vector((em.custom_location.x*fac,em.custom_location.y*fac,em.custom_location.z))
-        em.custom_location = vres
         
+        if not em.custom_style_clone:
+            em.custom_location = vres
         
+        
         align_to_view(context)
         
         return {'FINISHED'}



More information about the Bf-extensions-cvs mailing list