Yin Yang

An experimental Micro-Film Project. Abstract portrayal of the tension between light & dark.

Notes On Using Pref Or Position Reference Pass

V-Ray Limitations

At this time of writing, V-Ray GPU doesn’t render the Pref pass out using known techniques. So meanwhile, you’d have to use V-Ray CPU instead. Good thing, Pworld renders perfectly fine in V-Ray GPU.

Nuke Crashes When Using Pref Information

In Nuke, we can use the World Position Texture Projection node to project a texture onto a geometry using the Pref information.

The usage is simple:

  1. Feed in the Pref information into the “point position” handle and the desired texture in to the “src” handle
  2. Color pink the image to sample the vector information
  3. Click on “Bake Position” to store the information in to the node
  4. Viola! (hopefully)
  5. In my experience, Nuke crashes when I try to view the output. There’s no way around this unless we apply this following fix. In my case, V-Ray generated a value too large for Nuke to handle. The solution?
  6. Use a Clamp node to get rid of values you won’t use anyway, and you should be able to use this node with no problems.

Cheers! Happy comp-ing!

The World Position Toolkit I’m referring to is available at this link: http://www.nukepedia.com/toolsets/3d/wptk

Ronald Fong Obj Sequence to Maya MEL

Obj Sequence to Maya

A quick and dirty way to load an .obj sequence in Maya and have each geometry’s visibility automatically keyed to show up at the frame they are supposed to show up. Wrote this script as an experiment, but don’t have time to make a UI, so I just commented on the two variables to change accordingly to your setup. Cheers!

Update [10 Feb 2020]: Made sure the import command explicitly points to the specified folder directory (Thanks Cody for pointing out that the script didn’t work for you!)

global proc rf_objSeqImport() {
string $folder = "C:/objImport/"; //Change the folder directory to the folder containing your .obj sequence
string $mesh = "Mesh"; //Change the word 'Mesh' to the name of the geometry that would be imported

string $objFiles[] = `getFileList -folder $folder -filespec "*.obj"`;
int $i = 0;
while ((size($objFiles[$i])) > 0){
    print ("Importing " + $objFiles[$i] + "... \n");
    file -import -type "OBJ"  -ignoreVersion -ra true -mergeNamespacesOnClash false -namespace ("objImport" + $i) -options "mo=1"  -pr  -importTimeRange "combine" ($folder + $objFiles[$i]);
    currentTime ($i+1) ; //visible on frame
    setAttr ("objImport" + $i + ":" + $mesh + ".visibility") 1;
    setKeyframe ("objImport" + $i + ":" + $mesh + ".v");
    currentTime $i ; //invisible before frame
    setAttr ("objImport" + $i + ":" + $mesh + ".visibility") 0;
    setKeyframe ("objImport" + $i + ":" + $mesh + ".v");
    currentTime ($i+2) ; //invisible after frame
    setAttr ("objImport" + $i + ":" + $mesh + ".visibility") 0; 
    setKeyframe ("objImport" + $i + ":" + $mesh + ".v");


Reconnect attributes of textures and materials

Reconnect attributes textures and materials

Quick MEL script to quickly re-connect existing texture connections from one slot to another within multiple materials. To use, alter the script to determine the attributes to connect/disconnect, then select multiples materials and run the script.

As defaults, the script is set to get the first input node it can find, its outColor attribute, re-connect it to the material’s ambientColor attribute. Then, it disconnects that input node’s outColor attribute from the material’s color attribute.

It should work, but it’s admittedly a very sketchy script. Well, until I find time to improve it. Cheers!

global proc rf_reconnect(){
    string $sel[] = `ls -sl`;
    for ($item in $sel) {
        string $srccon[] = `listConnections -s 1 -d 0 $item`;
        connectAttr -f ($srccon[0] + ".outColor") ($item + ".ambientColor"); //Create New Connection
        disconnectAttr ($srccon[0] + ".outColor") ($item + ".color"); //Remove Old Connection



Using Houdini’s FLIP solver to model the Rayleigh–Taylor instability (after Lord Rayleigh and G. I. Taylor). It is an instability of an interface between two fluids of different densities which occurs when the lighter fluid is pushing the heavier fluid.

  • Houdini
  • Redshift


Most Recent Entries