[Bf-extensions-cvs] [24d59d3] master: fixes matrix_world issue

zeffii noreply at git.blender.org
Fri Jan 2 14:45:47 CET 2015


Commit: 24d59d37f7b0210cdb7154bc7fc1b6da1584eab0
Author: zeffii
Date:   Fri Jan 2 14:45:21 2015 +0100
Branches: master
https://developer.blender.org/rBAC24d59d37f7b0210cdb7154bc7fc1b6da1584eab0

fixes matrix_world issue

===================================================================

M	mesh_tinyCAD/CCEN.py

===================================================================

diff --git a/mesh_tinyCAD/CCEN.py b/mesh_tinyCAD/CCEN.py
index e42edcf..28519d2 100644
--- a/mesh_tinyCAD/CCEN.py
+++ b/mesh_tinyCAD/CCEN.py
@@ -27,7 +27,9 @@ from mathutils import geometry
 from mathutils import Vector
 
 
-def generate_3PT_mode_1(pts=[]):
+def generate_3PT_mode_1(pts, obj):
+    origin = obj.location
+    transform_matrix = obj.matrix_local
     V = Vector
 
     # construction
@@ -46,8 +48,10 @@ def generate_3PT_mode_1(pts=[]):
     r = geometry.intersect_line_line(v1_, v2_, v3_, v4_)
     if r:
         p1, _ = r
-        bpy.context.scene.cursor_location = p1
-
+        # cp = transform_matrix * (p1 + origin)
+        cp = transform_matrix * p1
+        bpy.context.scene.cursor_location = cp
+        # generate_gp3d_stroke(cp, axis, obj, radius=(p1-v1).length)
     else:
         print('not on a circle')
 
@@ -77,5 +81,5 @@ class CircleCenter(bpy.types.Operator):
     def execute(self, context):
         obj = bpy.context.object
         pts = get_three_verts_from_selection(obj)
-        generate_3PT_mode_1(pts)
+        generate_3PT_mode_1(pts, obj)
         return {'FINISHED'}



More information about the Bf-extensions-cvs mailing list