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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-09-30 16:46:51 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-09-30 16:54:21 +0400
commitc58170fbe21e23f54c0217bc9d4fba9046b8fde0 (patch)
tree7d2d3ca64222d535cb777a5ef16c5bf8d6db104d /io_scene_fbx/fbx_utils.py
parentc50d384159477dc8ccf84ecb64cddac859dbd8c9 (diff)
Fix T41999: "bake transformation" feature was not implemented for shapes.
Diffstat (limited to 'io_scene_fbx/fbx_utils.py')
-rw-r--r--io_scene_fbx/fbx_utils.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/io_scene_fbx/fbx_utils.py b/io_scene_fbx/fbx_utils.py
index 2b96fe0b..8e632ea4 100644
--- a/io_scene_fbx/fbx_utils.py
+++ b/io_scene_fbx/fbx_utils.py
@@ -30,7 +30,7 @@ from itertools import zip_longest, chain
import bpy
import bpy_extras
from bpy.types import Object, Bone, PoseBone, DupliObject
-from mathutils import Matrix
+from mathutils import Vector, Matrix
from . import encode_bin, data_types
@@ -208,6 +208,18 @@ def similar_values_iter(v1, v2, e=1e-6):
return False
return True
+def vcos_transformed_gen(raw_cos, m=None):
+ # Note: we could most likely get much better performances with numpy, but will leave this as TODO for now.
+ gen = zip(*(iter(raw_cos),) * 3)
+ return gen if m is None else (m * Vector(v) for v in gen)
+
+def nors_transformed_gen(raw_nors, m=None):
+ # Great, now normals are also expected 4D!
+ # XXX Back to 3D normals for now!
+ # gen = zip(*(iter(raw_nors),) * 3 + (_infinite_gen(1.0),))
+ gen = zip(*(iter(raw_nors),) * 3)
+ return gen if m is None else (m * Vector(v) for v in gen)
+
# ##### UIDs code. #####