Monday 14 October 2013

After Effects stuff

This expression is pasted in map white to- part of tint effect to use index of layer to drive how dark something is, using linear function.
takes index, sees where it is within range of 1->number of layers in the comp and remaps it from 1->0, then returns a grayscale colour value. Nice.

x=linear(index,1,thisComp.numLayers,1,0);
[x,x,x,x];


This is pasted in a time remap effect of a layer, referencing the time remap value of the "leadLayer". It grabs the current state at "time", then subtracts the index, multiplied by the time offset variable (linked to a slider elsewhere). Good for delaying multiple layers and things.

thisComp.layer("leadLayer").timeRemap.valueAtTime(time-(index-1)*thisComp.layer("controlLayer").effect("timeOffset")("Slider"));


A more straightforward expression. "value" takes the pre existing value and uses that. We then add the control layer's distance offset value and add it, after multiplying it by the index (for multiple layer purposes)

value+thisComp.layer("controlLayer").effect("distanceOffset")("Point")*(index-1);

Monday 2 September 2013

Swapping out layers in After Effects..

To replace a layer in a composition with a new item from the project window select the layer to be replaced in the composition window. Press ALT and drag the item from the project window and drop it on top of the selected layer in the composition window.

Thursday 25 July 2013

realflow editing without realflow..

editing real flow the hard way
-obtain real flow particles in some form - eg. bin cache

-import to maya via "create system using real flow emitter"
-deform particles with lattice or whatever
-create 3d fluid volume around deformed particles, probably wise to activate auto-expand
-add radius pp attrs to the original particles, pipe this into fluidshape (it doesn't read from deformed particles)
-set to surface, convert to mesh
-wait
-profit

Monday 25 February 2013

vray dr command line

Render -r vray -preRender "setAttr \"vraySettings.sys_distributed_rendering_on\" 1;" /Users/beige/Desktop/test.ma

Sunday 3 February 2013

vray - fog on objects

Attach a vray material to the object
Set opacity to 0
In the volume shader slot of the shader group, attach an env. fog/whatever
Profit.

Tuesday 22 January 2013

reverse keys mel script from highend3d


/*  This file downloaded from Highend3d.com
''
''  Highend3d.com File Information:
''
''    Script Name: reverseKeys.mel v1.0
''    Author: D.W. Kim
''    Last Updated: December 19, 2000
''    Update/Change this file at:
''    http://www.highend3d.com/maya/mel/?section=animation#759
''
''  Please do not alter any information above this line
''  it is generated dynamically by Highend3d.com and will
''  be changed automatically on any updates.
*/

// REVERSE KEYS V1.0.1
//
// Copyright (C) 2000 GearCGI Ltd.,
// a subsidary of CGI Inc.
//
// D.W. KIM AND GEARCGI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
// INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
// EVENT SHALL D.W. KIM OR GEARCGI BE LIABLE FOR ANY SPECIAL, INDIRECT OR
// CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
//
// MODIFY THIS AT YOUR OWN RISK
//
// If you are having problems with this script,
// please feel free to mail me directly (dwk@gearprod.com)
// I hope you find it useful and I appreciate any comments,
// suggestions and bug reports.
//
//
// Creation Date:  Dec-19-2000
//
// Author: D.W. Kim
//
// dwk@gearprod.com
//
//
//  Procedure Name:
//
//      reverseKeys;
//
//  Description:
// This simple script reverses keyframes of all objects below in a heiarchy
// Be careful when using this script with objects with any set driven Keys
// because it will reverse them as well.
//
//  Usage:
// user must enter the first and last of the frames to be scaled
// usually this will be the last keyframe of the objects selected.
// eg. reverseKeys(1,200);
//
//  Limitations:
// any keyframes outside the range of keyframes entered will not be scaled
// and could result in unpredictable animation behavior.  Best when used with
// an entire range of keyframes.
//
//-----------------------------------------------------------------------------

global proc reverseKeys (int $firstkey, int $lastkey)

{
int $firstkey ;
int $lastkey;
float $mediankey;
$mediankey =  ($firstkey + $lastkey)/2;
//calculates the pivotpoint of the keys to be scaled

selectKey -hi below;
scaleKey -timeScale -1 -timePivot $mediankey;
}

Saturday 5 January 2013

particle to fluid script


vector $vWPos = worldPosition;
int $iIndices[] = `fluidVoxelInfo -cb -v ($vWPos.x) ($vWPos.y) ($vWPos.z) fluidShape1`;
if(size($iIndices) > 0)
{
float $fFluidVel[] = `getFluidAttr -at "velocity" -xi $iIndices[0] -yi $iIndices[1] -zi $iIndices[2] fluidShape1`;
vector $vFluidVel = <<$fFluidVel[0], $fFluidVel[1], $fFluidVel[2]>>;

vector $vWVel = worldVelocity;
vector $vNewVel = $vFluidVel * drag + $vWVel * (1 - drag);

velocity = $vNewVel;
}


add "drag" as a float scalar attrib to particleshape..
change fluidShape1 to whichever fluid

stolen from super old cgtalk thread.

10-15-2007, 03:37 PM
If you write a particle expression that evaluates the fluid velocity at the particle location (using fluidVoxelInfo and getFluidAttr) then you can apply the fluid velocity to the particle in the manner of an airfield(or drag). Such an expression would simply blend the current particle velocity with the fluid velocity:
v = fv * drag + v * (1-drag)
One could get fancier by basing the amount of drag on the particle mass(less drag for heavier particles).