Geometry Nodes: support matrix socket in accumulate field node #121326

Open
Jacques Lucke wants to merge 2 commits from JacquesLucke/blender:accumulate-field-matrix into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

This adds support for matrices in the accumulate field node. This is quite useful to evaluate chains of parent matrices (although branching is not easily possible with this approach).

The main tricky thing here is that matrices are generally accumulated using multiplication and the order of multiplication matters. For other data types we currently always use addition. I don't have use cases for other ways to accumulate matrices right now, so maybe it's fine not to add additional options here for now.

image

image

This adds support for matrices in the accumulate field node. This is quite useful to evaluate chains of parent matrices (although branching is not easily possible with this approach). The main tricky thing here is that matrices are generally accumulated using multiplication and the order of multiplication matters. For other data types we currently always use addition. I don't have use cases for other ways to accumulate matrices right now, so maybe it's fine not to add additional options here for now. ![image](/attachments/bdd35e27-76f5-4b86-8f57-b20c677deba8) ![image](/attachments/1443aa02-9c8e-4a4a-a3b4-298c33f39571)
Jacques Lucke added 1 commit 2024-05-02 01:19:55 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
5e05465a41
support matrix in accumulate field node
Jacques Lucke requested review from Simon Thommes 2024-05-02 01:23:19 +02:00
Jacques Lucke requested review from Hans Goudey 2024-05-02 01:23:19 +02:00
Author
Member

@blender-bot build

@blender-bot build
Hans Goudey approved these changes 2024-05-02 20:00:41 +02:00
Hans Goudey left a comment
Member

I think this is reasonable. The only argument against it is if we wanted to have a separate node for multiply accumulation. But that can be versioned later like you say.
We should probably support rotations here too if we support matrices.

I think this is reasonable. The only argument against it is if we wanted to have a separate node for multiply accumulation. But that can be versioned later like you say. We should probably support rotations here too if we support matrices.
First-time contributor

I agree. Multiplication is the most useful accumulation. I actually wanted rotation (quaternion) accumulation (with quaternion multiplication) ever since we got the rotation socket. This could be very useful and make things much faster than needing to use Repeat Zone.

I agree. Multiplication is the most useful accumulation. I actually wanted rotation (quaternion) accumulation (with quaternion multiplication) ever since we got the rotation socket. This could be very useful and make things much faster than needing to use Repeat Zone.
Simon Thommes reviewed 2024-05-08 16:37:31 +02:00
Simon Thommes left a comment
Member

I think it's generally fine to include this multiplicative accumulation in this node, but I'm not entirely sure that accumulating Matrices implies multiplication as much as accumulating Transforms clearly does.

What about calling the enum option Transform? If we go the more generic route it seems a little arbitrary to me to opt for multiplication which we are clearly favoring due to the application for transforms specifically.

I think it's generally fine to include this multiplicative accumulation in this node, but I'm not entirely sure that accumulating Matrices implies multiplication as much as accumulating Transforms clearly does. What about calling the enum option `Transform`? If we go the more generic route it seems a little arbitrary to me to opt for multiplication which we are clearly favoring due to the application for transforms specifically.

Additional options make its harder to switch data type in procedural context.

Additional options make its harder to switch data type in procedural context.
Author
Member

What about calling the enum option Transform?

Hmm, generally sounds reasonable, but might be a bit annoying internally.

> What about calling the enum option Transform? Hmm, generally sounds reasonable, but might be a bit annoying internally.
Jacques Lucke added 1 commit 2024-05-08 18:24:28 +02:00
Member

Rather than this intermediate method of "Transform" vs "Matrix" I'd just add the add/multiply option or figure out how that would work more generally.

Rather than this intermediate method of "Transform" vs "Matrix" I'd just add the add/multiply option or figure out how that would work more generally.
Author
Member

The general solution is more complex than just add/multiply because matrix multiplication is not commutative. But we could have a separate matrix accumulation mode.

The general solution is more complex than just add/multiply because matrix multiplication is not commutative. But we could have a separate matrix accumulation mode.

Yeah, Multipy node with rotation, matrix, and any other type... and explicit outputs for different args order

Yeah, Multipy node with rotation, matrix, and any other type... and explicit outputs for different args order
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u accumulate-field-matrix:JacquesLucke-accumulate-field-matrix
git checkout JacquesLucke-accumulate-field-matrix
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#121326
No description provided.