Geometry Nodes: Mix Rotations #109084

Merged
Hans Goudey merged 11 commits from mod_moder/blender:slerp into main 2023-06-27 00:51:00 +02:00

Add support a new Rotation socket/data type to a Mix node.

Rotation socket avalible only in Geometry Nodes right now,
list of supported types for node depend on own node tree type.

Mixing kind is slerp (interpolation) of a quaternion. As initial
phase this is enough. In a future, other modes of interpolation
can be added (Euler for XY+Z, YZ+X, ZX+Y, ...). Clamping for
factor work the same as for all other data types.

Drag and drop should be care about avoiding create link between
Rotation socket and all other socket types, this requere chages
is mix node callback for drag & drop system.

See: #92967

Add support a new Rotation socket/data type to a Mix node. Rotation socket avalible only in Geometry Nodes right now, list of supported types for node depend on own node tree type. Mixing kind is slerp (interpolation) of a quaternion. As initial phase this is enough. In a future, other modes of interpolation can be added (Euler for XY+Z, YZ+X, ZX+Y, ...). Clamping for factor work the same as for all other data types. Drag and drop should be care about avoiding create link between Rotation socket and all other socket types, this requere chages is mix node callback for drag & drop system. See: https://projects.blender.org/blender/blender/issues/92967
Iliya Katushenock added the
Interest
Geometry Nodes
label 2023-06-17 20:08:48 +02:00
Iliya Katushenock added 2 commits 2023-06-17 20:08:58 +02:00
Iliya Katushenock added 1 commit 2023-06-18 16:48:36 +02:00
Iliya Katushenock added 1 commit 2023-06-18 23:50:44 +02:00
Hans Goudey changed title from WIP: Geometry Nodes: Mix Rotatios to WIP: Geometry Nodes: Mix Rotations 2023-06-26 16:05:02 +02:00
Member

Nice, thanks! As a first step, I think this would be better if it only did quaternion mixing.

Nice, thanks! As a first step, I think this would be better if it only did quaternion mixing.
Author
Member

Yes, as I see it now, supporting some euler interpolation makes little sense if the quaternion is still clipping the rotation.

Yes, as I see it now, supporting some euler interpolation makes little sense if the quaternion is still clipping the rotation.
Iliya Katushenock added 3 commits 2023-06-26 17:11:19 +02:00
Iliya Katushenock changed title from WIP: Geometry Nodes: Mix Rotations to Geometry Nodes: Mix Rotations 2023-06-26 17:12:18 +02:00
Iliya Katushenock added this to the Nodes & Physics project 2023-06-26 17:12:22 +02:00
Iliya Katushenock added 1 commit 2023-06-26 17:24:25 +02:00
Iliya Katushenock requested review from Hans Goudey 2023-06-26 17:24:27 +02:00
Iliya Katushenock added the
Interest
Animation & Rigging
label 2023-06-26 17:24:44 +02:00
Hans Goudey requested changes 2023-06-26 17:30:10 +02:00
@ -3796,0 +3810,4 @@
{
*r_free = true;
const auto rotation_supported_mix = [ptr](const EnumPropertyItem *item) -> bool {
Member

[ptr] -> [&]

`[ptr]` -> `[&]`
mod_moder marked this conversation as resolved
@ -3796,0 +3814,4 @@
const eNodeSocketDatatype data_type = eNodeSocketDatatype(item->value);
if (U.experimental.use_rotation_socket && data_type == SOCK_ROTATION) {
const bNodeTree *tree = reinterpret_cast<const bNodeTree *>(ptr->owner_id);
BLI_assert(tree != nullptr);
Member

This assert is unnecessary IMO, the pointer is de-referenced in the next line which shows it's not expected to be null.

This assert is unnecessary IMO, the pointer is de-referenced in the next line which shows it's not expected to be null.
mod_moder marked this conversation as resolved
@ -427,3 +451,2 @@
{
const NodeShaderMix *data = (NodeShaderMix *)node.storage;
bool uniform_factor = data->factor_mode == NODE_MIX_MODE_UNIFORM;
const NodeShaderMix *data = static_cast<NodeShaderMix *>(node.storage);
Member

Please leave this sort of cleanup to a separate commit. Same with moving return nullptr above.

Please leave this sort of cleanup to a separate commit. Same with moving `return nullptr` above.
mod_moder marked this conversation as resolved
Iliya Katushenock added 1 commit 2023-06-26 18:57:45 +02:00
Iliya Katushenock added 1 commit 2023-06-26 18:59:14 +02:00
Iliya Katushenock requested review from Hans Goudey 2023-06-26 18:59:37 +02:00
Hans Goudey approved these changes 2023-06-26 22:16:12 +02:00
@ -13,6 +13,8 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
Member

Group this with the other BLI includes

Group this with the other BLI includes
mod_moder marked this conversation as resolved
Iliya Katushenock added 1 commit 2023-06-26 22:35:10 +02:00
Hans Goudey merged commit 3957a1ad03 into main 2023-06-27 00:51:00 +02:00
Iliya Katushenock deleted branch slerp 2023-06-27 00:53:23 +02:00
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 Assignees
2 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#109084
No description provided.