Results 1 to 8 of 8

Thread: Particle Integration?

  1. #1

    Particle Integration?

    I am trying to get particles emitted from fractures for smoke and dust debris effect. Is there anyone who knows how or can point me in the right direction to get the mel that is included with the latest DMM to create particles. Its seems that the building blocks are all there I just need to know how to use them!

  2. #2

    Re: Particle Integration?

    Hi Rob,

    We've started to work on a tutorial for particles but this is still unfinished work. We've build an emitter node specific to DMM. This is pre-release stuff so it's not well polished yet.

    See attached Python file. Simply copy that file in the Maya plug-ins directory and then load it from the Plug-in Manager. It will add a new node to Maya, named dmmEmitter. As you can guess this node is a particle emitter for DMM objects. It emits particles from every face that fracture.

    At the moment, one dmmEmitter has to be created for each DMM Object you want to have particles for. Below is a MEL script that does that for you. It creates a dmmEmitter + particleShape and attempts to attach it to the selected DMM Object (make sure that your selection is one DMM Object before running that script). As usual you can tweak the particleShape nodes as you like.

    $sel = `ls -selection`;
    $dmmObjName = $sel[0];
    $dmmEmitter = `createNode dmmEmitter`;
    $dmmParticles = `particle`;
    connectDynamic -em $dmmEmitter $dmmParticles;
    connectAttr($dmmObjName + "_DmmObject.tetFlags", $dmmEmitter + ".inTetFlags");
    connectAttr($dmmObjName + "_DmmObject.tetNodes", $dmmEmitter + ".inTetNodes");

    To configure the emitter, select the dmmEmitter node. At the very end of the Attribute Editor, there is the the Extra Attributes panel. You will find two configuration parameters there: Speed Range and Particles Per Fracture. You may want to adjust them to obtain the desired effect.

    See attached file for the dmmEmitter plugin, please rename it to "" before use.

    Let me know how that works for you,
    Attached Files Attached Files
    Getting the plugin ready!

  3. #3

    Re: Particle Integration?


    The main thing wrong with the particle intergration MEL script included in the docs is

    should be changed to


    and then it will work.

    note that you still have to create an expression to call "dmmDoParticles()" everyframe, and have a template particle in the scene.
    expression -s "dmmDoParticles()"  -o templateParticle -ae 1 -uc all -n  dmmAddParticleEXP;
    to start it, select the dmm object and
    source dmmAddParticles; dmmParticlesInit(); dmmAddParticles("templateParticle")
    this assumes you have a mel script in a standard location (windows: My Documents/maya/scripts for example) called "dmmAddParticles.mel" and a particle called "templateParticle"

    also when you go back to the start of your scene the created particles are all still there. i bet the script fixes that, i just found it and am about to see...

    delete ("particle"+"*")
    will get rid of those particles (actually all deletable nodes that start with the word "particle")


    you still have to customize the MEL script dmmDoParticle(vector $v, string $particleString)

    here's mine:
    string $particleName[] = `particle -position ($v.x) ($v.y) ($v.z)`;
    connectDynamic  -f gravityField1 $particleName[0];
    connectDynamic -c floor_outputSurfaceShape $particleName[0];
    setAttr ($particleName[0]+".particleRenderType") 8;  // type 8 is "cloud(s/w)" so it will show up in a render

  4. #4

    Re: Particle Integration?

    Hi there pluginGuy,

    the workaround isn't working for me! If I use the plugin (it loads with no problems on Maya 2009 SP1a x64) and run the little script with an DMM object selected I reicived the following message:

    select -r pCube1 ;
    $sel = `ls -selection`;
    $dmmObjName = $sel[0];
    $dmmEmitter = `createNode dmmEmitter`;
    $dmmParticles = `particle`;
    connectDynamic -em $dmmEmitter $dmmParticles;
    connectAttr($dmmObjName + "_DmmObject.tetFlags", $dmmEmitter + ".inTetFlags");
    connectAttr($dmmObjName + "_DmmObject.tetNodes", $dmmEmitter + ".inTetNodes");
    // Error: The source attribute 'pCube1_DmmObject.tetFlags' cannot be found. //
    // Error: (kInvalidParameter): Argument is a NULL pointer
    # Traceback (most recent call last):
    # File "C:/Users/Usuario/Documents/maya/2009-x64/mrTools/plug-ins/", line 80, in compute
    # tetFlagsData = OpenMaya.MFnIntArrayData(
    # File "C:\engserv\rbuild\195\build\wrk\optim\runTime\Pyt hon\Lib\site-packages\maya\", line 4116, in __init__
    # RuntimeError: (kInvalidParameter): Argument is a NULL pointer //
    if I change the line

    connectAttr($dmmObjName + "_DmmObject.tetFlags", $dmmEmitter + ".inTetFlags");
    with the line

    connectAttr($dmmObjName + "_DmmObject.outputTetFlags", $dmmEmitter + ".inTetFlags");
    there are no errors executing the script, but particles fly all over around the object. What i'm doing wrong?



  5. #5
    Can anyone post the right script?with the fix bugs

  6. #6
    This has been a question I have tried to get answered many many times can we PLEASE get a tutorial on this or a comprehensive script and workflow breakdown.

    Also where in the docs is the mel script shipped with DMM or maya 2012. Maybe if you could post it here

  7. #7
    I can't get the python script to work either. I get the same error as above.


  8. #8
    I recently just tried to follow the steps above and got the same error. Seems like by now this section of DMM would have been taken care
    of, since it is integrated with Maya. A little disappointing if you ask me.

Similar Threads

  1. DMM Integration into the source engine.
    By Bites in forum Discussion
    Replies: 1
    Last Post: 11-07-2010, 01:24 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts