Python Programming for Maya

These are the tools that I've created to prepare for a maya production. These scripts are mostly based on a system of naming convention and lighting approach designed by me.




Script: Generate Include Exclude Script
Written by: Tan Jit Quan
Purpose: Generate a script to transfer selected/all lights' linking data into other shots.
Description:
  • This script writes a script to be run in other shots that require special light linking information
  • Mostly used by Master lighters who needs more complex light linking. 




Script: Light Rig Linking
Written by: Tan Jit Quan
Purpose: Help make linking a light rig to a character or prop easier and efficient; Maintain naming convention; efficient light linking
Description:
  • This script will help with renaming for naming convention much more easily
  • It creates a locator for a selected object and a light rig can be parented to the "linker"
  • This allows the light rig to read the position of the object but not the rotation values
  • The middle portion is for renaming of lights, light rigs, light links
  • The bottom portion is for fast and efficient light linking via selection in the scene.




Script: Lighters' File Manager
Written by: Tan Jit Quan
Purpose: Help lighters access files fast.
Description:

  • When the shot details are entered, all related files will be displayed for lighters to access.
  • Folders for the selected episode can be accessed via their respective buttons on the left.


Script: Write String Script
Written by: Tan Jit Quan, Lim Wei Soon
Purpose: Get the names of the selected objects for coding other ad-hoc scripts
Description:

  • The gathered names can be as an array or displayed separated as different lines
  • If required, scripters can rename the selected the objects as needed by entering the Prefix and Suffix text field. They can even substitute part of the name if need be. 



Script: Export Lighting Elements
Written by: Tan Jit Quan
Purpose: Separate lighting elements from the Final set. Lighters can then reference the set and import lighting elements. This is to keep all lighting information at the lighters' level
Description:
  • Select the directory where the maya file is to be saved
  • Name the file and click create




Script: Generate Preset Script
Written by: Tan Jit Quan
Purpose: Create a python script which would store the render settings and can be passed on to another computer
Description:
  • Select the directory where the maya file is to be saved
  • Name the file and click create
  • On another computer, run the generated python script
  • Currently can only be used for Mental Ray



Script: Camera Frame Range
Written by: Tan Jit Quan
Purpose: Detect cameras in the scene. Select the shot camera and the maya's frame range, linear, angular and fps settings to update the maya settings.
  • Auto detects any cameras in the scene with the appropriate naming convention
  • Select any other settings that needs to be updated.
  • Click Align Frame Range and FPS
  • The maya file would set its frame range and any other settings respectively.



Script: PolySmooth
Written by: Tan Jit Quan
Purpose: To be able to control polySmooth value for all objects in the scene. Best for optimising the set's polycount.
Description:
  • After the model is created and cleared history, this script would then put in the polySmooth node to all the scene file's objects. The polySmooth node would be named as the object name with a "_polySmooth" [e.g. objectname_polySmooth"]


  • By grabbing the name "_polySmooth" the script can then change the polySmooth value in the whole scene



Script: Utilities
Written by: Tan Jit Quan
Purpose: General scripts for editing selected objects' properties
  • Turns ON/OFF primary visibility for selected objects
  • Changes the material to "use background" with alpha maps transfered from the cutout map of the mia_material
  • Object ID creates an extra attribute called objID and changes the shader to an mia_material with the original shader's cutout map. The new shader would have a solid colour via the incandescence. This is used to create a separate object ID pass for compositing.


No comments: