Friday 18 December 2009

picasa image test

 
Posted by Picasa

Monday 2 November 2009

namespace editor, stoleded from internetzz

/* This file downloaded from Highend3d.com
''
'' Highend3d.com File Information:
''
'' Script Name: ks_nameSpaceManager
'' Author:
'' Last Updated: May 30, 2008
'' Update/Change this file at:
'' http://Highend3d.com/maya/downloads/mel_scripts/utility_external/renaming/4923.html
''
'' Please do not alter any information above this line
'' it is generated dynamically by Highend3d.com and will
'' be changed automatically on any updates.
*/
//
// ks_NameSpaceManager by Katrin Schmid 2007,
//
//Features:
// View, rename or remove up to 7 levels of namespaces.
// Remove empty namespaces only and select objects in namespavce options.
// Rename and keep in hierarchy or move namespace to root namespace.
// Rename and remove is only possible with unreferenced objects.
// You can apply "Make unique names" after removing namespaces to ensure unique object names

// Install: Put ks_nameSpaceManager.mel in you script directory.
// Start the GUI by typing "ks_nameSpaceManager" in the script editor.
//
// Usage:
// List namespaces, then you can start renaming.
// Apply "Make unique names" after removing namespaces to ensure unique object names
//

string $allrGlobalsNodes[] = `ls -l -type renderGlobals`; //defaultRenderGlobals
catch(`setAttr -type "string" ($allrGlobalsNodes[0] + ".currentRenderer") "mentalRay"`);
global int $gl_debug;

////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////main
////////////////////////////////////////////////////////////////////
global proc ks_nameSpaceManager()
{
global string $gl_frNameSpc;

if (`window -query -exists ks__nSpaceManager`)
deleteUI ks__nSpaceManager;

// Strings declarations
string $title = " ks_NameSpaceManager";
string $sh = "showHelp -absolute \"http://www.lo-motion.de/scripts\"";

//UI-Window
window -wh 400 620 -menuBar true
-title $title
-s 1
ks__nSpaceManager;

// Help menue
menu -label "Help" -helpMenu true;
menuItem -label "About" -c $sh;

// Layout
string $form = `formLayout`;
string $child1 = `columnLayout -adjustableColumn true`;
frameLayout -label "" -li 7 -borderStyle "out" -marginHeight 0 -marginWidth 8 -labelAlign "top";
rowLayout -numberOfColumns 1 -columnAlign1 "left" ; // -columnWidth2 230 300
// column 1
columnLayout -rowSpacing 3 -columnWidth 230 col2; //-columnAttach "both" 5

text -align left -w 200 -fn boldLabelFont -label " Check namespaces:";
// text -align left -w 200 -fn boldLabelFont -label "Check name spaces:" ch_ge_namespaces;
radioButtonGrp -l "" -numberOfRadioButtons 3 -columnWidth2 10 230 -p "col2"
-ct2 "left" "left" -select 1 -vr
-labelArray3 "List name spaces" "Remove empty" "Remove all (unreferenced objects)"
rbg_collNmspces;
// text -label "Rename selected namespace to:";
button -bgc .5 .7 .7 -align "left" -w 155 -l " Check/remove" -c "pa_checkScene()";
// button -align "left" -enable 0 -w 150 -l "add namespace" -c "" bu_addNmspc;

text -align left -w 200 -fn boldLabelFont -label "All namespaces:";
$gl_frNameSpc = `optionMenuGrp -adj 0 -cw 1 4 -enable false -w 170 -cat 1 "left" 0 -cc "" me_nameSpc`;
menuItem -p ($gl_frNameSpc + "|OptionMenu") -l " ";
button -align "left" -enable 0 -w 155 -l " Select objects in namespace" -c "pa_selectObjInNamespaces()" bu_selNmspc;
text -label "";
text -align left -w 200 -fn boldLabelFont -l "Rename selected namespace to:" ;
radioButtonGrp -l "" -numberOfRadioButtons 2 -columnWidth2 1 180 //-p "col3"
-ct2 "left" "left" -select 1 -vr
-labelArray2 "keep namespace hierarchy" "move to root" rbg_hierNmspces;
textField -w 155 tx_renameNmspce;

button -align "left" -enable 0 -w 155 -l "Rename selected namespace" -c "pa_renameNamespace()" bu_renNmspc;
setParent ..;
setParent ..;
setParent ..;
////
frameLayout -label "" -li 7 -borderStyle "out" -marginHeight 7 -marginWidth 10 -labelAlign "bottom";
rowLayout -numberOfColumns 2 -columnWidth2 230 300 -columnAlign1 "left" ;
// column 1
columnLayout -rowSpacing 6 -columnWidth 230 col4; //-columnAttach "both" 5
button -bgc .5 .7 .7 -align "left" -enable 1 -w 155 -l " Rename to unique names" -c "makeUniqueName" bu_uniNm;
setParent ..;
columnLayout -rowSpacing 6 -columnWidth 230 col5; //-columnAttach "both" 5
setParent ..;
setParent ..;
setParent ..;
///
showWindow ks__nSpaceManager;
}

