Cleanup: Avoid state creation in simulation input evaluation #107795

Closed
Hans Goudey wants to merge 1 commits from HooglyBoogly:cleanup-sim-input into main

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

On an evaluation of the simulation input node when there is no previous
state, the node's inputs are evaluated and passed directly to the
outputs. Currently this a bit confusing, since they are first converted
into a simulation state and then passed to the outputs. This commit
simplifies the node to avoid creating a simulation state, just moving
the values directly instead. The inputs are also set to unused when
there is a previous state too.

On an evaluation of the simulation input node when there is no previous state, the node's inputs are evaluated and passed directly to the outputs. Currently this a bit confusing, since they are first converted into a simulation state and _then_ passed to the outputs. This commit simplifies the node to avoid creating a simulation state, just moving the values directly instead. The inputs are also set to unused when there is a previous state too.
Hans Goudey added 1 commit 2023-05-09 19:54:37 +02:00
d0c1e6df08 Cleanup: Avoid state creation for first simulation input node evaluation
On an evaluation of the simulation input node when there is no previous
state, the node's inputs are evaluated and passed directly to the
outputs. Currently this a bit confusing, since they are first converted
into a simulation state and _then_ passed to the outputs. This commit
simplifies the node to avoid creating a simulation state, just moving
the values directly instead. The inputs are also set to unused when
there is a previous state too.
Hans Goudey changed title from Cleanup: Avoid state creation for first simulation input node evaluation to Cleanup: Avoid state creation in simulation input evaluation 2023-05-09 19:54:53 +02:00
Hans Goudey added this to the Nodes & Physics project 2023-05-09 19:55:00 +02:00
Hans Goudey requested review from Jacques Lucke 2023-05-09 19:55:09 +02:00
Member

The conversion to simulation state was intentional. It makes sure that the behavior of the node is consistent. This patch changes things like:

  • anonymous attributes are passed through the simulation input in the first frame
  • volumes are passed through in the first frame
  • fields are passed through as arbitrary fields instead of as anonymous attribute fields
The conversion to simulation state was intentional. It makes sure that the behavior of the node is consistent. This patch changes things like: * anonymous attributes are passed through the simulation input in the first frame * volumes are passed through in the first frame * fields are passed through as arbitrary fields instead of as anonymous attribute fields
Jacques Lucke reviewed 2023-05-09 20:00:55 +02:00
@ -81,0 +89,4 @@
node_,
output_values);
for (const int i : inputs_.index_range()) {
params.set_input_unused(i);
Member

Setting the inputs to unused can be done but shouldn't be necessary, because they are set to unused automatically when the node finished (all maybe-used outputs have been computed).

Setting the inputs to unused can be done but shouldn't be necessary, because they are set to unused automatically when the node finished (all maybe-used outputs have been computed).
Author
Member

Okay, makes sense. Though understanding that relies on a lot of context when reading the code. This refactor was how I made sense of the logic.

Okay, makes sense. Though understanding that relies on a lot of context when reading the code. This refactor was how I made sense of the logic.
Hans Goudey closed this pull request 2023-05-09 20:05:24 +02:00
Hans Goudey deleted branch cleanup-sim-input 2023-05-09 20:08:31 +02:00

Pull request closed

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#107795
No description provided.