Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

# Questions tagged [matrix]

A matrix is a mathematical object consisting of a rectangular array of (in blender's case) numbers. Matrices are used in 3D graphics for computing coordinate transformations. Blender uses matrices in the material node system for this purpose and internally for similar purposes. The internal representation can be accessed through bpy. Use this tag for questions about matrices in either the node editor or python.

98 questions
Filter by
Sorted by
Tagged with
1 vote
55 views

### What is the fastest way to set global vertices coordinates to a numpy array using bpy?

The fastest way I know to get the vertices coordinates from the mesh is to use .foreach_get() method: ...
• 1,140
7 views

### Rotation matrix .to_euler

I have a series of rotation matrices that I would like to apply to different objects. If I create a mesh for each object and use the mesh.transform(Matrix) method then the transformation works ...
33 views

### Custom exporter, problems with rotations and positions

I'm working on a custom exporter for blender, the idea is to export the geometry to be used in an external tool. But we have a big problem, is very difficult to apply the rotation matrix and make it ...
• 45
12 views

### How to properly combine Rotation Quaternion with Matrix for viewport/RegionView3D manipulation?

(Copy and pasted it from another place since I wasnt getting any replies) Hi, I am working on an addon that uses external application's touch gesture to send information to a socket, which then is ...
23 views

### How to update world transformation matrices without calling a scene update

I have a Python script that's recursively parenting children objects to parents. I can use bpy.ops.object.parent_set(), which produces the desired outcome but is too slow for what I'm doing. Another ...
• 2,959
15 views

### Cannot import 3x3 rotation matrix (possible skew?)

I am importing a custom game model format (originally exported from 3ds Max or Maya) which stores hierarchical empties or tri-list meshes together with separate XYZ locations, 3x3 rotation matrices, ...
• 694
1 vote
29 views

### Mapping voronoi cell local space align perpendicular to a spherical surface?

With blenders voronoi texture each cell has a local space. My goal is to use these voronoi cells to scatter a volumetric shader, like the volumetric gizmos below, with each volumetric cell instance ...
47 views

### Rotate an object so polygon normal faces a world coordinate

Rotate crystal to polygon[face_idx] to face Vector((0,0,0)) This is what i have gathered so far. to do it in 2 rotations, my math could be off aswel. first rotation to line up object location->...
• 153
10 views

### This mathutils related code stop working correctly in 2.8 [duplicate]

I ported an old 2.78 addon and was faced with a strange thing, the results in 2.78 and 2.93 are different. In 2.93 the result of the multiplication of matrices is always remaining the same as Matrix....
47 views

### How can I detect changes in an object's transformation?

I was looking at this article related to detecting changes in an object's position: https://s-nako.work/2020/12/how-to-detect-object-moving-in-blender-addon/ But, I want to expand this to detect any ...
1 vote
240 views

### Rotation matrix to_euler, Euler angle decomposition order reversed?

Is Blender's euler decomposition order reversed from common convention? I have written some code below that demonstrates this, and am wondering if I'm making a mistake. I'm having trouble ...
• 11
17 views

### Python - posing bones directly from world transforms

I have a motion captured animation that I want to import into Blender. The data consists of world transform matrices for each joint. I'm able to create an Armature from any single frame of the ...
193 views

### What does ''Axis'' input of Vector Rotate node do?

What does the Axis input do? I’m aware that if the input is 0-1-0, the rotation will be performed around Y axis, 1-0-0 for X axis and 0-0-1 for Z axis. The math to perform the rotation using those ...
• 372
1 vote
83 views

### Matrix multiply a Vector using Loc/Rot/Scale Attributes

I am making a setup that uses Object Coordinates from an Empty as Normals. This works great until you start moving the object with a rig, at which point you realize that these "Normals" are ...
• 6,067
24 views

### Trying to get the right orientation matrix

So i'm using a importer that uses a matrix and changes the transform and when i try and import with my keyframe data the arms and legs are like backwards? Crossed not sure how to explain it. So i'm ...
13 views

### How to add a bone with selected object's rotation, location and dimensions/length?

Currently I am able to spawn a new bone and place it at a selected object's location and to match thee selected object's length but how does one transfer the selected object's rotation over to the ...
1 vote
49 views

### Create a list of matrix_world.translation for child object for n frames of animation

I want to save the location of a child object during the parent's animation. My code populates the list with the last read value and none of the other values. If I print the z location each iteration ...
• 29
1 vote
70 views

### matrix_basis doesn't set to the values I am setting it to

So, I'm importing animation data from a text file, containing the bonematrix for each frame and each bone. I am simply setting the matrix_basis of each bone and adding a keyframe, and repeating. The ...
• 11
179 views

### bpy.types.Bone.matrix vs matrix_local

According to the doc: matrix 3x3 bone matrix matrix_local 4x4 bone matrix relative to armature I guess matrix_local is the full transform matrix that describes ...
• 1,733
50 views

### axis_conversion producing unexpected result?

I am attempting to convert the world transforms of scene objects into a different coordinate system (-Z forward Y up) using axis_conversion method as follows: ...
572 views

### How to Decompose and Compose the local transform matrix

The Setup: I have a simple setup with two cube objects with a parent child relationship like so: The Red cube is a child object of the green cube. The Red cube has the following transforms: The ...
128 views

### Align viewport rotation to normal vector like Shift+7 in edit mode

I know this question has been asked and answered before but the behavior I want is what ⇧ Shift + Num 7 exactly does in edit mode which is to align the viewport to "face" the element ...
• 138
1 vote
52 views

### Different euler rotation from same Matrice between Blender and Maya

My problem is the following: I start from the same matrix between Blender and Maya and I want to get the euler rotation in degrees of this matrix. The problem is that I don’t get the same results at ...
• 31
1 vote
192 views

### Convert quaternion from Blender to Unity

I want to convert an euler or quaternion rotation from Blender to an euler or quaternion rotation on Unity. The goal is not to export an object from Blender to Unity, but only to convert the rotation ...
• 31
229 views

...
104 views

### Get vector location list from matrix list via script node in Animation Nodes

I want to be able to view the coordinates of the locations of the matrices after I have manipulated the matrices with matrix nodes. Would someone be able give me an example script, which I assume ...
55 views

### Random step between instances on animation nodes

Can the step distance between instances on animation nodes with a matrix distributed in a spline be random or varied? I just need the distances between the cubes to not be even.
• 123
69 views

### Rotate vertices to any arbitrary rotation

I'm trying to rotate a set of vertices (in the example code they form a triangle but will be an arc) to any arbitrary rotation. I start by building a base triangle on the X,Y plane with a Z normal. ...
• 21
498 views

### Python, How to get pose bone to rotate with another pose bone from a different armature? Finding Rotational difference

I have two Armatures with different bone structure. The goal is to get the rotational difference of one bone from a one Armature and translate it to the bone of the other Armature. Code **For a ...
535 views

### Which matrix to use to transform children local coordinates to global?

Setup I have an object Plane with 6 vertices. To each vertex I assign another object as child. Then I apply two keyframes on location to object Plane: In frame 0 it goes to Z = 5 In frame 81 it goes ...
• 83
66 views

### recreating a scene from THE MATRIX

for a video project I am trying to re-create a scene from the Matrix. https://www.google.com/url?sa=i&url=https%3A%2F%2Fgfycat.com%2Fru%2Fhelpfullavishboilweevil-virtualworlds-thematrix-fairuse&...
• 95
38 views

### Converting program specific functions to Blender in python

I'm sorry the title is vague, but I couldn't come up with a summary of my problem. I am trying to convert a script made for a model viewing tool called Noesis to Blender. I'm stuck on some Noesis ...
1 vote
90 views

### How does blender scaling works?

I am new to blender. I have been looking into a github code, and trying to understand the operations. I am confused about the blender scaling operation. This is the code for scaling: ...
1 vote
247 views

### Converting bones transformation matrix from OpenGL to Blender

So, I'm trying to convert some transformation matrices from OpenGL to Blender but bone poses are wrong. I assume it's transformation matrix, I'm no expert in OpenGl but it's used in this function: <...
• 11
1 vote
652 views

### Matrix math to translate, rotate, scale with respect to a pivot point in Object mode

So i need to need to replicate translate, rotate & scale with 3d cursor as pivot point action using Matrix or bmesh in a script. i read Rotate objects around their origin along a global axis (...
• 133
235 views

### Unrotate a square polygon with Python: all 3 axes

I have a rotated square polygon. And I want to 'unrotate' it so that its normal axes would match world axes. I'm able to unrotate it on the Z axis by using the face normal and rotation difference (I ...
1 vote
82 views

### Bone matrices manipulating problem

So I'm trying to convert additive animations to a weird format that Source engine uses: instead of offsetting the bone relative to its local space, it uses whole armature's origin point for that. All ...
592 views

### Easy way to format mathutils.Matrix Vector as tuple (or list) for json?

Hi I am currently making simple pose preset system with json for specific Armatures. It just discribe non driven bone matrix as json (export), then import and apply for pose bones when there is same ...
• 145
568 views

### Why is this Blender matrix multiplication not distributive?

I was surprised in working on a Blender problem recently to find that matrix multiplication doesn't seem to be distributive: ...
• 1,192
87 views

### Matrix not applying to pose bone correctly

I'm attempting to import animations from text files but I can't seem to figure out how to properly import it. If I make a list of positions in a text file like here ...
377 views

### Move selected object with transformation matrix

I'm working on a script which exports geometry and structure data (BOM and position) from CATIA V5 into blender. Catia V5 delivers as an absolute position for each part an array with 12 elements. 9 ...
• 101
241 views

### Access elements of matrix(vectors and Euler angles) in Animation nodes using script node

I would like to know to access individual elements of a matrix or matrices from Matrix/Matrix list input in the script node. Then I can perform some operations(experimentation) on those elements and ...
159 views

### Setting the points of a nurbs curve to (XYZ) in worldspace [duplicate]

I`m trying to snap the ends of a curve, to two points in space. However, I can't get past the fact that It requires worldspace input of a matrix instead of a vector. I've tried to convert worldspace ...
102 views

### Why is the transform gizmo not aligned correctly to my Python created object?

I am having a little confusion here. Some background: the user perspective faces in a direction, I am trying to make a box that faces the user perspective. That I have been able to achieve (pic below) ...
• 101
1 vote
235 views

### Bone matrix assignment behaviour change in Blender 2.80

I am trying to port an armature importer add-on from Blender 2.79 to Blender 2.8x. After the bone is being created the bone matrix is set. But the assignment of the bone matrix has a different ...
• 11
599 views

### How to calculate a parent inverse matrix?

Say I want to parent the default Cube to the camera from python without using an operator. First part is easy: ...
• 2,269
317 views

### Trying to find a way to make a true pixel screen

Using UVs to animate the shapes on the screen would be hard and tedious so i want to use geometry to impact which dots light up the compositor won't really help as it pixelates where the camera is ...
124 views

### Matrix from quaternion produces a different orientation

I want to convert a quaternion to a matrix and back again. The result has a different orientation than the quaternion from the beginning. To reproduce the problem, set a quaternion. ...
• 24.5k
1 vote