Geometry Nodes: Test for field type inferencing #114903

Merged
Lukas Tönne merged 6 commits from LukasTonne/blender:field-type-inference-tests into main 2023-11-15 12:26:58 +01:00
Member

Adds a python test script for the field inferencing mechanism in geometry nodes.

Tests various combinations of field-to-value and value-to-field combinations as well as unconnected base nodes. Zones are tested because they can require multiple passes to resolve, especially when nesting.

Testing is based on socket display shapes as a proxy for field type, since the field type is not exposed in RNA yet. Likewise, testing for red links caused by field dependencies can only be done indirectly currently, because such links are not actually made invalid by the inferencing code, and just drawn red by the editor.

This test should help with simplifying and extending the type inferencing code to future socket data types (grids, lists).

Test file attached for reference, will go to svn test files repo.
Screenshot_20231115_110536
Screenshot_20231115_110608
Screenshot_20231115_110623
Screenshot_20231115_112951

Adds a python test script for the field inferencing mechanism in geometry nodes. Tests various combinations of field-to-value and value-to-field combinations as well as unconnected base nodes. Zones are tested because they can require multiple passes to resolve, especially when nesting. Testing is based on socket display shapes as a proxy for field type, since the field type is not exposed in RNA yet. Likewise, testing for red links caused by field dependencies can only be done indirectly currently, because such links are not actually made invalid by the inferencing code, and just drawn red by the editor. This test should help with simplifying and extending the type inferencing code to future socket data types (grids, lists). Test file attached for reference, will go to svn test files repo. ![Screenshot_20231115_110536](/attachments/0ac9d569-ae6b-4f77-b715-be0036019dc4) ![Screenshot_20231115_110608](/attachments/c6100cab-61b5-4711-a622-8f4f29c02156) ![Screenshot_20231115_110623](/attachments/ca806573-bc93-4547-b02b-bf1b19339186) ![Screenshot_20231115_112951](/attachments/29693e57-0978-4fa4-ae71-48396a987299)
Lukas Tönne added 2 commits 2023-11-15 11:12:20 +01:00
Lukas Tönne requested review from Jacques Lucke 2023-11-15 11:15:03 +01:00
Lukas Tönne added this to the Nodes & Physics project 2023-11-15 11:15:06 +01:00
Lukas Tönne added 1 commit 2023-11-15 11:23:05 +01:00
Jacques Lucke approved these changes 2023-11-15 11:31:04 +01:00
Jacques Lucke left a comment
Member

That looks very useful, thanks.

That looks very useful, thanks.
@ -0,0 +77,4 @@
tree = bpy.data.node_groups['Geometry Nodes']
# Unconnected nodes
Member

Can split up the individual sections into separate functions.

Can split up the individual sections into separate functions.
LukasTonne marked this conversation as resolved
@ -0,0 +212,4 @@
node = tree.nodes['Simulation Output Zone2']
self.assertEqual(node.bl_idname, "GeometryNodeSimulationOutput")
# Input can still be a single value
Member

Remember the . at the end of comments.

Remember the `.` at the end of comments.
LukasTonne marked this conversation as resolved
Lukas Tönne added 1 commit 2023-11-15 11:36:50 +01:00
Author
Member

Added another test for propagation between multiple zone items.

Added another test for propagation between multiple zone items.
Lukas Tönne added 2 commits 2023-11-15 11:44:23 +01:00
Author
Member

@blender-bot build

@blender-bot build
Lukas Tönne merged commit ec36296913 into main 2023-11-15 12:26:58 +01:00
Lukas Tönne deleted branch field-type-inference-tests 2023-11-15 12:27:00 +01: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#114903
No description provided.