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

Sunday, 26 September 2010

Mel and QT

I've kept on scripting on the side of rigging and pretty happy with progress, thought i'd share a couple of useful tips...

as most know, Maya 2011 uses QT for its interface now and makes things far, far easier and quicker to create UI's for it, however full use some QT functions are a little difficult to command with mel. However the benefits far outway the cons as you replace a 500 line code with as little as 5 lines and have full docking capabilities and a good 2hour scripting slog for the UI with 5 minutes in QT Designer...

first things first, plan ahead -
the hardest bit i find is not the scripting at all, but knowing what i need to "connect" etc to get the desired effect/control, so as Milan pointed out, make a flow chart so you can see what needs to drive what and so you avoid cycles.

be experimental -
most of the progress i've made with QT was just playing around.

QT Designer is more flexible than you might think... for example to assign a global proc to run on a button click, you add a new dynamic attribute with a "-c" (or "-command") and then put in the proc name. Simple. but you can take this further, say with a list view, if you want to add a double click command you add a "-dcc" and then the proc name, or if you want to cut down your script size and don't particularly having an entire global proc for one line , write the script in the command line in QT instead, as once the button's pressed in Maya it runs whatever is in the cmd line anyway.

if your not sure how to perform and action with mel, try turning on "Echo All Cmds" and watch how maya performs the task.

use maya help!! (and check the flags for commands) it really is there for a reason :)

one final note, im annoyed atm with a major bug with maya 2011 and even traces of it in 2010 - where gimbal has seemed to become default with no recovery. this has appeared to have come on in the last week or so in various companies and were still waiting to hear from autodesk about this.

Sunday, 8 August 2010

been a while

found a spare few seconds to update...

now working as Maya rigger (and probs animator) at Dinamo Productions (Grandpa in my pocket :) ) and it is awesome.

learnt ahellover lot in last few weeks, brains on overdrive so will have to post up some personal projects and ew hints and tips to rigging laters on :)

that is all.