Varying offset animation per instance basis

   25830   21   2
User Avatar
Member
970 posts
Joined: April 2008
Offline
I know that somebody here must already have answered this question but I could not find it here.

I want to use point instancing to render my bird crowd.

I have my bird rigged on houdini with procedural animation, I want to use this rigged bird on my instance points but i want also to vary it´s animation cycle per point basis.

How can I do that?

Thanks
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
I've been working on just that for quite a while now. A “bird flock simulation tool”. In my setup I used geometry cache to control the birds and copied them on to my particles using the Copy SOP, that way I could stamp a random offset of my animation in chops with a Shift CHOP. And also have tons of other “per bird attributes”.
User Avatar
Member
970 posts
Joined: April 2008
Offline
I am going to try to do that with the Copy SOP.

But the problem that I have with the copy SOP is when it loads the geometry from my bird object it becomes very heavy, I didn't try saving the geometry to the disc though.

Have you tried to do it with point instances, is it possible ?
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
1533 posts
Joined: July 2005
Offline
This thread should clarify things a bit:

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=15645 [sidefx.com]

Holler if you have more questions.

G
User Avatar
Member
970 posts
Joined: April 2008
Offline
Thanks I'll look into it

But for now I need a more practical solution.

xtimmyx, can you tell me exactly how did you use the CHOPS with the bird attributes to change the cycle of the animation?
Edited by - June 17, 2009 15:15:54
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
mzigaib
Thanks I'll look into it

But for now I need a more practical solution.

xtimmyx, can you tell me exactly how did you use the CHOPS with the bird attributes to cycle the animation?

Yes sure, I'll post a description of it tomorrow when I get back to work where I have access to the scene file.
User Avatar
Member
970 posts
Joined: April 2008
Offline
Thanks
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
Back at work again. So, the way I achieved that effect was to basically have a bird geometry with a geometry cache on which was exported from Maya since most of our modeling and animation is done in Maya. How to export a geometry cache in Houdini am I not quite sure of and have never tried.

Anyway, I have my bird model and plug it into a Channel SOP which refers to the cache which is read with a File CHOP in my CHOP network.

This in turn is connected to a Copy SOP with stamping activated, and I'm using
rand($PT)*345
as the expression (345 is just a a number to get the range up).

That's it for the SOP level. In my CHOP Network I have my File Chop with the cache connected to a Shift CHOP with the expression:
stamp(“../../copy_geometry”, wingOffset, 0)
in the Start attribute.

Thats basically it for the wing offset, but I've also built in controls for bird species, size, animation speed, level of detail, speed, banking, spread, collisions, wind, turbulence and a lot more, for easy manipulation of the flock behavior.

Just ask if I was unclear with anything, or everything. And by the way, be careful not to set the display flag on the Copy SOP as it can be quite intense.
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
And I forgot, the animation should preferably be loop able. And needs to be set to “repeat” on the File CHOP.

I guess it could also be achieved with copy stamping a TimeShift and some clever expression for the loop if your bird is animated in Houdini. But that might prove more calculation intense.
User Avatar
Member
970 posts
Joined: April 2008
Offline
xtimmyx, many thanks for the tips man, it will really help.

I didn't know that I could stamp something inside the CHOP network it will definitely will open doors for me .

About the geometry cache, it's awesome that you can export a geometry cache from Maya into Houdini, you can notice now how I am a newbie on Houdini. ops:

If might ask how did you export from Maya and import into Houdini?

And one more question if you don't mind ops:

About controlling the banking of the birds can you give me some tips on how to do it?

I've made a experiment with the upvector node and kind of worked, but it would be nice to know another method.

Anyway thank you very much for the help, and again, it really helped for me.

https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
I didn't know that I could stamp something inside the CHOP network it will definitely will open doors for me .

I didn't know that either until I tried it for this and got a pleasant surprise. Stamping is truly a wonderful technique.

About the geometry cache, it's awesome that you can export a geometry cache from Maya into Houdini, you can notice now how I am a newbie on Houdini. ops:

If might ask how did you export from Maya and import into Houdini?

I've not really figured ot how to read the cache files directly from a File CHOP since it's not just to select the geometry cache file(s) as far as I can tell. What I did was to first export a geometry cache from Maya, then applying this to my geometry and exporting that geometry as a FBX from Maya with geometry cache. I had to create a selection set for the geometry in Maya to choose when exporting the geometry cache in the FBX export settings.

Then I imported the FBX into Houdini and from there I could see what was supposed to be written in the File CHOP (which I have not yet found out the meaning of).

And one more question if you don't mind ops:

About controlling the banking of the birds can you give me some tips on how to do it?

I've made a experiment with the upvector node and kind of worked, but it would be nice to know another method.

I don't mind at all. I'm quite new at Houdini as well and enjoy when there is actually something I can give back to the community for the help I've received.

