Random Objects in Instancing

   7599   14   0
User Avatar
Member
22 posts
Joined: June 2009
Offline
Hi.

I'm using a object merge and copy node to instance geometry to particles. This gives me many objects but all the same.

How would I go about setting it up to randomly instance a group or number of different objects ? So, as the particles emit, it randomly assigns a different geometry to that particle.

Thanks

Eugene
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Well you could use a switch SOP and stamp function in a copy sop.

floor( rand($ID) * opninputs(“../switch5”) )

The switch value , is the number of inputs you have in this case 5

r
Edited by - Sept. 30, 2009 15:42:56
Gone fishing
User Avatar
Member
22 posts
Joined: June 2009
Offline
great, thanks… i'll give that a go.

Eugene
User Avatar
Member
22 posts
Joined: June 2009
Offline
Hi.

I did that, but the expression didn't seem to work. I plugged in 2 object merges but nothing appeared when I played the sim.

Any thoughts ?

Thanks.
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
it really helps if you post a scene file …….

r
Gone fishing
User Avatar
Member
22 posts
Joined: June 2009
Offline
ok, sure … here it is… sorry for the newbie approach to my scene !

Thanks

Eugene

Attachments:
instance_test.hip (856.4 KB)

User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
if anything I confused you with my previous answer. Its always good to post a scene file !

r

Attachments:
instance_test_fixed.hip (997.2 KB)

Gone fishing
User Avatar
Member
22 posts
Joined: June 2009
Offline
great, thanks for your help…

eugene
User Avatar
Member
22 posts
Joined: June 2009
Offline
Hi… i spoke slightly too soon !

I have a new issue, where big geometry of the instances is appearing at the end locator.

I just want the objects to swirl in a nice vortex, but at the moment, they're hidden by this new appearance of geometry. This scene will show you exactly what I mean.

Thanks

Eugene

Attachments:
instance_test_Newissue.hip (335.4 KB)

User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi,
I am struggling to make sense of just what you are trying to do. You have two orbit nodes after each other ? Yet none of your particles are actually rotating round a centre point.
The way to solve problems is to break the problem down into small chunks. That way its easier for you to communicate just what your are trying to achieve.Take a look at the example files for each POP node , then make yourself a small test to devlop that part of a solution to a bigger problem.

r
Edited by - Oct. 1, 2009 22:02:05
Gone fishing
User Avatar
Member
22 posts
Joined: June 2009
Offline
Sorry,

I have developed the effect I want the particles to move in (whether the nodes are wrong or right, I'm not sure) but I have an issue with some odd geometry displaying itself at the end section of my particle stream.

Eugene
User Avatar
Member
22 posts
Joined: June 2009
Offline
Hi.

Perhaps this scene will make my issue a little clearer.

Any help would be appreciated.

Thanks

Eugene

Attachments:
instance_test_newissue_207.hip (333.3 KB)

User Avatar
Member
512 posts
Joined: July 2009
Offline
hey folks,

sry to bump into this thread, but i have a similar problem ))
i followed the “Creep Tool With Copy Stamping” Tutorial of the sidefx website. I created those different colored pebbles and put them in a partion SOP to create a different group of each pebble (rock_$PR).

Now i want to assign these pebbles to a new template. Say i have a grid with 9 points in it so i would need exactly 9 of those pebbles. Obviously i have to use the copy SOP but i can't solve the problem with the switch SOP method because all my primitves are in ONE node.

Can anyboy help me please?? )

best regards,

Manu

ps. sry Eugenerockstar for interfering
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Member
512 posts
Joined: July 2009
Offline
hi everyone!

i found the solution to the problem, the copysop can't handle primitive points so ein used the $PT variable and and a rand() expression to stamp the primitives into my copy SOP.

Now i am really confused because the copy SOP distributes the primitives randomly in space, they're not sticking to the provided template points.

I used a transform SOP to center the pivot of each primitve ($CEX,$CEY,$CEZ) but that doesn't work.

I would really appreciate some help, please take a look at the hipfile!

thanks a lot, greetings,
Manu

Attachments:
creep and stamping.hipnc (68.4 KB)

http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Member
512 posts
Joined: July 2009
Offline
ok guys!
then i will provide the answer myself

if your center ist say at 5,5,5 you can zero it by writing the following simple expression:
$TX - $CEX , $TY - $CEY , $TZ - $CEZ
in the position value of a transform SOP !

maybe it helps someone,

cheers
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
  • Quick Links