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-02-05 10:08:34 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-05 10:08:34 +0300
commit696b0366f5c46dcfcb50f53b4ca4f59c593b88fb (patch)
tree8dfbeb67383adc39b5742c661f61a55eb4066659 /io_scene_x3d
parentdfd3febce161e76015beb0faac516724aceff453 (diff)
update for changes in mathutuils.
Diffstat (limited to 'io_scene_x3d')
-rw-r--r--io_scene_x3d/export_x3d.py6
-rw-r--r--io_scene_x3d/import_x3d.py20
2 files changed, 13 insertions, 13 deletions
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 822065b2..a3e37648 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -47,7 +47,7 @@ def round_color(col, cp):
def matrix_direction(mtx):
- return (mathutils.Vector((0.0, 0.0, -1.0)) * mtx.rotation_part()).normalize()[:]
+ return (mathutils.Vector((0.0, 0.0, -1.0)) * mtx.to_3x3()).normalize()[:]
##########################################################
@@ -204,7 +204,7 @@ class x3d_class:
dx, dy, dz = matrix_direction(mtx)
- location = mtx.translation_part()[:]
+ location = mtx.to_translation()[:]
radius = lamp.distance * math.cos(beamWidth)
# radius = lamp.dist*math.cos(beamWidth)
@@ -247,7 +247,7 @@ class x3d_class:
amb_intensity = 0.0
intensity = min(lamp.energy / 1.75, 1.0)
- location = mtx.translation_part()[:]
+ location = mtx.to_translation()[:]
self.file.write("<PointLight DEF=\"%s\" " % safeName)
self.file.write("ambientIntensity=\"%.4f\" " % amb_intensity)
diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py
index 78a14605..307f6670 100644
--- a/io_scene_x3d/import_x3d.py
+++ b/io_scene_x3d/import_x3d.py
@@ -1465,8 +1465,8 @@ def translateTransform(node, ancestry):
tx = node.getFieldAsFloatTuple('translation', None, ancestry) # (0.0, 0.0, 0.0)
if cent:
- cent_mat = Matrix.Translation(Vector(cent)).resize4x4()
- cent_imat = cent_mat.copy().invert()
+ cent_mat = Matrix.Translation(cent)
+ cent_imat = cent_mat.inverted()
else:
cent_mat = cent_imat = None
@@ -1482,12 +1482,12 @@ def translateTransform(node, ancestry):
if scaori:
scaori_mat = translateRotation(scaori)
- scaori_imat = scaori_mat.copy().invert()
+ scaori_imat = scaori_mat.inverted()
else:
scaori_mat = scaori_imat = None
if tx:
- tx_mat = Matrix.Translation(Vector(tx)).resize4x4()
+ tx_mat = Matrix.Translation(tx)
else:
tx_mat = None
@@ -1509,8 +1509,8 @@ def translateTexTransform(node, ancestry):
if cent:
# cent is at a corner by default
- cent_mat = Matrix.Translation(Vector(cent).resize3D()).resize4x4()
- cent_imat = cent_mat.copy().invert()
+ cent_mat = Matrix.Translation(Vector(cent).resize_3d())
+ cent_imat = cent_mat.inverted()
else:
cent_mat = cent_imat = None
@@ -1525,7 +1525,7 @@ def translateTexTransform(node, ancestry):
sca_mat = None
if tx:
- tx_mat = Matrix.Translation(Vector(tx).resize3D()).resize4x4()
+ tx_mat = Matrix.Translation(Vector(tx).resize_3d())
else:
tx_mat = None
@@ -2042,7 +2042,7 @@ def importMesh_Box(geom, ancestry):
# Scale the box to the size set
scale_mat = Matrix(((size[0], 0, 0), (0, size[1], 0), (0, 0, size[2]))) * 0.5
- bpymesh.transform(scale_mat.resize4x4())
+ bpymesh.transform(scale_mat.to_4x4())
return bpymesh
@@ -2266,7 +2266,7 @@ def importLamp_DirectionalLight(node, ancestry):
bpylamp.color = color
# lamps have their direction as -z, yup
- mtx = Vector(direction).to_track_quat('-Z', 'Y').to_matrix().resize4x4()
+ mtx = Vector(direction).to_track_quat('-Z', 'Y').to_matrix().to_4x4()
return bpylamp, mtx
@@ -2305,7 +2305,7 @@ def importLamp_SpotLight(node, ancestry):
# Convert
# lamps have their direction as -z, y==up
- mtx = Matrix.Translation(Vector(location)) * Vector(direction).to_track_quat('-Z', 'Y').to_matrix().resize4x4()
+ mtx = Matrix.Translation(location) * Vector(direction).to_track_quat('-Z', 'Y').to_matrix().to_4x4()
return bpylamp, mtx