6
$\begingroup$

TLWR: How do I randomize any value in Geometry Nodes (Blender 3.0)

Some versions before the Geometry Nodes fields update there was a node labeled "Attribute Randomize" which randomized whichever value. But now in 3.0 that node isn't there anymore, and trying to randomize a value with the "Random Value" node results in an incompatible socket connection (the connection to the Transform node turns red). screenshot of my current problem

For context, I'm trying to randomize rotation on some instanced points. I've tried finding a way to do it but no tutorial seems to go over those changes.

$\endgroup$
0

3 Answers 3

14
$\begingroup$

Unfortunately, the Transform node doesn't support fields as inputs, only normal vectors. However, you can use this simple node group to transform objects based on fields: enter image description here Which then supports the output of the Random Value node. enter image description here For transforming individual instances, you can use the Scale Instances, Rotate Instances or Translate Instances nodes, which can easily be built into this node group: enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ Note that the order in which you apply the transforms is relevant, see : gamedev.stackexchange.com/a/16721/142703 or computergraphics.stackexchange.com/a/4194 $\endgroup$
    – Gorgious
    Jan 5 at 12:34
  • $\begingroup$ I constructed your Transform Fields group node, but input from the Random Value node causes each vertex to be transformed randomly, when what I want is for the entire selection of geometry to be transformed together relative to a point (in this case, the object origin). Do you know what I should do differently? $\endgroup$
    – Mentalist
    Feb 23 at 8:41
  • $\begingroup$ I found the answer to my question! It was answered in response to a different question I asked that relates to this one. Answer: Connecting a Value node's output socket to the Random Value node's ID input socket results in all verts being transformed uniformly by a single random value. $\endgroup$
    – Mentalist
    Feb 24 at 13:32
3
$\begingroup$

How about to use Translate Instances node? I added the node after a Instance on Points node, and connected a Random Value node to Translation of the Translate Instance node.

For more details, please see following figure. Example of Translate Instances node ( Input mesh is a cube with 8 vertices. )

Update

I found the other method that is to add Set Position node before Instance on Points node, and a Random Value node connects to Offset of the Set Position node.

A method of using Set Position node ( Input mesh is a cube of 8 vertices. )

I think this method is suited for many manipulations. For example, the method is easy to change point's Z-axis value according to input mesh's positions with sine function.

Other manipulation ( Input mesh is a plane, and added a modifier of Subdivision (Setting to simple and Levels Viewport is 4. )

Inspired by Youtube Video 1 and Youtube Video 2

$\endgroup$
1
  • $\begingroup$ As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. $\endgroup$
    – Community Bot
    Jan 4 at 14:45
-1
$\begingroup$

I'm very new to the geometry nodes but this worked fine to me. For the "Random Value" node you have to drag from the ID and setup the right kind of data-type you're going for in addition to setting the "Vector/Float/Integer" data-type in the top of the node.

enter image description here

enter image description here

$\endgroup$
2
  • $\begingroup$ Be wary I have no clue what I'm doing! $\endgroup$
    – Sjonsson
    May 27 at 1:05
  • $\begingroup$ avoid such comments as this doesn't make you credible. $\endgroup$ May 27 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.