////////////////////////////////////////////////
global proc pa_handleRadio(string $btgrName, int $onOff)
{
//string $btgrName, int $onOff
radioButtonGrp -e -enable1 $onOff -enable2 $onOff $btgrName;
}



//////////////////////////////////////////////////////////////////////////////////////
//////////////////////break connection of given dest attribute
global proc pa_breakConnection(string $destName)
{
global int $gl_debug;
if ($gl_debug)
{
print ("pa_breakConnection(string $destName)");
}

if (`connectionInfo -isDestination $destName`)
{
string $destination = `connectionInfo -getExactDestination $destName`;
string $srcConn[] = `listConnections -s 1 -d 0 -type character $destination`;
if (size($srcConn))
{
string $warnMsg = ("Removed \'"+ $destination +"\' from character \'" + $srcConn[0]+"\'.");
warning($warnMsg);
character -e -rm $srcConn[0] $destination;
}
string $sArr[1] = `ls -l -ro $destination`;

if (size($sArr))
{
string $src = `connectionInfo -sourceFromDestination $destination`;
disconnectAttr $src $destination;
}
else
{
delete -icn $destination;
}
}
}



//////////////////////////////////////////////////////////////////
global proc pa_checkScene()
{
global int $gl_debug;
if ($gl_debug)
{
print ("pa_checkScene()"+"\n");
}

int $nVal=`radioButtonGrp -q -sl rbg_collNmspces`;
if($nVal==1)
{
pa_listNamespaces(1);
}
else if($nVal==2)
{
pa_listNamespaces(0);
}
else if($nVal==3)
{
pa_removeUnrefNamespaces();
}
}


//////////////////////////////////////////////////////////////////
global proc pa_selectObjInNamespaces()
{
global int $gl_debug;
if ($gl_debug)
{
print("pa_selectObjInNamespaces()" +"\n");
}


select -d;
string $nameSpc =`optionMenuGrp -q -v me_nameSpc`;
if (`size($nameSpc)`!=0 && `namespace -exists (":" + $nameSpc)`)
{
namespace -set (":" + $nameSpc);
string $objsNamesp[] =`namespaceInfo -dagPath -ls`;
for ($t = 0; $t < size($objsNamesp); $t++)
{
if (`objExists $objsNamesp[$t]`)
{
select -add $objsNamesp[$t];
}
}
namespace -set ":";
}
}

/*
for ($i = 0; $i < size($nameSpaces); $i++)
{
if ($nameSpaces[$i]!= "UI" && $nameSpaces[$i]!= "shared")
{
// delete empty
namespace -set (":" + $nameSpaces[$i]);
string $objs[]= `namespaceInfo -ls`;
if (`size($objs)`==0 && `namespace -exists (":" + $nameSpaces[$i])`)
{
print ("Removed empty namespace: " + $nameSpaces[$i] +"\n");
namespace -set ":";
catch(`namespace -removeNamespace (":" + $nameSpaces[$i])`);
}
else
{
//level 2
$allNameSpc[`size($allNameSpc)`]= $nameSpaces[$i];
string $level2NameSpaces[]= pa_getNamespaces($nameSpaces[$i]);
}
}
}
*/

//////////////////////////////////////////////////////////////////
global proc string[] pa_getNamespaces(string $nameSpace)
{
global int $gl_debug;
if ($gl_debug)
{
print ("$nameSpace: "+ $nameSpace +"\n");
}


namespace -set (":" + $nameSpace);
string $nSpaces[]=`namespaceInfo -lon`;

for ($t = 0; $t < size($nSpaces); $t++)
{
string $objs[]= `namespaceInfo -dagPath -ls`;
if (`size($objs)`== 0 && `namespace -exists $nameSpace`)
{
print ("Removed empty namespace: " + $nameSpace +"\n");
namespace -removeNamespace (":" + $nameSpace);
string $remove[]={$nameSpace};
stringArrayRemove($remove, $nSpaces);
}
}

return $nSpaces;
}



