Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-07-25 12:48:58 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-25 12:48:58 +0400
commit48c9da843c40ff8a97b462d8539185b662ba1567 (patch)
tree5ef66e3398e8a8b852e405cd29ba26ce3f617404 /light_field_tools
parent7690c2a38db02317d7ad289a16b8c55b5ec0ed3a (diff)
swap vector multiplication order, also some style changes
Diffstat (limited to 'light_field_tools')
-rw-r--r--light_field_tools/light_field_tools.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/light_field_tools/light_field_tools.py b/light_field_tools/light_field_tools.py
index 3c2636e7..7e84986b 100644
--- a/light_field_tools/light_field_tools.py
+++ b/light_field_tools/light_field_tools.py
@@ -107,10 +107,11 @@ class OBJECT_OT_create_lightfield_rig(bpy.types.Operator):
mesh = self.baseObject.data
verts = []
row_length = scene.lightfield.row_length
-
+ matrix = self.baseObject.matrix_local.copy()
for vert in mesh.vertices:
# world/parent origin
- co = vert.co * self.baseObject.matrix_local
+ # ???, normal and co are in different spaces, sure you want this?
+ co = matrix * vert.co
normal = vert.normal
verts.append([co, normal])
@@ -311,15 +312,15 @@ class OBJECT_OT_create_lightfield_basemesh(bpy.types.Operator):
def getWidth(self, obj):
mat = obj.matrix_local
mesh = obj.data
- v0 = mesh.vertices[mesh.edges[0].vertices[0]].co * mat
- v1 = mesh.vertices[mesh.edges[0].vertices[1]].co * mat
+ v0 = mat * mesh.vertices[mesh.edges[0].vertices[0]].co
+ v1 = mat * mesh.vertices[mesh.edges[0].vertices[1]].co
return (v0-v1).length
def getCamVec(self, obj, angle):
width = self.getWidth(obj)
itmat = obj.matrix_local.inverted().transposed()
- normal = (obj.data.faces[0].normal * itmat).normalized()
+ normal = (itmat * obj.data.faces[0].normal.normalized()
vl = (width/2) * (1/math.tan(math.radians(angle/2)))
return normal*vl