Sunday, 27 March 2011

recorder

matt simpkins showed me a neat little node in maya on friday, and asked for an interface for it.

it turned out pretty awesome, when you set it up and start recording, any movements you make on the objects, on almost all attributes (even most custom ones) get recorded in real-time, and gives you an almost mo-cap-like set of keys on those attributes.

theres a few issues with re-recording or keyed object, but hopefully when i get some time, i'll tear into the command scripts and see what i can do.

time permitted, i think i could get a very simple rig set up, animatable with this command, being able to literately animate in real-time :)
that's a looong way off yet, and probably not even possible (otherwise some bright git would've done it by now) but in the mean time, this has probably got the potential to be as useful as the greasePencil tool, but in 3d.

mel. using the "eval" command

just quick note:
using mels "source" command can be a pain in the backside when your trying to combine it with "internalVar" or something.
I noticed this before in scripts but didnt bother trying myself so here goes:
//get user script directory. string $SCRIPTDir=(`internalVar -usd`+"SCRIPT/") ; //create string with source command and script path string $sourceSCRIPT=("source "+"\"" +$SCRIPTDir +"scripts/SCRIPT.mel"+"\"") ; //eval string eval $sourceSCRIPT ; //run sourced script SCRIPT ;

Wednesday, 16 February 2011

shoddy shelves

just thought of something, been using maya2011 64bit at work and seem to have an issue with shelf commands defaulting to "mel" even if saved as "python".

instead of thinking about it, i just put my python scripts into a mel wrapper, rather than;
closing maya, and editing the shelf pref flag to -sourceType "python".

duh.

Wednesday, 26 January 2011

updates...

been a while, thought I'd update. (I know its all boring text...)

locOnJoints scripts is up and running, can be found on http://www.creativecrash.com/maya/downloads/scripts-plugins/character/c/ld_loconjoints

been very, very busy lately, alot of updating and improving rigs and scripts. let alone a couple of projects for myself and a couple of other projects on the go.

One of which, is the Animal Wall project, and I spent a few hours filming in Cardiff Centre the other night, was well worth the cold for the results :)
Should start putting some more interesting bits up here...

Monday, 25 October 2010

RE: mel. Place loc on Joint

Update to previous post now ive had chance to test script, so couple of minor changes.


//script to place a locator at position of every joint in scene (if nothings selected) or at the position of every joint in heirachy underneath selection and rename to match joint.
string $mySel[]=`ls -sl` ; string $joints[]=`ls -type joint` ; if(size($mySel)==0) for($i=0;$i<(size($joints));$i++) { float $jntPos[] = `xform -q -ws -piv ($joints[$i])` ; string $loc[] = `spaceLocator -p $jntPos[0] $jntPos[1] $jntPos[2] -n (($joints[$i])+"_loc")` ; for($b =0; $b<(size($loc)); $b++) { select ($loc[$b]) ; CenterPivot ; } } } if(size($mySel)>=1) { select -hi ; string $selJoints[] = `ls -sl` ; for($a=0;$a<(size($selJoints));$a++) { float $selJntPos[] = `xform -q -ws -piv ($selJoints[$a])` ; string $loc[] = `spaceLocator -p $selJntPos[0] $selJntPos[1] $selJntPos[2] -n (($selJoints[$a])+"_loc")` ; for ($b =0;$b<(size($loc));$b++) { select ($loc[$b]) ; CenterPivot ; } } }

Sunday, 24 October 2010

mel. Place loc on joint

just thinking bout speeding up my productivity led me to just write this little script to place and rename a locator at the position of every joint in the scene (if nothing is selected) or just on the current heirachy of the selection. (i havent even tested this as im on the laptop with no maya :( ) all just from top of me head :)

its not a global proc as its meant to be assigned to a shelf button, but may include into rigging toolset currently WIP (as is an animation toolset and modelling toolset - latter already has a beta version i use at work often already, so the v01 release wont be too long and will be found on here, my website - once finished - and creativeCrash.com)
//script to place a locator at position of every joint in scene (if nothings selected) or at the position of every joint in heirachy underneath selection and rename to match joint. string $mySel[] = `ls -sl' ; string $joints[] = `ls -type joint` ; if (size($mySel) == 0) { for ($i =0; $i<(size($joints)); $i++) { string $jointPos[] = `xform -q -ws -piv ($joints[$i])` ; string $loc = `spaceLocator -p $jointPos[0] jointPos[1] jointPos[2] (($joints[$i])+"_loc")` ; //rename (($joints[$i])+"_loc") $loc ; } } if (size($mySel) >= 1) { select -hi ; string $selJoints[] = `ls -sl` ; for ($a =0; $a<(size($selJoints)); $a++) { string $selJointPos[] = `xform -q -ws -piv ($selJoints[$a])` ; string $loc = `spaceLocator -p $selJointPos[0] selJointPos[1] selJointPos[2] (($selJoints[$a])+"_loc")` ; //rename (($selJoints[$a])+"_loc") $loc ; } }

Update

so, besides some heavy rigging and rigging tests (including some awesome FK tails made from IK splines switching to scalable and controllable auto-tails), ive started to learn python (to later move on to pymel) and i still cant click with it yet... nether the less, i've also still been helping few people out with mel.

managed to pull off my first scriptJob too, after few minutes reading up on it and bout 20 mins playing with tests. its fairly simple and really powerful, just dont want to get too caught up in using them too much.

it was as simple as creating a global proc to update two opposite curves with position and apply to the others limit (to use them as a min and max) then with one scriptJob line to run on a new selection, it worked perfectly, including setting it into the startup expressions with the relevant file (the only problem was cancelling the bugger when its not needed automatically as the "if (objExists ("object") ==1)" loop didnt seem to work :( still though its something i think i'll implement to the rigs with scripts to run on selecting certain controllers etc.

its all good fun...