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).

Friday, 28 December 2012

right angle curve Gen Thing


int $segments=20;
int $i=0;
float $xCoord=0;
float $yCoord=0;
float $zCoord=0;
int $direction;
string $curveName=`curve -d 1 -p 0 0 0`;
for ($i=0;$i<$segments;$i++)
{
$direction=rand(0,3);
if ($direction==0)
$xCoord+=rand(-30,30);
else if($direction==1)
$yCoord+=rand(-30,30);
else if($direction==2)
$zCoord+=rand(-30,30);

curve -d 1 -a -p $xCoord $yCoord $zCoord $curveName;

}

Saturday, 15 December 2012

indian macaroon/rons


Thoothukudi Macaroon


2 egg whites - beat them to oblivion. go past the shiny stage and beat till dull.
slowly add 1/2 cup of icing sugar, whilst beating at high speed
slowly add 1/2 cup of roasted ground cashews, WBAHS ^

pipe, bake - GM2 'til firm.

alternatively, make cookies  by using 1 cup icing sugar, 1 cup ground cashews

Friday, 14 December 2012

outliner woes

when Outliner spazzes out and you can't middle drag to group/ungroup shit, check the sort-by is set to Scene Hierarchy!

Monday, 10 December 2012

delta position script


script dump pos-change/accel


int $currentFrame=`currentTime -query`;

float $currentX, $currentY, $currentZ, $pastX,$pastY,$pastZ;
currentTime $currentFrame;
$currentX=`getAttr camera1_animatic8:pCube1.tx`;
$currentY=`getAttr camera1_animatic8:pCube1.ty`;
$currentZ=`getAttr camera1_animatic8:pCube1.tz`;

//currentTime $pastTime;
$pastX=`getAttr -t ($currentFrame-1) camera1_animatic8:pCube1.tx`;
$pastY=`getAttr -t ($currentFrame-1) camera1_animatic8:pCube1.ty`;
$pastZ=`getAttr -t ($currentFrame-1) camera1_animatic8:pCube1.tz`;

float $deltaX, $deltaY, $deltaZ;
$deltaX = $currentX-$pastX;
$deltaY = $currentY-$pastY;
$deltaZ = $currentZ-$pastZ;
float $deltaXsq= `pow $deltaX 2`;
float $deltaYsq=`pow $deltaY 2`;
float $deltaZsq=`pow $deltaZ 2`;
float $magDelta;
$magDelta=(`sqrt ($deltaXsq+$deltaYsq+$deltaZsq)`);
textEm1.speed = $magDelta * 100;

Tuesday, 27 December 2011

Resolving resolutions

Since 2011 is coming to an end, let us see how I did..
Work...Produce two short films. Whatev's

  1. Learn new stuff! Python perhaps, or refamiliarise myself with 3dsMax, Houdini or something? Oh and Zbrush..and Vray. Well, I haven't learned any of the mentioned stuff, but I am pretty handy with Nuke now... That's sort of a success :)
  2. Get a new job/career. Yup. Freelancing now. So far, so good. Tick.
  3. Keep daily Firefox browsing average to under an hour! Draw in downtime and not slack lolz. Lol wut
  4. Make some cash monies outside of main job (photography I hope) Still not sure how to do this!
 Personal..
More holidays/travel! Last year I managed 3, this year I need to have at least 4, or die trying (doesn't necessarily have to be abroad) New York...not much else..sigh
  1. Go to more music gigs, cultural events. Not so many gigs this year, but a fair few cultural thingies
  2. Acquire a new skill of some sort..(driving? new sport, tailoring! diy?) Nadda
  3. New hobby (could be linked to 2) Nadda
  4. Maintain Inverse Panda blog with frequent updates Well, I've started up a tumblr now..so that sort of counts
  5. Finish two substantially sized paintings. I've finished many insubstantially sized ones...A winrar am I.
  6. Decide. Can't actually remember what I'm supposed to decide on. But I think I'll stay in the UK for the time being.