//namespaceInfo -currentNamespace;
//////////////////////////////////////////////////////////////////
global proc string [] pa_listNamespaces(int $showInMenu)
{
global int $gl_debug;
if ($gl_debug)
{
print("pa_listNamespaces()" +"\n");
}

global string $gl_frNameSpc;
string $allNameSpc[];
string $level2NameSpaces[];
string $level3NameSpaces[];
string $level4NameSpaces[];
string $level5NameSpaces[];
string $level6NameSpaces[];
string $level7NameSpaces[];
int $count=0;

if ($showInMenu == 1)
{
button -e -enable true bu_selNmspc;
button -e -enable true bu_renNmspc;
}
else
{
button -e -enable 0 bu_selNmspc;
button -e -enable 0 bu_renNmspc;
}

//deleteMenueItems
string $menItems[] = `optionMenuGrp -q -itemListLong me_nameSpc`;
for ($t = 0; $t < size($menItems); $t++)
{
deleteUI $menItems[$t];
}

namespace -set ":";
string $nameSpaces[] = `namespaceInfo -lon`;
optionMenuGrp -e -enable true me_nameSpc;

for ($i = 0; $i < size($nameSpaces); $i++)
{
if ($nameSpaces[$i]!= "UI" && $nameSpaces[$i]!= "shared")
{
// delete empty
namespace -set (":" + $nameSpaces[$i]);
string $objs[]= `namespaceInfo -dagPath -ls`;
if (`size($objs)`==0 && $showInMenu == 0 )
{
$count++;
print ("Removed empty namespace: " + $nameSpaces[$i] +"\n");
namespace -set ":";
catch(`namespace -removeNamespace (":" + $nameSpaces[$i])`);
}
else
{
//level 2
$allNameSpc[`size($allNameSpc)`]= $nameSpaces[$i];
$level2NameSpaces= pa_getNamespaces($nameSpaces[$i]);
if ($showInMenu==1)
{
menuItem -p ($gl_frNameSpc + "|OptionMenu") -l $nameSpaces[$i];
}

for ($p = 0; $p < size($level2NameSpaces); $p++)
{
$allNameSpc[`size($allNameSpc)`]= $level2NameSpaces[$p];
if ($showInMenu==1)
{
menuItem -p ($gl_frNameSpc + "|OptionMenu") -l $level2NameSpaces[$p];
}
}
}
}
}
// level 3
for ($f = 0; $f < size($level2NameSpaces); $f++)
{
// print ("$level2NameSpaces[$f]: " +$level2NameSpaces[$f]+"\n");
$level3NameSpaces= pa_getNamespaces(":" + $level2NameSpaces[$f]);
//print ("$level3NameSpaces:+++++" +"\n");
// print ($level3NameSpaces);

for ($g = 0; $g < size($level3NameSpaces); $g++)
{
$allNameSpc[`size($allNameSpc)`]= $level3NameSpaces[$g];
if ($showInMenu==1)
{
menuItem -p ($gl_frNameSpc + "|OptionMenu") -l $level3NameSpaces[$g];
}
}
}

// level 4
for ($h = 0; $h < size($level3NameSpaces); $h++)
{
// print ("$level3NameSpaces[$f]:+++++ " +$level3NameSpaces[$h]+"\n");
$level4NameSpaces= pa_getNamespaces(":"+$level3NameSpaces[$h]);

// print ("$level4NameSpaces" +"\n");
print ($level4NameSpaces);

for ($u = 0; $u < size($level4NameSpaces); $u++)
{
$allNameSpc[`size($allNameSpc)`]= $level4NameSpaces[$u];
if ($showInMenu==1)
{
menuItem -p ($gl_frNameSpc + "|OptionMenu") -l $level4NameSpaces[$u];
}
}
}

// level 5
for ($q = 0; $q < size($level4NameSpaces); $q++)
{
$level5NameSpaces= pa_getNamespaces(":" +$level4NameSpaces[$q]);
for ($v = 0; $v < size($level5NameSpaces); $v++)
{
$allNameSpc[`size($allNameSpc)`]= $level5NameSpaces[$v];
if ($showInMenu==1)
{
menuItem -p ($gl_frNameSpc + "|OptionMenu") -l $level5NameSpaces[$v];
}
}
}

// level 6
for ($b = 0; $b < size($level5NameSpaces); $b++)
{
$level6NameSpaces= pa_getNamespaces(":" +$level5NameSpaces[$b]);
for ($w = 0; $w < size($level6NameSpaces); $w++)
{
$allNameSpc[`size($allNameSpc)`]= $level6NameSpaces[$w];
if ($showInMenu==1)
{
menuItem -p ($gl_frNameSpc + "|OptionMenu") -l $level6NameSpaces[$w];
}
}
}

// level 7
for ($a = 0; $a < size($level6NameSpaces); $a++)
{
$level7NameSpaces= pa_getNamespaces(":" +$level6NameSpaces[$a]);
for ($x = 0; $x < size($level7NameSpaces); $x++)
{
$allNameSpc[`size($allNameSpc)`]= $level7NameSpaces[$x];
if ($showInMenu==1)
{
menuItem -p ($gl_frNameSpc + "|OptionMenu") -l $level7NameSpaces[$x];
}
}
}
radioButtonGrp -e -label2 ("Remove empty: " + $count +" removed.") rbg_collNmspces;
return $allNameSpc;
}


