Skip to main content

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
44 views

How can I use convolution matrix in Shader Node

I want to use a convolution matrix so that I can create a Gaussian Blur for the image without it having too much noise. I saw someone upload it to BlendSwap and also something else here on ...
Golden Dragon's user avatar
0 votes
0 answers
39 views

Python exercise to learn - spiral circular shape

I’m trying to use bmesh extrusion and Matrix to do some spiral shape like this : I would like to start from a circle (like it is described on the picture) Here where I’m stuck: ...
Certes's user avatar
  • 1
0 votes
1 answer
39 views

Recreating clip space coordinates in Blender shader nodes

I've been trying to recreate the clip space coordinate system in Blender's shader nodes. From what I know, the only coordinate systems you have access to are object coordinates (position), world ...
LuigiTKO's user avatar
0 votes
0 answers
11 views

How to export posebone location, rotation and scaling including IK?

Not sure if that is a perfect title, I'm doing a mesh skinning shader in Game Maker and it is done, both the model and bones are exported from Blender (after struggling making an exporter) My problem ...
Khyze's user avatar
  • 21
0 votes
0 answers
30 views

Blender's bone.matrix_basis.to_euler() output data is flipped on some bone

I'm currently writing a blender addon to export animations to a json format which i can use for my projects. My current way of exporting is this: I grab the matrix of the armature bone: ...
Hellaweird's user avatar
1 vote
0 answers
40 views

Orientate a rotated and scaled cube to global x,y & z axis

I have a rotated and scaled cube (on all axis) with the rotation and scale applied. For example: As I don't know the original rotation and scale, using Python I'd like to align the cube along the ...
FredL's user avatar
  • 215
2 votes
1 answer
80 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
49 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
61 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
3 votes
1 answer
1k 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
  • 77
0 votes
1 answer
112 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
  • 227
0 votes
0 answers
105 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
52 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
1 answer
203 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
181 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
277 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
482 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
31 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
44 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
170 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
67 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
70 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
154 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
147 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
117 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
2 votes
0 answers
951 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
  • 423
1 vote
0 answers
141 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
145 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
54 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
860 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
317 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
614 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,412
2 votes
0 answers
276 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
13 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
290 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 ...
Orange Cat's user avatar
1 vote
0 answers
283 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,629
2 votes
0 answers
58 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
314 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
227 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
  • 2,012
0 votes
1 answer
110 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
6 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
412 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
159 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
513 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
694 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
189 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
81 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
339 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