diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-05-26 13:43:03 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-05-26 13:43:03 +0300 |
commit | 8a6604f253e22bbade3dcf60b9a1c437ace44151 (patch) | |
tree | fee875d0a0b09fbe0df52aa83094159144048205 /doc/python_api/examples/mathutils.Matrix.py | |
parent | edf1b833674a6e54df7a16c14f0c6193fbbb482e (diff) | |
parent | afec66c024dc2b75447537d45406c06342ec201e (diff) |
Merge branch 'master' into temp-gpencil-maskingtemp-gpencil-masking
Conflicts:
source/blender/blenloader/intern/versioning_300.c
Diffstat (limited to 'doc/python_api/examples/mathutils.Matrix.py')
-rw-r--r-- | doc/python_api/examples/mathutils.Matrix.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/python_api/examples/mathutils.Matrix.py b/doc/python_api/examples/mathutils.Matrix.py index 26c7ccba27c..84e09b97c15 100644 --- a/doc/python_api/examples/mathutils.Matrix.py +++ b/doc/python_api/examples/mathutils.Matrix.py @@ -14,10 +14,14 @@ mat_rot = mathutils.Matrix.Rotation(math.radians(45.0), 4, 'X') mat_out = mat_loc @ mat_rot @ mat_sca print(mat_out) -# extract components back out of the matrix +# extract components back out of the matrix as two vectors and a quaternion loc, rot, sca = mat_out.decompose() print(loc, rot, sca) +# recombine extracted components +mat_out2 = mathutils.Matrix.LocRotScale(loc, rot, sca) +print(mat_out2) + # it can also be useful to access components of a matrix directly mat = mathutils.Matrix() mat[0][0], mat[1][0], mat[2][0] = 0.0, 1.0, 2.0 |