///////////////////////////////////////////////////////////////
// move namespace back to root ":"
global proc pa_removeUnrefNamespaces()
{
global int $gl_debug;
if ($gl_debug)
{
print ("pa_removeUnrefNamespaces()" +"\n");
}

int $remCount, $notRem=0;
namespace -set ":";
string $allNmspces[] = pa_listNamespaces(0);
string $refNmspces[];
string $refNames[]= `ls -l -type reference`;

for ($i = 0; $i < size($refNames); $i++)
{
if (`gmatch $refNames[$i] "*sharedReferenceNode*"` == 0 && `gmatch $refNames[$i] "*UNKNOWN_REF_NODE*"`==0)
{
string $selRefFileUnR = `getAttr ($refNames[$i] + ".fileNames[0]")`;
// string $selRefFileUnR = `referenceQuery -unresolvedName -filename $refNames[$i]`;
//print ("$refNmspces[size($refNmspces)]: " + $refNmspces[`size($refNmspces)`] +"\n");
if (`size($selRefFileUnR)` > 0)
{
$refNmspces[`size($refNmspces)`]= `file -q -ns $selRefFileUnR`;
}
}
}

string $unrefNamespaces[] = stringArrayRemove($refNmspces, $allNmspces);

for ($p = `size($unrefNamespaces)`;$p >= 0; $p--)
{
namespace -set ":";
if (`size($unrefNamespaces[$p])`> 0 && `namespace -exists (":"+ $unrefNamespaces[$p])` && $unrefNamespaces[$p]!= ":")
{
catch(`namespace -force -mv (":"+ $unrefNamespaces[$p]) ":"`);
namespace -set (":"+ $unrefNamespaces[$p]);
string $objsNamesp[] =`namespaceInfo -dagPath -ls`;
namespace -set ":";

if (`size($objsNamesp)`==0)
{
catch(`namespace -rm $unrefNamespaces[$p]`);
print ("REMOVED:$unrefNamespaces[$p]: "+ $p+ (" :"+ $unrefNamespaces[$p]) +"\n");
$remCount++;
}
}
else
{
$notRem++;
print ("NOTFOUND: "+ $p+ (" :"+ $unrefNamespaces[$p]) +"\n");
}
}
radioButtonGrp -e -label3 ("Remove all: " + $remCount +" removed, "+ ($notRem-1)+ " not removed.") rbg_collNmspces;
}




