Geometry Nodes: Random Value node connected to Subdivision Mesh level socket gives error, but still appears to function. #92327

Closed
opened 2021-10-19 01:17:04 +02:00 by Valera Barashkov · 19 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 496.13

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-10-16 12:26, hash: 4a00faca1a
Worked: NA

Short description of error
Random Value node connected to Subdivision Mesh gives error, but still appears to function.
random_val_bug.mp4

Exact steps for others to reproduce the error

subdiv_bug.blend

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 496.13 **Blender Version** Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-10-16 12:26, hash: `4a00faca1a` Worked: NA **Short description of error** Random Value node connected to Subdivision Mesh gives error, but still appears to function. [random_val_bug.mp4](https://archive.blender.org/developer/F11261984/random_val_bug.mp4) **Exact steps for others to reproduce the error** [subdiv_bug.blend](https://archive.blender.org/developer/F11294314/subdiv_bug.blend)

Added subscriber: @valera-8

Added subscriber: @valera-8
Member

Added subscriber: @leesonw

Added subscriber: @leesonw
Member

Could you add a sample scene to this?

Could you add a sample scene to this?
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123

I have added an example file.

I have added an example file.
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'

Added subscriber: @Walnert

Added subscriber: @Walnert

What would you like the fix to be? Since it still works, I think just turning it into a regular line, not a red dotted line, would be a good fix.

What would you like the fix to be? Since it still works, I think just turning it into a regular line, not a red dotted line, would be a good fix.
Contributor

Added subscriber: @Eary

Added subscriber: @Eary
Contributor

Not quite though. It seems it just converts the field into a single constant value, I think the red line still needs to be there to signal the field does not work here

Not quite though. It seems it just converts the field into a single constant value, I think the red line still needs to be there to signal the field does not work here
Member

Added subscribers: @JacquesLucke, @HooglyBoogly

Added subscribers: @JacquesLucke, @HooglyBoogly
Member

The reason the random value node outputs a field in this case is that is has an implicit id/index input (which is also a field). Because the "Level" socket isn't evaluated as a field, that implicit input doesn't work.

Ideally there would be some way for the random value node to not have a field implicit input when it is connected to a single-value (non-field) socket.
@JacquesLucke, do you think that is a reasonable goal?

The reason the random value node outputs a field in this case is that is has an implicit id/index input (which is also a field). Because the "Level" socket isn't evaluated as a field, that implicit input doesn't work. Ideally there would be some way for the random value node to not have a field implicit input when it is connected to a single-value (non-field) socket. @JacquesLucke, do you think that is a reasonable goal?
Member

I think we could change the behavior in evaluate_constant_field. If the field has any input, we just return the default value instead of actually evaluating the field.

I think we could change the behavior in `evaluate_constant_field`. If the field has any input, we just return the default value instead of actually evaluating the field.

I don't know if there is a point in that since the Random Node will just generate a constant value that user can set from the start without playing with the seed value.

What I need is to somehow have a random seed value that will be randomized just by duplicating the object with the GN modifier, instead of manually changing the group input seed value on each duplicated object if I want to have a slightly different version. This way I can just paint these objects on a surface and have randomly generated geometry right away.

Another solution would be for me to write a script to change the seed values of all the objects I guess..

I don't know if there is a point in that since the Random Node will just generate a constant value that user can set from the start without playing with the seed value. What I need is to somehow have a random seed value that will be randomized just by duplicating the object with the GN modifier, instead of manually changing the group input seed value on each duplicated object if I want to have a slightly different version. This way I can just paint these objects on a surface and have randomly generated geometry right away. Another solution would be for me to write a script to change the seed values of all the objects I guess..
Member

In #92327#1238799, @JacquesLucke wrote:
I think we could change the behavior in evaluate_constant_field. If the field has any input, we just return the default value instead of actually evaluating the field.

Thanks sounds good to me.

@valera-8, to be clear, fixing this won't give a random-per-object output, that would have to something else, maybe another node.

> In #92327#1238799, @JacquesLucke wrote: > I think we could change the behavior in `evaluate_constant_field`. If the field has any input, we just return the default value instead of actually evaluating the field. Thanks sounds good to me. @valera-8, to be clear, fixing this won't give a random-per-object output, that would have to something else, maybe another node.

I tested this on a few other nodes, and it looks like it gives a red error-line when you connect the field to any single-number input in the next node. Ex. icosphere radius, all grid node inputs. image.png
It seems like the fix would be to have the field understand when the input it's connected to only wants a single number, then downgrade itself from a field output to a single number output just for that node.

I tested this on a few other nodes, and it looks like it gives a red error-line when you connect the field to any single-number input in the next node. Ex. icosphere radius, all grid node inputs. ![image.png](https://archive.blender.org/developer/F11392906/image.png) It seems like the fix would be to have the field understand when the input it's connected to only wants a single number, then downgrade itself from a field output to a single number output just for that node.

This issue was referenced by cc388651eb

This issue was referenced by cc388651eb48e73470c53c185840f74d950cb38d
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Jacques Lucke self-assigned this 2021-10-24 17:54:04 +02:00
Sign in to join this conversation.
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
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#92327
No description provided.