Particle flow and maxscript.

 
 
 
Posted by:ofer_z
Data created:13 July 2010

Hi,

I want to try and expose some missing features of PFlow to maxscript.

However I'm just starting with max.net and couldn't find anything in the documentation about how expose new functions to maxscript. I'm also having trouble accessing a PFlow particle's properties. Can anyone point me to some documentation about this?

Thanks,

o

Hi Ofer,

There is a doc about executing/exposing .NET code in MXS. I'm not very advanced in dealing with PFlow but from what I know all of those properties are exposed through parameter blocks. Is that what you're looking for or do you want to expose something else?

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Hi Marsel,

Thank you for the quick reply!

I actually saw that document, but didn't understand it before (mainly because there's a lot of code missing from it). I since read the other documents and saw your tutorials, so hopefully I'll manage to get that part working now.

As for PFlow, I want to expose the particle's material, however, I don't know where and how it's stored. I don't have access to it through maxscript (obviously), and I've only dealt with maxscript so far. Do you know how I can get the reference for a specifice particle (given a PF system and the particle ID)?

Thanks,

o

Not sure about getting the reference to a particle. PFlow stores each operator as a separate scene node (which are accessed using COREInterface.RootNode.GetChild(...)). From there you can grab properties and sub-operators for it. Not sure how to access particles individually, that would probably be a good question to ask Oleg.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Thanks, I'll try to ask Oleg then.

 

Cheers,

o

Hi Marsel,

How do I get the class id of IMXSParticleContainer and IParticleContainer? Also, how do I get instances those types?

Thanks,

o

Hey Ofer,

IMXSParticleContainer isn't derived from Animatable and therefore doesn't have a class id. It does have an interface id, however, this is from the header file for it:

#define MXSPARTICLECONTAINER_INTERFACE Interface_ID(0x74f93c10, 0x1eb34600)

You can only retrieve it from an existing object and here is how:

((IMXSParticleContainer*)obj->GetInterface(MXSPARTICLECONTAINER_INTERFACE))

I do not think you'll be able to cast to IIMXSParticleContainer in Max.NET at this point, I will need to add that to the next build.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Hey Marsal,

Thank you for the info. I've been struggling with this trying to get an instance of the particle container, and couldn't figure it out. I'll wait until you have a new build to see if it's possible then.

 

Thanks again,

o