Instance random object on particles
7599 9 2- Werner Ziemerink
- Member
- 1265 posts
- Joined: March 2014
- Offline
- Werner Ziemerink
- Member
- 1265 posts
- Joined: March 2014
- Offline
- Dean_19
- 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.
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.
- Enivob
- 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?
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?
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
- Dean_19
- 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…
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…
- Werner Ziemerink
- 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.
- Dean_19
- 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.
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
- Werner Ziemerink
- Member
- 1265 posts
- Joined: March 2014
- Offline
- Dean_19
- 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!
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!
- Dean_19
- Member
- 319 posts
- Joined:
- Offline
-
- Quick Links