Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Monday, 12 December 2011

Maya 2012: Changing channelBox decimal places (precision)

Most maya users know that you can use more decimal places then Maya displays by default.
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

Sounds to be much simpler than it should be (tbh only really searched for a few minutes), but...
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

Something not everyone seems to be sure about, its fairly simple really.

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

ok, heres the shortened version for previous post...

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

Real Easy Pick-up-Object Tutorial for Maya  EDIT: Please see following post for shorter version

http://ldunham.blogspot.com/2010/05/shortened-version.html


This tutorial is now scripted.
Get the script here - Download



Simple Tutorial i've picked up to solve alot of problems with getting a character to pick up an object and to put it down again or throwing etc. Its almost exactly the same as the original found at www.jonathanrnelson.com

1. Create 3 locators equally spaced apart and name (left to right);

Hand

Object

Prone

The locator name siginifies what role the locator will have.



2. Add a new attribute to the 'Hand' locator (select the 'Hand' Locator, in the channel panel click 'Edit' - 'Add Attribute')

Name the new attribute 'Grasp' and select 'Float' and 'Scalar', 'minimum' as 0, 'maximum' as 10, and leave 'default' blank (you actually have two options for creating the 'Grasp', this one creates a blended attribute so you can blend the object between the hand and prone position which is recommended but if you want an 'Off' and 'On' function, instead of selecting 'Float' choose 'Boolean' and no need to enter maximum or minimum values).

(or if you want to be a smart-arse about it select 'Enum', click on 'Green' under 'Enum Names' and rename 'Prone' and rename 'Blue' to 'Hand').

Then click ok.


3. You want the object to be receive its 'position and rotational information from the two other locators by way of constraints', basically shift-select 'Hand', 'Prone' and then 'Object' in that order. The press F2 to select the Animation Toolset and under 'Constrain' click 'Point' - 'Options' - 'Edit' - 'Reset Settings' then 'Add' then immediately do the same for 'Orient'.

Both constraints from both 'Hand' and 'Prone' Locators are fully influencing the 'Object' locator now, well need to be able to control the influence with the 'Grasp' attribute we made using 'Driven Keys'.


4. Select 'Hand' locator and press F2 again (need to be on the Animation Toolset) and select 'Animate', 'Set Driven Key', 'Set'. A new window pops up, and with the 'Hand' locator still selected click 'Load Driver'. 'Hand' then appears in the top section along with its attributes, we'll use this to blend between the locators, so then open the 'Outliner' under 'Window' and expand the 'Object' locator and select both the 'Point' and 'Orient' constraints that appear.

Then with them both selected on the 'Set Driven Key' window click 'Load Driven'. So the 'Hand' locator and its attributes should be in the top section (Driver) and the 'Point Constraint' and 'Orient Constraint' should be in the bottom (Driven). You need to decide the value structure will be for the 'Grasp' Attribute, but ideally when 'Grasp' = 0 the object will not be held and will be controlled by the 'Prone' locator and when its 10 it will be controlled by the 'Hand' locator.
Click on the 'Grasp' Attribute in the 'Set Driven Key' Window and make sure that the attribute is 0 (or 'Off' or 'Prone').
Then select the 'Object_pointConstraint1' and then select both 'Hand W0' and 'Prone W1'.





Click on the 'Object_pointConstraint1' to select the object and in the channel editor on the right change the values of 'Hand W0' to 0 and 'Prone W1' to 1.
In the 'Set Driven Key' window, click 'Key'.

Repeat for 'Object_orientConstraint1'.

Dont close the Driven key window.

5. We've told 'Object' locator to be controlled and to be in the place of the 'Prone' locator now, and so we need to do the same for the 'Hand' locator.

So, select the 'Hand' locator and set 'Grasp' to 10 and in the 'Set Driven Key Window' select 'Object_pointConstraint1' again and then 'Hand W0' and 'Prone W1' and in channel editor change values of 'Hand W0' to 1 and 'Prone W1' to 0.

Click 'Key' and repeat for 'Object_orientConstraint1' again.

If everything went as it should then when you scroll the value of the 'Grasp' attribute on the 'Hand' locator, you should see the 'Object' locator blend between the two.



6. You can now put this into your scene to use to pick up a cup or throw a ball. Just parent the 'Hand' locator to you characters hand or whatever, parent the 'Prone' locator to wherever you wan the object to start from and then on the object you want to pick up/etc, select it, press 'Ctrl' + 'g' to group and parent that group to the 'Object' locator (we group it because parenting causes the object to inherit its parents vales, which can cause problems so easier to avoid that by parenting a group instead).

Personally, when animating a character, instead of animating the locator 'Grasp' attribute which involves finding and selecting the locator, its easier to select my characters hand controller, add a new attribute called 'Grasp' (and has exactly the same values as the original 'Grasp' attribute) and setting driven keys for the new 'Grasp' attribute on the characters controller to control the 'Grasp' attribute on the locator.



Hope this helps, I know its a bit lengthy and if you know what your doing it could be cut down to a couple of sentences but its supposed to be in-depth.

Anyways, have fun you crazy kids.

Saturday, 20 March 2010

Stretchy bones tut...

almost sorted the coat, thought i'd show how I made the stretchy bones for it from a couple of bones with an IK Spline, clusters and a NURBs  circle controller.

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

Grr, sodding blendshapes in Maya, forgot how to creat in-betweens so started playing about and wrote it down. Finding it really helpful nowdays im getting old...

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