Random Integer Seed Value [SOLVED]

   2006   4   1
User Avatar
Member
78 posts
Joined: June 2019
Offline
Hello, I have a bunch (25) of RBD Material Fracture SOPs I'd like to randomise the ‘Cut Offset Seed’ values for (integer values from 0-anything higher).

As a new user, I have been struggling to get a randomised integer value in a greater range than 0-1 that is also different for each RBD Material Fracture SOP (I hope that makes sense!)

Everything I have tried so far gives me the same ‘random’ number on all of the fracture sops.

I understand the rand function needs something to randomise - eg. rand($PT) but I'm not sure how to implement this inside the RBD Material Fracture SOP, as we aren't dealing with points.
Edited by GlennimusPrime - Dec. 1, 2020 15:52:46
User Avatar
Member
78 posts
Joined: June 2019
Offline
As this has had quite a few views with no replies, maybe I can ask this in another way..

How can I return a random integer value between 0-100?
User Avatar
Member
258 posts
Joined: July 2006
Offline
i@rand = int (fit(rand(@seeder),0,1,0,101));
Edited by tricecold - Dec. 27, 2019 09:24:52
Head of CG @ MPC
CG Supervisor/ Sr. FX TD /
https://gumroad.com/timvfx [gumroad.com]
www.timucinozger.com
User Avatar
Member
8538 posts
Joined: July 2007
Offline
Cut Offset Seed is already a seed to a random number so in theory is enough to set them to 0,1,2,3,4,… to get random results in each node

to do that the very friendly workflow is to base this seed on the numeric value of the node name
if you for example name your fracture nodes fracture0, fracture1, fracture2, …
you can use opdigits(".")expression in the Cut Offset Seed paraeter in all of them and it will return 0, 1, 2, 3, … based on the number in the node name

you can of course use rand(opdigits("."))*100for example to further randomize this seed value more if you really want to
Edited by tamte - Dec. 27, 2019 11:36:10
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
78 posts
Joined: June 2019
Offline
A big thank you to both tricecold and tamte!

Both great options for inside a wrangle and on the seed value itself.

tamte, this is exactly what I was after! I'm learning something new every day. Thank you!
  • Quick Links