///////////////////////////////////////////////////////////////
global proc pa_checkReferences()
{
global int $gl_debug;
if ($gl_debug)
{
print("pa_checkReferences()" +"\n");
}

// getAttr TestspRN.fileNames[0]

string $selRefFileUnR;
string $selRefFile;

//textScrollList -e -enable true -ra ts_refFound;
//textScrollList -e -enable true -ra ts_refNotFound;

RNdeleteUnused;
string $refNames[]= `ls -l -type reference`;

for ($i = 0; $i < size($refNames); $i++)
{

if (`gmatch $refNames[$i] "*sharedReferenceNode*"` == 0 && `gmatch $refNames[$i] "*UNKNOWN_REF_NODE*"`==0)
{
//$selRefFileUnR = `referenceQuery -unresolvedName -filename $refNames[$i]`;
$selRefFileUnR = `getAttr ($refNames[$i] + ".fileNames[0]")`;
if (`size($selRefFileUnR)` > 0)
{
$selRefFile = `referenceQuery -filename $refNames[$i]`;
}
}
else if (`gmatch $refNames[$i] "*UNKNOWN_REF_NODE*"`)
{
$selRefFile ="";
$selRefFileUnR =$refNames[$i];
}
string $bufferPP[];

if (`size($selRefFileUnR)` > 0 && $selRefFile != $selRefFileUnR && `gmatch $refNames[$i] "*sharedReferenceNode*"` == 0)
{
string $dir= `workspace -q -rd`;
// Result: D:/maya/workflow/
int $numTokensPP = `tokenize $selRefFileUnR "//" $bufferPP`;
print ("Found ref: " +($dir + $bufferPP[$numTokensPP-1])+"\n");
//Found ref: D:/maya/workflow/B_data_3D/Testsp.mb

if ((`filetest -f ($dir + $bufferPP[$numTokensPP-1])`) == 1)
{
print ("Found ref: " +($refNames[$i]+":" + $selRefFile)+"\n");
// textScrollList -e -append ($bufferPP[$numTokensPP-1]) ts_refFound;
}
else
{
print ("Missing/ empty ref: " +($selRefFileUnR)+"\n");
}

}
else if (`gmatch $refNames[$i] "*sharedReferenceNode*"` == 0 )
{
if ((`filetest -f ($selRefFile)`) == 1)
{
// textScrollList -e -append ($refNames[$i]+":" + $selRefFile) ts_refFound;
print ("Found ref: " +($refNames[$i]+":" + $selRefFile)+"\n");
}
else
{
// textScrollList -e -append ($refNames[$i] + "c") ts_refNotFound;
print ("Missing ref: " +($selRefFile)+"\n");
}
}
}
}


/////////////////////////////////
global proc pa_renameNamespace()
{
global int $gl_debug;
if ($gl_debug)
{
print(" pa_renameNamespace()" +"\n");
}

int $nVal=`radioButtonGrp -q -sl rbg_hierNmspces`;
string $oldNameSpc =`optionMenuGrp -q -v me_nameSpc`;
string $newName =`textField -q -tx tx_renameNmspce`;
string $clName;
if (isValidString($newName, "([a-zA-Z]+)([a-zA-Z0-9_])*")==0)
{
$clName = substituteAllString($newName, " ", "_");
}
else
{
$clName = $newName;
}

// print ("$oldNameSpc: "+$oldNameSpc+"\n");
// print ("$clName: "+ $clName+"\n");
string $bufferPP[];
int $numTokensPP = `tokenize $oldNameSpc ":" $bufferPP`;
int $nSize= `size($bufferPP[$numTokensPP-1])`;
int $oSize= `size($oldNameSpc)`;
string $oldNamePath = `substring $oldNameSpc 1 ($oSize-$nSize)`;

namespace -set ":";
if (`namespace -exists (":" + $clName)`)
{
$clName= $clName +"1";
}

/////////
if(`size($bufferPP)`> 1 && $nVal==1 && `namespace -exists (":"+ $oldNamePath)`)
{
namespace -add $clName -p (":"+ $oldNamePath);
// print ("t:" +(":"+ $oldNamePath + $clName)+"\n");
if (`namespace -exists (":"+ $oldNamePath + $clName)`)
{
namespace -f -mv $oldNameSpc (":"+ $oldNamePath + $clName);
namespace -rm $oldNameSpc;
}
}
else //if ($nVal==2)
{
namespace -add ($clName) -p ":" ;
if (`namespace -exists (":"+ $oldNameSpc)` && `namespace -exists (":"+ $clName)`)
{
print ("hier: " +(":"+$clName)+"\n");
namespace -f -mv (":"+ $oldNameSpc) (":"+ $clName);
namespace -rm $oldNameSpc;
}
}

pa_listNamespaces(1);
}


