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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
48 views

How to calculate pose bone values (pose_bone.matrix_basis)?

I tried to write own importer for custom model, but have some troubles with it: i don't understand how values of pose's B-bone are calculated. I have a skeleton with 2 bones: parent bone - A, and ...
SWR's user avatar
  • 1
2 votes
1 answer
59 views

Proper GPUOffScreen projection matrix from viewport

How to get proper GPUOffScreen projection matrix from viewport? API docs have example only for camera. I tried using view_matrix ...
Mikhail Rachinskiy's user avatar
2 votes
2 answers
41 views

Trying to replicate Matrix Object from C4D in Blender

I am trying to figure out if there is a way to replicate this? Basically being apply split a Mesh Object into an array of cubes or spheres. The video here is a visual representation of what I am ...
Arif's user avatar
  • 87
0 votes
0 answers
41 views

Blender 6D pose data generation

I am trying to get relative pose of object ( x,y,z and rotations ) with respect to the camera. My object is placed at origin (0,0,0) World Coordinates and the camera is following a trajectory while ...
Siddharth Singh's user avatar
2 votes
0 answers
367 views

How do you invert a transformation in geometry nodes?

I need the inverse of a transform matrix, geometry nodes seems to have abstracted away all the matrix math. Is there an intended workflow I'm missing here? In the following image I'm pulling in the ...
smuseus's user avatar
  • 65
0 votes
1 answer
92 views

blender python transfer pose bone position to an object (matrix issue)

I have an object inside a bone, matches the bone exactly (position, scale, rotation). The armature and the object have different origin points. I am trying to make the object follow the bone exactly ...
Revln9's user avatar
  • 217
0 votes
0 answers
68 views

Rotate camera around target object (within limits) using python & math utils, whilst maintaining camera facing toward target

I am writing a script to procedurally generate images of a target object on a terrain. The basic logic I am thinking of is to have the camera directly above the target pointing straight down, apply ...
oscr104's user avatar
  • 35
1 vote
1 answer
29 views

How to get a list of all the object in the camera's FOV?

How to list all the objects in the FOV of the camera? I tried projecting the vertex with the projection matrix, but objects not in the view are still projected on the image plane. Hence is there any ...
Kummmar's user avatar
  • 11
0 votes
0 answers
17 views

How to use matrix to align objects?

I know all xyz coordinates and origin, how to transform from a to b (use script)? Thanks!
zeronofreya's user avatar
0 votes
0 answers
34 views

Matrix transform from bones problem

I have a problem and I'm stuck right now in the matrix. xd some explanation: I have an armature object in blender called "Original_Armature" from which I want to print the transformations of ...
DevilSam's user avatar
  • 141
0 votes
1 answer
108 views

Camera Matrix Not Updating After Moving Camera

I am developing a short macro to find the optimal distance to place the camera from an object, so it is fully contained in the render. One simple solution is to use the maximum side of the bounding ...
Jack Rolph's user avatar
0 votes
0 answers
126 views

Camera projection matrix is always the same

I wrote a simple python script to render a scene from different points of view. For each rendered image i also need to save the projection matrix of the camera that took the picture. I try to get the ...
0n430w7's user avatar
1 vote
0 answers
199 views

Converting a weak perspective Camera (SMPL) to a orthographic/perspective projection model

I am currently trying to import and parse outputs from the SMPL/VIBE model into Blender. The goal is to overlay the predicted mesh/armature on the original image and render it in blender similar to ...
BigTing's user avatar
  • 11
2 votes
1 answer
323 views

Get view and perspective matrices of the current 3D viewport (not camera)

I'm making a script allowing me to apply fragment shaders to the 3D Viewport real-time. However, I don't know how to get view and perspective matrices of the current point of view. I know how to get ...
Wojtek Pachowiak's user avatar
0 votes
0 answers
19 views

is it posible to work an image with kernels and matrix in blender?

I'm working on some postprocessing add-on, and I was wondering if there is a way to work on an image with kernels and pixel matrix, since a lot of the effects I want to implement depend on them, ...
Gabriel's user avatar
  • 122
0 votes
0 answers
26 views

How to Copy the Matrix of Curve1 to Curve2 but keeping the transform(no parenting)?

