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.
8 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blender/blender#92327
No description provided.