JeremyR
Peter, being the API novice that I am, Im wondering if there is anything in MFnParticleSystem that will kill a particle or is this something that has to be written in mel and lifespanPP?
Reply 0 0
pshipkov
Yeah, you have to set PP attribute for that.
Funny i cannot remember right now which one exactly. LifespanPP should be it, but somehow i cannot stop thinking about "age". Will check and report.
Reply 0 0
JeremyR
So have to use MGlobal::ExecuteCommand? Might have more questions on this later, Im just realising how painful OSX is to build, install and compile things, I thought as a noob programmer I would be using the best OS but now I realise how wrong I was. 
Reply 0 0
pshipkov
No, not really - this may easily lead to instability.
I think you should start from proxy dynamic field class and access the lifespan or any other particle arrays there and have full native control over them.

Well, OSX is very good for many things, just not 3D things. :)
Reply 0 0
JeremyR
I was having a look at the volumeAxis field API and I am surprised that I couldnt find any functions to do with bounding volumes, how does the node handle this functionality when its not in the API as far as I can see?
Reply 0 0
JeremyR
Okay is it derived from MFnDagNode::boundingBox?
Reply 0 0
ntashev
I was struggling with bounding volumes for a 'PartcleVolumeMapper' I am building, and could't find anything in the API either, so I guess the volume fields are just calculating the volumes internaly, as my node now does. For simple volumes like sphere, cube or cylinder it turned out quite simple, just by using one matrix. If you're interested I can show you how it's done.
<< aut inveniam viam aut faciam >>
Reply 0 0
JeremyR
Okay that would be good to know. Initially my idea was to just use the bounding volume in SOuP and hook it up through parentMatrix or something like that.

Reply 0 0
ntashev
You can get the volume's orientation and scale via the matrix, but I don't know how you can get any other information outside of the bounding object. When I have time, sometime this week, I will post some of the maths I use to calculate the volume influnce over a point, for some different volume primitives
<< aut inveniam viam aut faciam >>
Reply 0 0
ntashev
Ok here is what I have for now:
1. A test scene, let it play for a few frames, and then run the scripts to test them. Transform the 'box1' to change the orientation and scale of the volume falloff
2. here are to scripts - for spherical and cubical falloff, later on I will post the one for cylinder:
Spherical falloff:
image
code
Cubic falloff:
image
code


Since it's python and the board really messes with formatting and indenting I will just link to the files.
<< aut inveniam viam aut faciam >>
Reply 0 0
JeremyR
Thanks for that, the scene appears a little broken but I got it working. Ill check out the code soon.

cheers
Reply 0 0
Reply