////////////////////////////
global proc makeUniqueName()
{
// longNmaeof
global int $gl_debug;
if ($gl_debug)
{
print ("makeUniqueNames: " +"\n");
}

namespace -set ":";

string $allobjs[] = `ls -l -tr -mat -tex`;//-tr
for ($i= 0; $i < size($allobjs); $i++)
{
// print ($i + "$allobjs[$i]: " + $allobjs[$i] +"\n");
int $found=0;
if(`objExists $allobjs[$i]` && $allobjs[$i]!="|front" && $allobjs[$i]!="|persp" && $allobjs[$i]!="|top" && $allobjs[$i]!="|side")
{
string $buffer[];
tokenize $allobjs[$i] "|" $buffer;
string $shortNameI = $buffer[`size($buffer)`-1];
for ($t= 0; $t < size($allobjs); $t++)
{
string $buffer1[];
tokenize $allobjs[$t] "|" $buffer1;
string $shortNameT = $buffer1[`size($buffer1)`-1];

if (`objExists $allobjs[$t]` && $i!=$t && $shortNameI == $shortNameT && `referenceQuery -isNodeReferenced $allobjs[$t]`== 0)
{
int $check[]=`lockNode -q -lock $allobjs[$t]`;
if ($check[0] ==1)
{
lockNode -lock 0 $allobjs[$t];
}
string $newName1 = "";
int $n = 0;
select -r $allobjs[$t];
if ($n = catchQuiet($newName1 = `rename($shortNameT + "#")`))
{
print ("Cannot rename.T +"+$shortNameT+"\n");
}
else
{
print ("Renamed.T "+$shortNameT+"\n");
}
if ($n==0)
{
string $longNewNameI[] =`ls -l -sl`;
$allobjs[$t]= $longNewNameI[0];
}
$found=1;
}
}
}
}
}

reinitialise setup machine menu script

if (`objExists TSM2FKIKSwitch`)
delete TSM2FKIKSwitch;
if (`menu -exists TSM2ControlsMenu`) deleteUI -menu TSM2ControlsMenu;

string $path = `pluginInfo -q -path "TSM2"`;
$path = (dirname($path) + "/TSM2/FKIK.mel");
int $file = `fopen $path "r"`;
string $fkikScript = "";
string $nextLine = `fgetline $file`;
while(size($nextLine) > 0) {
$fkikScript += $nextLine;
$nextLine = `fgetline $file`;
}
fclose $file;
$path = `pluginInfo -q -path "TSM2"`;
$path = (dirname($path) + "/TSM2/TSM2_mirrorPose.mel");
int $file = `fopen $path "r"`;
string $mirrorScript = "";
string $nextLine = `fgetline $file`;
while(size($nextLine) > 0) {
$mirrorScript += $nextLine;
$nextLine = `fgetline $file`;
}
fclose $file;
$mirrorScript += "\n\nTSM2_mirrorPose;";
string $afterScript = "if (`menu -exists TSM2ControlsMenu`) deleteUI -menu TSM2ControlsMenu";
string $beforeScript;
$beforeScript = "doEnableNodeItems false all; doEnableNodeItems true all;\n";
$beforeScript += "menu -to true -label \"TSM Controls\" -parent $gMainWindow TSM2ControlsMenu;";
$beforeScript += ("menuItem -label \"FKIK Switch\" -command \"" + (encodeString($fkikScript)) + "\";");
$beforeScript += ("menuItem -label \"Refresh Rig\" -command \"doEnableNodeItems false all; doEnableNodeItems true all;\";");
$beforeScript += ("menuItem -label \"Mirror Pose\" -command \"" + (encodeString($mirrorScript)) + "\";");
scriptNode -st 2 -bs $beforeScript -as $afterScript -n TSM2FKIKSwitch;
scriptNode -executeBefore TSM2FKIKSwitch;

Friday 2 October 2009

Odopod!

Thursday 24 September 2009

Fake Update #89743744

  1. Make sphere, apply modelling/texture
  2. Delete History
  3. Apply Lattice, deform
  4. Constrain to aim object
  5. Group Sphere,Lattice & Lattice Base
  6. Parent group to bone/head/other thing
  7. ???
  8. Profit

Thursday 20 August 2009

Fake Update #89743743

  1. Convert eyeball to polygon.
  2. Geo constrain pupil to eyeball.
  3. Aim constrain pupil to eyeball. //Alternatively normal constrain it...
  4. Point constrain pupil to controller.
  5. ???
  6. Profit.

Wednesday 22 July 2009

unashamed use of blog storage

This is useful...

// build fur files

HfBuildFurFiles(string $fPath, int $equalOption)

// Build equalizer maps

HfBuildEqualMap()

// build fur shadows and images

HfBuildFurImages(string $fPath, string $sdwPath, string $imgPath, int $buildShadow, int $buildImage)

// Cancel Advanced Fur Rendering

HfCancelAFR()

Where:

//$fPath = furFiles/SceneName

//$sdwPath = furImages/SceneName

//$imgPath = furShadowMap/SceneName

//$equalOption = 0(No Equalizer) OR 1(Default Equalizer)

//$buildShadow = 1 (ShadowMaps will be geneareted) / 0 (No Shadow Maps)

