[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3108] contrib/py/scripts/addons/ space_view3d_paint_bprojection.py: BProjection: now the cursor 3D stay in the same location with the numpad shortcut

geo kgeo kgeogeo at hotmail.com
Wed Mar 14 13:15:16 CET 2012


Revision: 3108
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3108
Author:   kgeogeo
Date:     2012-03-14 12:15:08 +0000 (Wed, 14 Mar 2012)
Log Message:
-----------
BProjection: now the cursor 3D stay in the same location with the numpad shortcut

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-03-14 08:59:08 UTC (rev 3107)
+++ contrib/py/scripts/addons/space_view3d_paint_bprojection.py	2012-03-14 12:15:08 UTC (rev 3108)
@@ -527,6 +527,9 @@
 
     def invoke(self, context, event):                   
         origine = bpy.context.object.location
+        
+        pos_init_cursor = view3d_utils.location_3d_to_region_2d(bpy.context.region, bpy.context.space_data.region_3d, bpy.context.space_data.cursor_location)
+
         if bpy.context.object.custom_rot:
             pos_init = view3d_utils.location_3d_to_region_2d(bpy.context.region, bpy.context.space_data.region_3d, origine)
             bpy.context.space_data.region_3d.view_location = origine
@@ -541,7 +544,10 @@
             pos_end = view3d_utils.region_2d_to_location_3d(bpy.context.region, bpy.context.space_data.region_3d, pos_init, Vector((0,0,0)))                
             bpy.context.space_data.region_3d.view_location =  -1*pos_end
             align_to_view(context)
-        
+
+        if bpy.context.object.custom_c3d:
+            bpy.context.space_data.region_3d.update()       
+            bpy.context.space_data.cursor_location = view3d_utils.region_2d_to_location_3d(bpy.context.region, bpy.context.space_data.region_3d, pos_init_cursor, Vector((0,0,0)))        
                     
         return {'FINISHED'}
 



More information about the Bf-extensions-cvs mailing list