Fix repeated randomization patterns across paths in Copy to Points#4243
Fix repeated randomization patterns across paths in Copy to Points#4243Sanketjadhav31 wants to merge 2 commits into
Conversation
The Copy to Points node was resetting RNG state for each vector path, causing all paths to receive identical 'random' values instead of unique randomization. This made procedural artwork with multiple paths look repetitive instead of varied. Fixed by moving RNG initialization outside the path iteration loop, ensuring continuous random sequence across all paths and points. Also moves do_scale and do_rotation calculations outside the loop as a minor performance improvement. Includes regression test to prevent future occurrence.
There was a problem hiding this comment.
Code Review
This pull request fixes a bug in the copy_to_points function where the random number generators (scale_rng and rotation_rng) were being reinitialized inside the loop for each path, resulting in identical random sequences across different paths. The RNGs are now initialized once before the loop. A regression test copy_to_points_unique_randomization has also been added to ensure unique randomization across separate paths. There are no review comments, and no further feedback is required.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
This PR appears to be entirely AI generated based on the looks of it, in violation of our AI contribution policy. I also do not see an issue mentioned, so as far as I know, the issue being addressed here may be entirely hallucinated. |
Summary
This fixes an issue in
copy_to_points()where random scale and rotation values could repeat across different paths when using the same seed.The RNGs were being initialized inside the outer row loop, which caused the random sequence to restart for each path. As a result, corresponding points on different paths could receive identical random values.
The fix moves RNG initialization outside the loop so the RNG state is preserved across all paths while still remaining deterministic for a given seed.
Testing
Manual testing:
Automated testing: