Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Dynamics / nParticle caching with instancer/ initial state?
  RSS 2.0 ATOM  

nParticle caching with instancer/ initial state?
Rate this thread
 
42922
 
Permlink of this thread  
avatar
  • johnnyz
  • Posted: 06 May 2010 07:35 AM
  • Location: Minneapolis,MN
  • Total Posts: 81
  • Joined: 12 July 2007 05:46 PM

Hey all,

I have a scene where I have 6 spheres instanced to a particle shape. I used a custom attribute to randomly assign each sphere to a particle (custom_index = rand (0,6) I run a simulation and set an initial state then re-sim and cache. when i render all my particles instance the same sphere?! the only work around i’ve found is to write a runtime expression for custom_index on every particle. this works but I have over 200 particles and it takes forever to change the expression when a revision comes up. The reason I’m caching is because I’m rendering on a farm. So my question is, is there an option somewhere to keep the assignment each particle received at its original birth? or is there a better expression to write that will assign every 6th particle the same geometry?

here is a sample of what i have in the runtime now.

if (nParticleShape1.particleId == 0)
nParticleShape1.custom_index = 0;
if (nParticleShape1.particleId == 6)
nParticleShape1.custom_index = 0;
if (nParticleShape1.particleId == 12)
nParticleShape1.custom_index = 0; etc.......

if (nParticleShape1.particleId == 1)
nParticleShape1.custom_index = 1;
if (nParticleShape1.particleId == 7)
nParticleShape1.custom_index = 1;
if (nParticleShape1.particleId == 13)
nParticleShape1.custom_index = 1; etc.......

thanks for any help



Replies: 1
/userdata/avatar/avatar_131839.jpg

i found a solution that seems to work in tests. i’m guessing there’s something wrong with my scene but in a test using the modulus (%) worked.

nParticleShape1.custom_index = ((6+nParticleShape1.particleId)%6)

Author: johnnyz

Replied: 06 May 2010 10:08 AM  
avatar
  • johnnyz
  • Posted: 06 May 2010 10:59 AM

in further tests I noticed that nParticles do not cache rotation expressions but regular particles do. (this is all in Maya 2009 by the way) anyone else come across this/know how to fix it or are nParticles just useless aside from being able to collide with each other?



Replies: 1
/userdata/avatar/avatar_131839.jpg

even further tests showed that 2009 just doesn’t cache particles correctly. rendering on a farm using 2011, however seems to have worked. at leas the index issue....

Author: johnnyz

Replied: 07 May 2010 09:40 AM