Jump to content

get object from frame?


Juzwa

Recommended Posts

Hi, 

 

I made some procedural rocks. I assigned a simple expression $F on few attributes to get variations very fast and so I could wrtite out the rocks. So now I have a lot of rocks in one single file sequence.

 

So now I want to use those rocks to model my surface. How can I use this sequence to get random rocks? Eg load a single random frame from that sequence

 

 

Link to comment
Share on other sites

using a copy sop, enable stamp inputs and create a variable eg: rocks with a value of $PT.   On your file node you are reading in using the following expression:   $HIP/rocks_library/rocks.`floor(fit01(rand(stamp("../copy1","rocks",0)),1, 240))`.bgeo  (assuming you have 240 different rocks, change this as needed.)

Link to comment
Share on other sites

Use a Copy SOP node, File SOP node, and Time Shift SOP node. Set the shift on the time to the value of the rock to load. I've attached an example scene file. Instancing could be another option depending on the nature of your workflow. If you don't plan to instance than writing the rocks to disk might not be worthwhile.

rockLoader.hip

Link to comment
Share on other sites

Hi, 

 

Unfortunately I still dont understand something. When I use your Illusionist scene everything works fine. But when I make exactly the same setup I get copied only one rock? 

 

I tried without timeshift node with this expression `floor(fit01(rand(stamp("../copy1","rocks",0)),1, 240))` but it evaluates to some 3 digit random number (eg 154). And I use 4 digits in files (eg 0154). And i get an error "Unable to read file.....154.bgeo"

Link to comment
Share on other sites

[...] this expression `floor(fit01(rand(stamp("../copy1","rocks",0)),1, 240))` but it evaluates to some 3 digit random number (eg 154). And I use 4 digits in files (eg 0154).

 

change it to

`padzero(4,floor(fit01(rand(stamp("../copy1","rocks",0)),1, 240)))`
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...