Sunday, August 11, 2019

Animation Control Orient Tool

USES
When the rotation axes you need to rotate around are not aligned with the world axes,  an "orient group" is needed (also called "offset group"or "reset group") in order to keep the animation control with zero values. Simply aligning the animation control and freezing transforms won't work because freezing transforms will reset the rotation axes to world. This script finds the rotation values necessary to properly align an animation control to the correct rotation axes, creates a group above the control and assigns the rotation values to it, so that the control can have zero transforms, but still be aligned as needed. 




HOW TO USE

First create your animation control and place it so that its pivot point is where you need it. Then, open the GUI and assign one or two planes, by selecting either a face or 3 vertices and clicking assign, and the animation control. If one of your rotation axes is aligned with one of the world axes, like in the figure A below, you will only need to assign one plane, else you'll need two. You can use the radio buttons next to each plane assignment to select which axis will aligned with that plane. Finally, click "Orient control". 
The script will create a new group named "your_control_name"_orientGrp, and will parent the animation control to it. You can now parent this orient group to your hierarchy and lock all channels, since this group should not be animated.
If the control is not visually facing the way you want, you can rotate it and then freeze transforms, that won't affect the rotation axes since those are coming from the values in the parent group. 


Fig A - Y axis is aligned with the world
Fig B - No axis are aligned with the world
















Choosing the 3 vertices to select can be confusing depending on the shape of your mesh,  the vertices don't need to be defining a face. You might be selecting vertices on the flat side of a hinge, or on the edge loop of the elbow. Watch the video below to see a practical example.





INSTALLATION

To get the Animation Control Orient Tool, download the script file and save it in your "maya/version/scripts" folder:
Download lr_ctrlOrientTool_UI.py

Then run the following code in the script editor (make sure to be in a python tab):
import lr_ctrlOrientTool_UI
reload(lr_ctrlOrientTool_UI)

You can save these lines in a shelf button for easy access.

If you don't want to download the file you can just copy the code below to the script editor and drag it onto your custom shelves so you can access it at any time (remember to save your shelves before quitting Maya)


Saturday, August 10, 2019

Vray Z-depth Tool

USES
This script connects the Depth White and Depth Black attributes of the Vray Z-depth render element to two locators that follow along with the animation of your camera and object of interest. It gives visual feedback so it's easy to set up and see what area is being covered. The object of interest will always render the same value of gray and the white and black values will remain at a constant distant (set by the user) at all times.

HOW TO USE

First, make sure you have a Vray Z-depth render element in your scene and that it's named exactly "Z_depth". Then select the camera, shift select the object that needs to stay in focus and run the script. The script will create a new group called zDepth_grp which will have two attributes that you can use to control where the whitest and blackest planes will be in the render. When you adjust the value of these attributes you will see in the viewport two locators that slide on the line that connects the camera to the object of interest.






INSTALLATION

To get the Vray Z-depth Tool, download the script file and save it in your "maya/version/scripts" folder:
Download lr_zDepth_tool.py

Then run the following code in the script editor (make sure to be in a python tab):
import lr_zDepth_tool
reload(lr_zDepth_tool)

You can save these lines in a shelf button for easy access.

If you don't want to download the file you can just copy the code below to the script editor and drag it onto your custom shelves so you can access it at any time (remember to save your shelves before quitting Maya)


Sunday, August 4, 2019

Multiple Reference Tool


USES:
Unlike Maya's default file reference window, this tool allows you to select more than one file at a time. Also by adding more file rows in the tool UI you can make references for files located in different folders all at once. It enables you to reference one file multiple times in one go and assign a namespace of your choice.

INTERFACE:
Use the "browse" button on the right of each row to select the files you want to reference (you can shift/ctrl select multiple files). Type the desired number of copies  in the "Qty" field and the desired namespace in the "Namespace" field.
Use the "Add file row" button towards the bottom of the UI to add as many rows as you need. You'll need different rows to browse for files that live in different folders, or if you want to assign different quantities or namespaces for different files.
When all your preferences are set click on "Create references" to reference all the files.



INSTALLATION:
To get the this tool download the script file and save it in your maya/version/scripts folder:

Then run the following code in the script editor (make sure to be in a python tab):
import lr_referenceTool
reload(lr_referenceTool)

You can save these lines in a shelf button for easy access.


If you don't want to download the file you can just copy the code below to the script editor and drag it onto your custom shelves so you can access it at any time (remember to save your shelves before quitting Maya)