Curve1 Curve2 I am trying to copy the the (Transform) Matrix of the Curve1 to Curve2, while keeping the current point locations unchanged. (For sharing the same transform axes: same up, down etc for ...
Sadern Alwis's user avatar
0 votes
0 answers
39 views

Bone matrix roll incorrect 3.4

I have an import script written for 2.79 that im trying to port to 3.4, i managed to fix everything except the part of the script that imports the armature.. It does not calculate the correct bone ...
Erik Vikner's user avatar
0 votes
0 answers
26 views

Automatically apply Matrices4x4 transform on Objects

I'm working on a reverse-engineering tool, it extracts maps from a game, and the game actually stores the positions of objects instances using Matrices4x4 transformation. I would like to know how I ...
V E L Δ's user avatar
0 votes
1 answer
38 views

matrix_world is transposed silently under the hood? Why?

I'm setting the matrix_world property of an object (from a numpy array) and I discovered that: The last column (translation) is not set. The matrix appears ...
Sergio's user avatar
  • 123
0 votes
1 answer
123 views

Rotate object's matrix_world

I need to rotate the matrix_world of an object through a quaternion q without changing its actual rotation (i.e. rotation in world space). How to do that through a ...
Loma Harshana's user avatar
0 votes
0 answers
56 views

Location of child object

I have a child object c parented to another object p. If now I check c.location from python console it's totally different than the one shown in the item tab of the ...
Loma Harshana's user avatar
1 vote
0 answers
59 views

Object's matrix_parent_inverse Value After Parent's Origin Change

If the matrix_parent_inverse of an object o that's parented to another object p is initially M1, and if it becomes M2 after the origin of p is shifted by Vector v, ...
Loma Harshana's user avatar
1 vote
1 answer
133 views

Parenting to a Curve with Python leads to unexplained results

I'm trying to set a Curve as a parent to objects using Python. My Curve's position is 0,0,0 at the World Origin. When I run the script below, the cubes get parented to the Curve and jump to a ...
Dr. Pontchartrain's user avatar
0 votes
2 answers
131 views

Can I manipulate a posebone in Python script?

So I wanted to adjust a posebone using Python script, and I ran into something wierd: ...
Bobo's user avatar
  • 164
3 votes
1 answer
89 views

Passing an arbitrary sized matrix as a property of an operator

I'm trying to create an operator that takes as an input a matrix (ideally a numpy matrix) and creates and edits several objects based on the size and values of said matrix. As far as I understand, the ...
Grub's user avatar
  • 33
1 vote
0 answers
810 views

Check if any points of an objects bounding box is inside the bounding box of another object

I'm trying to make a script that'll find if any points of an objects bounding box is inside the area of a different objects bounding box. My thought was to cancel out the rotation of the object I'm ...
CybranM's user avatar
  • 393
1 vote
0 answers
120 views

How to get euler/quaternion rotation from matrix?

I have 2 bones and I want to copy the rotation of one bone to another using only rotation_quaternion or rotation_euler to assign ...
cak3_lover's user avatar
0 votes
1 answer
113 views

Multiplying bone rotation matrix results in identity matrix

This is a complicated question. I have a math formula of how to convert a rotation matrix from a bone to result in the same rotation for another bone on another skeleton given that skeleton has an ...
user149859's user avatar
1 vote
0 answers
47 views

Does Python round matrix elements?

I was doing matrix multiplication with a calculator and in python and it seems like small numbers were rounded up to 0 in python is this real or did I make a mistake? Can you somehow override this to ...
user149859's user avatar
1 vote
1 answer
737 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: ...
Andrey Sokolov's user avatar
1 vote
0 answers
238 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 ...
MercuryRising's user avatar
4 votes
1 answer
442 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 ...
Anson Savage's user avatar
  • 3,342
2 votes
0 answers
197 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 ...
Riley Smith's user avatar
0 votes
0 answers
12 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....
Ігор Спасівський's user avatar
1 vote
0 answers
2k 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 ...
PvB's user avatar
  • 11
3 votes
1 answer
268 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 ...
Ian Ambrose's user avatar
1 vote
0 answers
222 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 ...
Ascalon's user avatar
  • 6,469
2 votes
0 answers
50 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 ...
Jason11040's user avatar
1 vote
1 answer
243 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 ...
para8D's user avatar
  • 29
1 vote
1 answer
173 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 ...
Wyatt's user avatar
  • 11
1 vote
1 answer
1k 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 ...
Lai Yu-Hsuan's user avatar
  • 1,972
0 votes
1 answer
102 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: ...
nullReference's user avatar
5 votes
1 answer
2k 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 ...
QuantumCoderQC's user avatar
4 votes
2 answers
367 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 ...
Blenderguppy's user avatar
1 vote
0 answers
130 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 ...
Millhow's user avatar
  • 31
1 vote
0 answers
424 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 ...
Millhow's user avatar
  • 31
0 votes
1 answer
591 views

I want to scale an Object along its local Axis and the return it to its initial scale using the global Axis

...
Graham Thomas's user avatar
0 votes
1 answer
180 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 ...
Richard Bruno's user avatar
0 votes
1 answer
77 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.
Pedro's user avatar
  • 133
2 votes
1 answer
285 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. ...
Dan's user avatar
  • 83