Okay, I have read the Maya docs, and many of the posts on here about the updating of Maya's DG Nodes, and how and why it works (to some degree...I'm fairly new with the API). But, I'm asking the question in hope to find an answer to my problem.
I have successfully created an MPxEmitterNode that reads data from a file for particle creation (or will, it's hard coded at the moment). Basically the way it works is on the start time of the particles the emitter will create the particles, and on any frame after, it will update the existing particle positions. Somewhat similar to Next Limit's RealFlow Plugin, except that the amount of particles doesn't change.
I have created an attribute within the emitter called "path". This will basically be a directory which I will read all the data from for particle creation and updates.
The problem I'm having is that I want to be able to change the input directory/file on the fly. The user can update this interactively because I have added the attribute to the attribute editor using an AE Template. (Same functionallity as a file texture).
To make this work I added an attributeAffects call within the emitter node that looks like the following
attributeAffects(m\_aPath,mOutput)
m\_aPath is my path Attribute
mOutput is the emitters output to the particle system.
So, the way it works now is if I change the filename, nothing is updated. This would make sense because Maya, from what I understand, won't update the particles until the time changes again, and at that point the file path will have changed.
Now the Question.....
Is there a way to re-evaluate a particle system, when a specific attribute changes, and is this bad programming practice or not within the API.
I guess I would of thought that the emitters compute function would be called with the mOutput plug when I changed the filename (m_aPath attribute), but it's not.
Could I add a dummy attribute, and have that plug call the same part of the compute function?...(That's me just thinking out loud now)
Cheers!
Justin