ICE instances into Maya
- July 11th, 2012
- Posted in Maya . XSI
- Write comment
There was a follow up to an old discussion on the Softimage mailing list concerning transferring particle instance orders from Soft into Maya. I thought I’d document what I said earlier.
Step 1: Set up instances in ICE
You will need an attribute to control the order of instances in your ICE tree and then to cache out and pass to Maya. I like to call this “indexPP”, but the name doesn’t matter – it simply needs to be the same on the Soft & the Maya sides of the fence.
Inside of ICE, make indexPP a random number from zero to however many objects are in your instance group. Feed this into the “instance shape” node’s index port. Here’s the ICE tree for the above screencap:
Step 2: Transfer cache to Maya
Cache out to nCache, making sure you export the indexPP attribute as well. If you have to do this more than once, script it. The cache manager window is a little tedious to work with.
I’m not aware of the “send to maya” / ICEflow stuff sending extra attributes, so we’re firmly in the land of manually specifying caches, locations and attributes to transfer. With a few wrapper scripts, this sort of thing can roll into your pipeline quite nicely. Plus, Real Men / Women / Small Furry Animals don’t used canned solutions like “send to maya”, right?
Because of ICE’s “agressive”* optimisation, your indexPP attribute may not make it into the cache if ICE doesn’t think it’s in use. Handy, right? One way to force attributes to be evaluated is to do a “show values” somewhere in the tree – making them available in the viewport is enough to ensure they’re evaluated properly. You can also just display 1% of the values (in the “show values properties” dialog box) to make it faster.
*agressive – Recalcitrant, likely to rip your leg off in the process, but ooooh-so fast.
Step 3: Set up Maya particle system
Make a particle system.
Create a per particle scalar attribute called (surprise!) “indexPP”. In the mailing list discussion, I said some dumb stuff about the data types that were needed. Having reviewed the evidence, Soft needs an integer, and Maya can’t do integers per-point.
Now that this attr exists, the cache can load data into it.
Load the cache (nCache->Attach existing cache).
Set up instances. Make sure they’re listed in the instances node in the same order they appear in Soft.
So that the order of this:
should match the order of this!
Tell the instances node to use indexPP to control the instance order. Sometimes you need to click “allow all data types” to let you use the attr you want.
Hopefully, success!
Advanced Kung-fu: instance rotations
To handle rotations for the instances, I’ve usually created a “rotationPP” attr in ICE, and converted the particle’s orientation to an euler angle (using “rotation to euler”). This then gets put into the cache and pulled into Maya, making sure that you create a corresponding “rotationPP” vector per-particle attribute on your particles before you apply the cache. Just make sure the rotation orders are the same on both ends.
Other Attributes
Sending other attributes through nCache isn’t hard, as long as Maya’s dinkly little particle system has a data type that you can hook into, and you get the names the same on both ends.
Hello
Its amazing the workflow you have here!
I just have one question: i need to transfer position, count,
orientation, color.
On doing some tests i ran into a problem that over certain frames the cached particles were dissapearing!! doing some research i found that if i exported the cache without the color information my particles ran smoothly and without missing frame information.
I though that by defining the opacity value might solve it, but havent had any luck.
Do you have some experience exporting color information? btw my particles wont need to change color over time its just a starting defined color what i need all over the sim
thanks
Hey Pablo,
I’ve had a play around and i’ve not been able to repro this.
a lot of the time, when i’ve had the particles disappear, it’s just been a dud frame in the cache, and re-writing it fixed the problem.
sorry i can’t be more helpful.
cheers,
chrisg
Hi Chris,
Thanks for the great tutorial, its helped immensely but I still cannot get the particle rotations to come across. 🙁
Ive created an attribute in ICE called rotationPP by with 3 nodes. (I have tried with and without Rot to Euler btw)
Get pointcloud.Orientation–>Rotation to Euler–>Set Data self.rotationPP
Next I make sure the attribute is called in case the optimizations dont pass it through
Get pointcloud.rotationPP–>Set Data pointcloud.JUNK
I have then tried so many things but nothing seems to pass the data. Ive added rotationPP to the Send To Maya preferences, Ive tried using the Cache Manager but nothing.
On the Maya side, I create an emitter, add the particle parameter rotationPP and then load the cache. The cache loads but when I attach the instance geometry to it they do not rotate.
Any help would be huge!!! Thanks!