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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/blender/blender_util.h')
-rw-r--r--intern/cycles/blender/blender_util.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index 363e19f7a20..c4c45035b5a 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -247,14 +247,15 @@ static inline float *image_get_float_pixels_for_frame(BL::Image& image,
static inline Transform get_transform(const BL::Array<float, 16>& array)
{
- Transform tfm;
+ ProjectionTransform projection;
- /* we assume both types to be just 16 floats, and transpose because blender
- * use column major matrix order while we use row major */
- memcpy(&tfm, &array, sizeof(float)*16);
- tfm = transform_transpose(tfm);
+ /* We assume both types to be just 16 floats, and transpose because blender
+ * use column major matrix order while we use row major. */
+ memcpy(&projection, &array, sizeof(float)*16);
+ projection = projection_transpose(projection);
- return tfm;
+ /* Drop last row, matrix is assumed to be affine transform. */
+ return projection_to_transform(projection);
}
static inline float2 get_float2(const BL::Array<float, 2>& array)