//$buildImage = 1 (Imagefiles will be geneareted) / 0 (No Image files)

Monday 20 July 2009

Interesting update #001

Well I've been working on my E4 sting idea for a few weeks now & its coming along nicely.
Here's an image of the lead character. A baboon!
I'm in the process of rigging it up & I think animation will be started by the end of the week. The background set is in progress too, though there's a lot of lighting & fancy stuff I haven't fully decided on yet. Rendering times are definitely a bottleneck in this project, thanks to my annoying habit of wanting stuff to look awesome.

More to come soon(ish).

Thursday 18 June 2009

t'is the season to be WORKING WTF?!

Its E4 sting competition season again. I've always been too busy to do anything for it. Or just plain lazy. Usually I find out about these contests 2 weeks before the deadline and its too late for anything half decent to be made, but this year I was alerted by Sam, a whole 2 months in advance!

In general Im not a fan of most animated TV stings (MTV, I'm looking at you)... it'd be nice to see something done with a bit of production value for once! Even if I don't win, at least I'll have a nice finished piece for my reel.

Here are some thumbnail concept sketches/CG mockups :



Creating a pile of boxes is harder than you'd think.. I hate doing stuff like this by hand! This 10 second short will be produced in 1080P because I'm extra :) With any luck I'll keep this updated...

Friday 22 May 2009

Wednesday 20 May 2009

Chicken & Sweetcorn Soup!

mmmmm. This took 90mins to make! I didn't have any creamed corn...so I decided to make my own! Delicious!

Creamed Corn recipe -
1 can sweet corn
2 teaspoons sugar
1 clove of garlic
250ml water
knob of butter
tub of cream fraiche- 150ml roughly

  1. Melt butter in pan
  2. Throw in sweet corn (just the corn - no juice!), add sugar and the finely chopped garlic
  3. Sweat it for 10 mins on low heat
  4. Add water, cook for 20 more minutes, medium low heat
  5. Take out 2/3, whack it in a blender and add cream, till its silky smooth
  6. Mix the unblended 1/3 of corn into the cream
  7. Serve up hot or cold......OR proceed to making this chicken soup!!
Chicken & Sweetcorn soup recipe!

Can's worth of creamed corn
2 chicken legs (thigh & drumstick)
Thumb size chunk of ginger
2 spring onion sprigs
2 cloves of garlic
2 tablespoons soya sauce
1 teaspoon cornflour
1 teaspoon sesame oil
1 litre water
1 chicken stock cube

  1. brown up the chicken legs with ginger, garlic cloves & roughly chopped spring onions for 5 minutes
  2. throw in the water, stock cube & 1 table spoon of soya sauce
  3. simmer for 30 minutes
  4. remove chicken legs, scrape off meat, then throw the skin & bones back into the liquid
  5. simmer for 30minutes
  6. sieve liquid
  7. add creamed corn & meat
  8. put a little water in a mug with the cornflour and stir well, before throwing that in too
  9. mix & simmer
  10. beat an egg with the sesame oil & a drop of soya sauce
  11. mix that into the soup
  12. garnish with spring onion
  13. ?????
  14. profit
Very tasty!

The Space-time physics of Boredom part 1.

Time flies when you're having fun. It crawls when you're bored.
This would suggest that time is merely what we perceive it to be and that our perceptions can be altered by a number of things.

So why can't we make time last longer when we're having fun or merely enjoying ourselves?
Well... when you're bored, your brain generally isn't being stimulated & your mind notices this. It also notices the passage of time...and...how...painfully....slow...it...is..

However, as soon as genuinely interesting things happen, your brain shifts into gear and you become immersed in this new thing. Your mind won't notice this new stimulation. It just blindly accepts it & blam! time rolls along without you realising it's stupid slowness. In fact, it speeds up.

So time is dependant on our variable perceptions and we can actually control the rate of flow of time! It always goes forwards, make no mistake about that. In theory, if we were to become infinitely bored....we would also be able to slow down time to an infinitely slow pace. In effect, stopping time. We could also speed up time by having more fun!

Stay tuned for more bullshit science!

Monday 18 May 2009

Useful code for a rainy day.

I stole most of this from the Autodesk Area blog and adapted it. It lets you attach follicles in Maya depending on the level of blue in the given textureNode... To do - attach feathers/scales to objects, fancy controls.. density etc.

