Monday, 12 December 2011
Maya 2012: Changing channelBox decimal places (precision)
For example, it is possible to translate an object by 1.11111 although maya will display "1.111".
When you use getAttr, it will return the correct values, but to display in the channel box, very simply under Edit in the channelBox go settings -> Change Precision...
Simple as, decimal places range from 1 to 15.
Friday, 9 December 2011
Outlook 2010 - Filter e-mails between specific dates
Say you want to filter your emails between dates?
Atm, a specific date was easy enough, but between dates seemed more hassle and the only way I could see was to create a new search filter.
Under "Search" tab, search Tools -> Advanced Find, then "Advanced" tab - and under Define more criteria dropdown select "Date/Time Fields" -> "Received", Condition to "Between", and Value to "<start Date> and <end Date>" then under "Browse", make sure you check "Include Subfolders", then "Find Now".
It was a pain in the ass, and would love to hear a simpler way of doing it...
Sunday, 27 November 2011
Automating Hotkeys
Some people have asked about automating the creation of hotkeys as it can be abit fiddly for them to do it manually.
The problem is, like scripting most things, you really need to understand what is actually going on and why.
For example, to automate the creating a hotkey to print what is currently selected.
The script is simply "print (`ls -sl`);"
First of all we need to create a runTimeCommand, which ties the entire script needed to execute under a single runTimeCommand, just like most of maya's own scripts do.
runTimeCommand
-annotation "Prints whatever is currently selected"
-category "User"
-commandLanguage "mel"
-command ("print (`ls -sl`);")
printSelection;
This sets up everything we need to display the command in the hotkeyEditor, without it, you can still assign a command to a hotkey but when your try to find it in the hotkey editor, maya will have no knowledge of it.
Now we need to create a nameCommand which ties the a script to execute under a single string command, just like most of maya's own scripts do.
nameCommand
-annotation "printSelectionNameCommand"
-sourceType "mel"
-command ("printSelection")
printSelectionNameCommand;
Finally we assign a key which runs this command with
hotkey -keyShortcut "~" -name ("printSelectionNameCommand");Now that does seem like alot of work, but it sets up everything you need and with abit of wotk, most of it could be automated, but the things you would need to check and the info you need to enter, theres pretty much no point creating an alternative version of the hotkeyEditor as it requires the same information.
What you could do, however, is to create perhaps hotkey presets, so instead of having to take 3 scripts as you move to a different station (3 being the pref's scripts "userHotkeys.mel", "userNamedCommands.mel" and "userRunTimeCommands.mel"), you could have them those hotkeys into a single custom script which saves its setup as a preset in its own script file.
This could be furthered by doing the same with shelves, window prefs etc, all executed from one script rather than having to transfer the entire prefs folder. Its fairly simple, definitely not the best way of going about it, but its certainly possible.
Creating 'custom' Hotkeys
1. To assign a hotkey, go to the hotkey editor (Window -> Settings/Preferences -> Hotkey Editor). 2. On the left field, you can select which category you would like to create the hotkey under, I recommend "user" as so you can organise custom hotkeys. 3. In the lower right of the window hit “New”, give the command a name and a description. 4. Finally you need to put the command you want to run in the "Command" field, taking into account whether it is mel or python (eg print "Hello World!\n" ; ) 5. Hit “Accept” and it will appear in your hotkey list. 6. Select the newly created Hotkey and on the right where under “Assign New Hotkey”, enter the Hotkey combination you want to use and hit “Query” check whether it is currently already assigned. 7. If its not and your happy to continue hit "Assign".
Done.Sunday, 2 May 2010
Picking Up Object Tutorial: Shortened version
Automated script for tutorial here. Download
1. create 3 locators, one for hand, object then prone.
2. add a 'Grasp' attribute for hand locator, float, scalar, min 0, max 10.
3. shift-select hand, prone then object locators in that order add a default Point and Orient constraint.
4. with driven keys, set 'Grasp' as 0 (Driver), and object_pointConstraint, Hand W0 and Prone W1 (Driven) with Hand W0 value at 0 and Prone W1 with 1 and add key, same for oreintConstraint, then reverse with 'Grasp' at 10 (so pointConstraint - Hand W0 is now 1 and Prone W1 is now 0 and same again for orientConstraint).
5. position and Parent Hand locator to characters hand and prone to wherever and then group and parent the object picked up to the object locator.
Simple Picking Up and Object in Maya Tutorial
http://ldunham.blogspot.com/2010/05/shortened-version.html
This tutorial is now scripted.
Get the script here - Download
Saturday, 20 March 2010
Stretchy bones tut...
oh and the mel I type after i select the IK Spline curve ( at about 2:20) is 'arclen -ch 1;' (it allows you to select the curve info node)...
Tuesday, 9 March 2010
Blendshapes
"Adding in-between blendshapes
To create inbetween blendshapes for say opening an eyelid you'll want an in-between to get a nice slide over the eyeball instead of going through it,
this is because Maya will transition between the base and the blend through the shortest route.
Select your ending blendshape and then shift-select your Base object (that the blends will be applied to).
If its your first blendshape on this object you'll wanna go ''Create Deformers - Create Blendshape - Options', name the group of blendshapes under the
'Blendshape node', make sure envelope is 1, local origin and check topology (should all be Defaults anyway) and create.
If its not then go 'Edit Deformers - Blendshape - Add - Options and select 'Specify node' with the correct node selected and check topology. ('Add in-between
should NOT be checked at this point). Click 'Apply and close'.
You'll notice under 'Window - Animation Editors - Blendshape you'll have a new node you created and if you slide up, your object will transition
between your original object to the object you set as a blendshape.
To add a blendshape in-between the two states you created, create and mold the object for the in-between, select it, shift-select the base object
then select 'Edit Deformers - Blendshape - Add - Options', click 'specify node' (it tells Maya what node this will be placed under)
then select 'Add in-between target' and under the 'in-between weight' select something like 0.5, and under 'Target index' you need to count
what blendshape this will be placed on, for example if the in-between will be on the 1st blendshape you made you need to type '1',
if its blendshape later down the list, count how many over it is and type its corresponding placement number. (you could always re-name your
blendshape objects before you add them as eg. '1_R_TopEyelid', '2_R_BotEyelid' etc.
if you now slide you blendshape, you'll notice the inbetween has been placed at the value you selected (0.5)."
Hope peeps find some of the stuff I post useful...