I had problems with this as well and wrote a forum post about it which helped me.
http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=14819 [sidefx.com]
Right now I can control the bird banking either from a random noise function with control over amplitude/frequency (which I've used exclusively so far), and I also have a banking mode calculated with the use of a UpVector POP which I'll start using on some more complex flight patterns in a couple of days. However I fear that the setup I've come up with so far won't quite do it and I'll have to come up with something better. In my early tests the bird tended to spin around uncontrollably for some reason and I don't think I've solved that problem yet.
User Avatar
Member
970 posts
Joined: April 2008
Offline
Cool!

I did a solution for banking that is controlled by a ramp according to each instance life, I couldn't make them bank automatically but as the rotation on Z is made by a ramp I can manually rotate them according to their life so they all rotate just where I want at the same time.

I just had a problem with some spins when the path is has to much noise, but in a path that´s not so noisy they flow fine.

I actually want a control over the 3 axis rotation separately, I did got a kind of control on them but not according to their velocity axis they just rotate absolutely according to their position into the world space, so all rotate in the same direction.

If you want I can post one of my tests for you to see, and if have any ideas we can share.

Thanks
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
mzigaib
Cool!

I did a solution for banking that is controlled by a ramp according to each instance life, I couldn't make them bank automatically but as the rotation on Z is made by a ramp I can manually rotate them according to their life so they all rotate just where I want at the same time.

I just had a problem with some spins when the path is has to much noise, but in a path that´s not so noisy they flow fine.

I actually want a control over the 3 axis rotation separately, I did got a kind of control on them but not according to their velocity axis they just rotate absolutely according to their position into the world space, so all rotate in the same direction.

If you want I can post one of my tests for you to see, and if have any ideas we can share.

Thanks

Yes I have a solution for setting the banking manual as well, although nothing as cool as a ramp. I have a normal transform node which I have connected the bird geometry to, and then I animate the rotation of that one to rotate the birds. Although with that technique all the birds rotate exactly the same at the same time so I'll guess I'll have to build in some kind of noise function to it on monday when I'm back to work.

Yes please do post some scene, the ramp control sounded interesting. and if you are curious of anything, I could post some test scene as well (however not my complete scenes since they are in production).
User Avatar
Member
970 posts
Joined: April 2008
Offline
No problem, happy that I can help.

I´ll send a scene as soon I get home, one thing that I forgot to mention is that the technique I am using works for point instances so the benefit of rendertime is much better, at the same time with point instances I could not yet randomly change the cycle of the animations between the birds.
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
970 posts
Joined: April 2008
Offline
Sorry for the wait, but there it is.

Check the path_flow node for all the controls.

There are file SOPS that can load your geometry, there are some expressions that can change the wing velocity and offset cycles.

I made several controls for almost everything I needed inclusive ramp controls.

I hope it helps for you to have some ideas to make it better.

I´ll wait for the comments 8)

See ya!

Attachments:
birds.hipnc (357.8 KB)

https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
Thanks for sharing. Quite an impressive VOP POP you had there. I've never used it myself but it looks really powerful.

I see that we have quite a different approach to our setups, each with its own benefits.
I like how your flock can really follow a curve, a feature which my setup still lacks of (however I might try to build in something similar to your technique now that I've got a little inspired. 8)

Another neat thing was the ability to make birds appear and disappear, as in some scenes I've had quite a lot of birds outside of camera since my setup doesn't support alternating particle count thus far.

I'd really like to share my scenes as well however since they're in production I can't do that. But I'll post some screens of my interface which may hopefully give some ideas.
Worth noting is as I've probably mentioned before my setup basically is a group of particles, which is following another group. Called followers and leaders in my setup.

Attachments:
flockSetupScreens.zip (184.5 KB)

User Avatar
Member
970 posts
Joined: April 2008
Offline
Nice!!!!

Lot of controls.

Let me ask you, about the amount of birds, are you using a lot? if you do what is the process that you are using to render all of them?

You see, I have a scene that has a lot of them, so it´s a very heavy scene so I have to find a way to optimize to render since theres a frame that all of them appear on the camera and the COPY SOP takes a lot of time to cook all of them.

Any tips to optimize the render? I saw you talk something about make some of them disapear when outside the camera, did you actually get to do it?
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
mzigaib
Let me ask you, about the amount of birds, are you using a lot? if you do what is the process that you are using to render all of them?

Well I have a couple of shots which probably have a couple of thousands of birds. I guess 5.000 - 10.000 perhaps. But in those scenes almost every bird is very low poly.

mzigaib
You see, I have a scene that has a lot of them, so it´s a very heavy scene so I have to find a way to optimize to render since theres a frame that all of them appear on the camera and the COPY SOP takes a lot of time to cook all of them.

I would suggest to use some kind of low poly proxy for birds which are far away from the camera. And try to have as few “calculations per bird” as possible. But having a low poly proxy really helps.

mzigaib
Any tips to optimize the render? I saw you talk something about make some of them disapear when outside the camera, did you actually get to do it?

Since I cache out all my particles to disk before rendering, and then importing them I can use some expression to not copy geometry to the ones outside of frame I guess. However I have never actually but this into practice although I have to. But It shouldn't really be a problem to make a procedural group of the points visible to the camera and then only copying geometry onto those.
User Avatar
Member
970 posts
Joined: April 2008
Offline
Hummm
That can help me.

The only thing is I don't know how to create a group based on the ones that are visible to the camera.

Do you know how to do it?
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
I've made a quick check now and I can't seem to find any expression or function which determines if a point is visible to the camera. I guess you could write a custom expression based of the cameras position, rotation, focal length and aspect ratio. However it sounds like a quite computational intense expression (but hopefully faster than actually rendering the geometry).

I might just give the expression a try if I find the time when I get back to work. But I'm not a master of expressions and programming so if I even manages to get the expression to work, it probably won't be the most pretty looking script around.

A way to achieve this without scripting would be to parent a “cone” or something to the camera and let it transfer an attribute onto the points which are inside it, then create a group based on that attribute and only copy onto that group. That might be even better.
  • Quick Links