Instance random object on particles

   7599   9   2
User Avatar
Member
1265 posts
Joined: March 2014
Offline
I would like to know what I am doing wrong here. Stamp random objects to grid points works fine, but not on particles.

Please have a look and let me know.

ops:

Attachments:
rand_Instance.hipnc (252.4 KB)

Werner Ziemerink
Head of 3D
www.luma.co.za
User Avatar
Member
1265 posts
Joined: March 2014
Offline
When I move the objects to the locations_particles node it works…
Not sure if this is the right way to do it, because I'm copying the objects to the particles which does not seem to be instances any more
Werner Ziemerink
Head of 3D
www.luma.co.za
User Avatar
Member
319 posts
Joined:
Offline
I was a little confused by your attempted method, i don't think that's how the copy sop is meant to be used. I could be wrong though.

I changed your file to just construct the full instancepath attribute on your particles via a wrangle pop, which just points to one of three sops.

Note I included the ‘op:’ syntax at the start of the instancepath attribute, as we're pointing the instance to nodes, not to files on disk.

Attachments:
rand_instance_v2.hipnc (257.6 KB)

User Avatar
Member
2537 posts
Joined: June 2008
Offline
This is a nice example Dean,

I am wondering, however, is there any way to extend this so and instance object's animation will start based upon its birth and current place in life?

I added in a Font object and you can see that all font objects have the same frame #. I am not talking about offsetting the copy in the font either. The instance animation could be anything, say a rocket launching.

How would I modify this technique so each new particle, when it is born, starts it's instance animation on the frame that it is born?

Attachments:
Untitled-1.jpg (39.0 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
319 posts
Joined:
Offline
Easiest way to do this would be to save your animation to disk as a per frame cache. Then work out the offset in the pop sim for each particle and make that part of your instancepath attribute.

So for each particle you have an attribute which starts at 0 when its born and increments by 1 each frame its alive (basically a framelife counter, you can get this just by doing @age * 24). Then use that to decide which file on disk to instance on to the point.

So on each frame of each particles life, its instancepath attr would be something like:-

cmyAnim/myAnim.0.bgeo
cmyAnim/myAnim.1.bgeo
cmyAnim/myAnim.2.bgeo
cmyAnim/myAnim.3.bgeo …etc


Then the instance sop would be pointed to the correct bgeo on disk for the correct point in time for your animation for each particle. Make sense?

I think you might be able to do this with alembic using 1 alembic file too, as alembic stores animating geo in one .abc file and has a parameter on the importer telling it where in the anim to look.

I'll try to make an example if I can get around to it…
User Avatar
Member
1265 posts
Joined: March 2014
Offline
Dean_19
I was a little confused by your attempted method, i don't think that's how the copy sop is meant to be used. I could be wrong though.

I changed your file to just construct the full instancepath attribute on your particles via a wrangle pop, which just points to one of three sops.

Note I included the ‘op:’ syntax at the start of the instancepath attribute, as we're pointing the instance to nodes, not to files on disk.

Thanks for the help Dean! Much appreciate it.
I was hoping for a simple way without code, but that seems to be the norm in Houdini.
Werner Ziemerink
Head of 3D
www.luma.co.za
User Avatar
Member
319 posts
Joined:
Offline
I think wrangle nodes and direct access to vex is the way sesi are steering things so may as well embrace it!

If you want to do it without the vex code you could do the same thing with an attribute create to create the instancepath string attribute. Although this would then just be replacing vex with expression language.
Edited by - Aug. 18, 2015 05:03:32
User Avatar
Member
1265 posts
Joined: March 2014
Offline
Thanks Dean,

Yes it is time to embrace that part of Houdini. I realised this but I do miss the ease of Softimage when it comes to simple little things like this.

I could not find anything in the help file on how to do this…maybe I missed it. Thanks again for your help.
Werner Ziemerink
Head of 3D
www.luma.co.za
User Avatar
Member
319 posts
Joined:
Offline
You could also do the same thing I did with the pop wrangle with the instance pop, looking at it.

If you tick ‘use vexpression’ it will give you a vex field where you could type in the same code.

The thing with Houdini is its a lower level program, giving you access to the more granular building blocks, which is what makes it more powerful, but at the same time, can make it seem a little more esoteric for newer users.

This particular method probably won't be documented just because there are always numerous ways of doing the same thing, so documenting them all would be almost impossible!
User Avatar
Member
319 posts
Joined:
Offline
Enivob,

Here is a hip file with the offset animation thing you asked about.

To make it work, you'll have to bake out the rop output driver in /obj/Multiple_Objects.

So now this hip file does both instancing from sop nodes with the op: syntax, and instancing files from disk.

Attachments:
rand_instance_v3.hipnc (257.6 KB)

  • Quick Links