proc attachObjectToSurface(string $surface, float $u, float $v )
{
string $follicle = `createNode follicle`;
string $tforms[] = `listTransforms $follicle`;
string $follicleDag = $tforms[0];


connectAttr ($surface + ".worldMatrix[0]") ($follicle + ".inputWorldMatrix");
string $nType = `nodeType $surface`;
if( "nurbsSurface" == $nType ){
connectAttr ($surface + ".local") ($follicle + ".inputSurface");
} else {
connectAttr ($surface + ".outMesh") ($follicle + ".inputMesh");
}
connectAttr ($follicle + ".outTranslate") ($follicleDag + ".translate");
connectAttr ($follicle + ".outRotate") ($follicleDag + ".rotate");
setAttr -lock true ($follicleDag + ".translate");
setAttr -lock true ($follicleDag + ".rotate");
setAttr ($follicle + ".parameterU") $u;
setAttr ($follicle + ".parameterV") $v;

//parent -addObject -shape $obj $follicleDag;
//parent $obj $follicleDag;
}

proc scanSurface()
{
string $selection[]=`ls -sl`;
//string $obj=$selection[0];
string $surface=$selection[0];
float $i;
float $j;
for($i=0; $i<=100; $i++){ for($j=0; $j<=100; $j++){ float $Ucoord=$i/100; print $Ucoord; float $Vcoord=$j/100; print $Vcoord; float $values[]=`colorAtPoint -o RGB -u $Ucoord -v $Vcoord file1`; if($values[2]>=0.75)
{
attachObjectToSurface($surface, $Ucoord, $Vcoord);
}
}}

}

Sunday 17 May 2009

Dude, where's my rolling pin?

Somehow I managed to lose a rather hefty rolling pin on my way home from grocery shopping today. It only cost 99pence, so I'm not shedding any (real) tears over it - but still, I was looking forward to rolling out some clay today!!
I believe the pin dropped through a whole in the poorly constructed Wilkinsons' plastic bag, probably somewhere in the park.....thus not making any noise. So...someone's dog has a new chew toy. Fallen Rolling pin, we salute you.




Mmmmm tasty. French Country Style Chicken Breast Fillet.
Here's the recipe!
  • 4 chicken breasts
  • half a lemon
  • chopped parsley leaves
  • 4 tablespoons Garlic & Herb Cream Cheese
  • Parma Ham
  • Olive Oil
  • Cherry Tomatoes
  • New Potatoes
Cut a pocket in the chicken, stuff the parsley and cheese in. Wrap Parma ham round the chicken.
Chuck it all into a dish, liberally drizzle olive oil and squeeze the lemon juice everywhere. Add the squashed lemon half to the dish.
Throw into the oven for about 40mins, Gas Mark 5. Then chuck in the tomatoes & cook for 5 more mins. YESSSSSSSS.

Oh, and boil up the potatoes for 15 mins.
This concludes today's exciting instalment of my blog...where not much slacking actually takes place.

Thursday 14 May 2009

We have a winner...


...for best film of this year*.
It doesn't matter that this is only mid-May. The last second of this trailer is better than any other film I've seen since January. Will Transformers 2 beat this? Only a transforming flying shark WITH LASER EYES can make that possible.

*note that I've not actually watched the entire film yet.

Also, it only occured to me yesterday, but I've been in my current job for 4 years and 4 days. I remember in my first year of working, an older animator telling me once that after 3 years, if you've not left the profession you're in it for life. I probably laughed at him. Maybe because his face was funny. Or because I was drunk.

Sunday 10 May 2009

My Star Trek review.

I saw the new Star Trek movie last night. It was mostly good, with a few side helpings of pew pew. Lets not dwell on the good parts though, as that would be boring.

Firstly...no, lets not say firstly...I think its the only real problem I have with the film.. - Kirk finds himself on a frozen world and encounters a questionable monster. Logically speaking (heh), creatures dwelling in such cold climates have adapted to their surroundings. Penguins, polar bears, arctic foxes..they all have features which allow them to live long and prosper (yes I'm on a roll). So Kirk is being chased by a snow-baboon thing. It is white and furry, as you'd expect it to be. Then all of a sudden, a GIANT RED ANT from the Lost Planet videogame jumps out of the cold water and bites it up.
Right - How many animals that live in cold climates are coloured red? How many insectoids do you see thriving in cold climates, let alone surviving underwater laying in wait for snow-baboons? Sorry Mr Abrams, but for future director cuts of this movie, please colour this creature appropriately.

Oh, and I made awesome peanut butter cookies. I give Star Trek 7 arbitrary cookie points. It would have been 11 but the giant red ant bothered me so much.