Tuesday, December 27, 2011

Particle self collision( Maya Particle )

Hi, here is the small tutorial for implementing a self collision for maya particles.
This tutorial shows you a step by step process of implementing particle self collision using radial field.
At the end of this tutorial I also added a small MEL script to automate the whole process.

Self collision step-by-step:
      1. go to particles>create Emitter.
      2. select particle shape node and apply gravity field, go to fields>gravity.
      3. Create a poly Plane. Select particle shape node and plane and go to Particles>Make collide.
        * It is not necessary to make a particle collide with some surface it just to see the effect of self collision.
      4. Again select particle shape node and apply radial field to it, go to fields>Radial.
      5. Select radial field and then particle shape node and go to fields>use selected as source of field.
      6. Now select the radial field and open channel Box and turn on ApplyPerVertex attribute.
      7. Now adjust the maxDisatnce of radial field to get the desired effect.
        * the maxDistance used in a given example is 0.6 .

now play the animation to see the self collision in effect.



MEL Script:

/*
Hemant singh
particle self collision
*/
proc particleSelfCollision()
{
         string $sel[] = `ls -sl`;
         string $getShapeNode[] = `listRelatives -s -noIntermediate $sel[0]`;
         // check: the selected object is a particle node
         if(`nodeType $getShapeNode[0]` == "particle")
        {
                 // create gravity field
                 string $grvtNode[] = `gravity -pos 0 0 0 -m 9.8 -att 0 -dx 0 -dy -1 -dz  0 -mxd -1 -vsh none -vex 0 -vof 0 0 0 -vsw 360 -tsr 0.5`;
                connectDynamic -f $grvtNode[0] $sel[0];
                // create radial field
                string $radlNode[] = `radial -pos 0 0 0 -m 1 -att 1 -typ 0 -pv 1 -mxd 0.6 -vsh none -vex 0 -vof 0 0 0 -vsw 360 -tsr 0.5`;
                connectDynamic -f $radlNode[0] $sel[0];
                addDynamic $radlNode[0] $sel[0];
        }
        else
        {
                error ( "Selected object is not a particle object." );
        }
}


Cheers....


Tuesday, December 13, 2011

Object ID pass

Well, some days back someone asked me for small help to automate the process of generating object ID pass. So I thought lets share it with every one....

so here is a small MEL script for generating object Id pass.

To obtain/setup an object ID pass, please follow these steps:

  • Copy the given script/code to your maya script editor.
  • execute the script.
  • and then execute the following command by supplying the render camera name as an argument
  * for example if you are using "persp" as an render camera then the command will be...

  setUpObjectIdPass("persp")

MEL SCRIPT:

//object ID pass
proc setUpObjectIdPass( string $renderCam )
{
         // get selection list
         string $sel[] = `ls -sl`;
         string $camShapeNode[] = `listRelatives -s -noIntermediate $renderCam`;
         int $id = 1;
         // add miLable attribute
         addAttr -ln "miLabel" -at long -k 1;
         for( $item in $sel )
        {
                 // set object ids
                 setAttr ($item + ".miLabel") $id;
                 $id++;
        }
        // create mentalrayOutputPass and connections
        string $mrOutputPassNode = `createNode mentalrayOutputPass`;
        setAttr ($mrOutputPassNode+".dataType") 11;
        connectAttr -f ($mrOutputPassNode+".message") ($camShapeNode[0]+".mentalRayControls.miOutputShaderList[0]");
}

Hit render and you will get a separate render image of object Id pass as an result.

Cheers....

Wednesday, December 7, 2011

Hemant Singh – Interview with CG Today

Hemant Singh – FX TD
Interview with CG Today

Hemant Singh is a Special Effects Technical Director at Charuvi Design Labs in Delhi. Before attaining this position at CDL, he was a Technical Generalist there. Mr. Singh spent a short time as a Technical Artist and Developer Consultant. He filled the positions of Pipeline Engineer, Rigger and Developer at Ittina Animation Studios. Hemant received his education at Maya Academy of Advanced Cinematics (MAAC) and Rajiv Gandhi Technical University, Bhopal.


See full Interview....