Geometry Nodes: Matrix socket type, attribute type, and initial nodes #116166
No reviewers
Labels
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
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116166
Loading…
Reference in New Issue
No description provided.
Delete Branch "HooglyBoogly/blender:nodes-matrix-socket"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the design from #116067.
The socket type is called "Matrix" but it is often referred to as "Transform"
when that's what it is semantically. The attribute type is "4x4 Matrix" since
that's a lower level choice. Currently matrix sockets are always passed
around internally as
float4x4
, but that can be optimized in the futurewhen smaller types would give the same behavior.
A new "Matrix" utilities category has the following set of initial nodes"
The nodes and socket type are behind an experimental flag for now,
which will give us time to make sure it's the right set of initial nodes.
The viewer node overlay doesn't support matrices-- they aren't supported
for rendering in general. They also aren't supported in the modifier interface
currently. But they are supported in the spreadsheet, where the value is
displayed in a tooltip.
Geometry Nodes: Matrix node sockets, attribute types, and function nodesto Geometry Nodes: Matrix socket type, attribute type, and initial nodes@blender-bot package
Package build started. Download here when ready.
In the future, perhaps matrix from input location, rotation and scale?
Instead of location to transform, rotation to ~ & scale to ~, I think it's more preferable to have something like "compose transform"
One node doesn't follow the verb-first nomenclature, Matrix Multiply. Perhaps it should be changed to Multiply Matrix.
edit : I'd also like to discuss the socket color. Right now I can distinguish it from the rotation socket color, but only if I look closely for a brief moment -at a glance, they look almost exactly the same. Is it just me ?
I changed the nodes to "Combine Transform" and "Separate Transform". While "compose" and "decompose" might imply the non-trivial nature of the operations better, we thought the consistency with the other combine and separate nodes was worth it.
I also changed "Matrix Multiply" to "Multiply Matrices" to go with the verb first naming.
Feel free to propose a different color :D I'm struggling with that a bit too. The current color doesn't seem too bad, but there may be a better choice.
@blender-bot package
Package build started. Download here when ready.
Here is a first try at making socket colors more spaced out and differentiable.
and a blend file to generate them
socket_colors.blend
I took it as an opportunity to rethink the color distribution by grouping some similar types together on the color wheel. I only lightly touched the more "established Blender colors" (geometry, object, material), didn't want to shake everything up either since those are used throughout the interface, not just in nodes. I played with saturation and lightness to try and differentiate the ones that were closest together.
But how extensible is this really ? I'm not sure we can keep relying on colors if more types are introduced.
Corollary : perhaps these should be user-themable ?
Here is a second try, with more differenciation and approximately equal perceived intensities between sockets. YMMV
(Looks like I can't link the attachments in the post anymore, they're at the bottom of this post.)
Thanks for doing that, but I don't think we'll change so many of the colors right now. It's probably important to reuse the white color for collections too.
Anyway, a deep purple still might work for matrix sockets.
A minor thing, but if the printing of the matrix when mousing over to preview was aligned column-wise, it would help with visually parsing it for inspecting & debugging. Otherwise very excited to get access to matrix data types!
What about socket tooltip?
Do you still want to remove the Project Vector node from this patch? Not sure if there is too much benefit in having it in here. It's less obvious than the others.
The Transform Vector node behavior node is also not entirely obvious. It's not clear whether it transforms a point, or direction (or normal).
Did you investigate better alignment using a monospace font in the tooltip?
I'd prefer to change tooltip to show transformation, instead of matrix components. But this still just table of numbers...
Yeah, also wonder if the spreadsheet could show some more info other than
...
, like whether the matrix is just a translation, or rotation, etc. But that can also be done separately.Yeah, this would be great. Unfortunately we don't have the right infrastructure for custom mono-space tooltips yet. That's a good thing to work on in the future though.
It seemed like a good way to make this PR simpler and less arbitrary for now. That could definitely be investigated in the future though.
I've removed the "Project Vector" node from this PR, since we don't have a strong enough use case for the moment.
bNodeSocketValueMatrix
? Seems like that shouldn't be necessary for now because we can't set it anyway. Can also probably get rid ofdecl::Matrix::default_value
.NOD_static_types.h
.Transform Vector
toTransform Point
.@ -251,2 +253,4 @@
return property;
}
case SOCK_MATRIX: {
BLI_assert_unreachable();
This is reachable when connecting a matrix socket modifier group input.
In the past we had talked about splitting the object info node into "Object Transform", "Evaluated Object Geometry", and "Original Object Geometry". But we can totally consider that later. I'll remove it for now.
@ -288,2 +292,4 @@
DefNode(FunctionNode, FN_NODE_SLICE_STRING, 0, "SLICE_STRING", SliceString, "Slice String", "")
DefNode(FunctionNode, FN_NODE_STRING_LENGTH, 0, "STRING_LENGTH", StringLength, "String Length", "")
DefNode(FunctionNode, FN_NODE_TRANSFORM_DIRECTION, 0, "TRANSFORM_DIRECTION", TransformDirection, "Transform Direction", "")
DefNode(FunctionNode, FN_NODE_TRANSFORM_POINT, 0, "TRANSFORM_VECTOR", TransformVector, "Transform Point", "")
Some missing renames.
@ -1299,1 +1299,4 @@
}
else if (socket_type.is<float4x4>()) {
const float4x4 &value = *static_cast<const float4x4 *>(socket_value);
ss << value[0] << ",\n";
All other types is printed via custom formatting (maybe this is not the best idea to relate internal debug print of value and UI representation..). Could this be done via fmt as all other just for consistency?
@ -0,0 +60,4 @@
if (no_rotation && no_scale) {
mask.foreach_index(
[&](const int64_t i) { transforms[i] = math::from_location<float4x4>(location[i]); });
mask.foreach_index
->mask.foreach_index_optimized<int>
.const int64_t i
->const int i
.Same in other nodes.
I hope will find time for the benchmarks for the last loop to check if
devirtualize_varray
andforeach_index_optimized
makes sense too, then this will be in main.Unless I can prove it's faster I don't think this is worth it.
The patch description still has to be updated.