Tuesday 16 August 2011

Research and Optimization

I am running out of time as the project is off-schedule so besides rethinking about project management I figured out that there are lots of repetitive and unnecessary tasks which slows down performance and hinders machine outcome. Autodesk Maya being a major tool to me  for 3D projections, has a native language Maya Embedded Language which allows one to make customization in the scene.

I have one script which I wrote to get ride of all unnecessary junk shader nodes and their respective materials which aren't active in the scene. Below is the small snapshot for the script:

Shader_GroupElimination:








As of now I am working on a script which will improve my performance by changing the directory path automatically whenever the image folder inside a project is changed.I will update the screenshot for the GUI I am working on.

Hello everyone,
Unfortunately due to tight schedule I wasn't able to complete the GUI for my scripts but here are some  screen shots of  few scripts I wrote during this project.

Script number 2: Reload Texture Node


Purpose:
       This script in particular is quite time saving for anyone whose project involves lots of dependency on images or external files.As I am working on a Matte Painting Project so I often require to switch back to some image editing software in order to fix my images or files used as textures. This process requires one to update each individual file node separately, if the project has 3-4 external files used as textures in that situation it is quite easy to update texture file nodes. However, in situation where there is more than 50-60 file texture nodes in the scene than it becomes quite uneasy and confusing to click on individual materials in the scene for file texture update.

This script reloads all file nodes in the scene at once with a single call to the procedure. Some of the screen shots for the script is shown below:


BEFORE:





AFTER:













Limitations:Although the code is working fine for my project where I have used default MAYA materials and haven't used Mental Ray Materials . However, in near future to increase the flexibility of the code I will add some changes to this code which will allow it to support mental ray materials and shading groups.
A small bug which is still associated with this script hinders its execution for the first time, the bug is related with the "AEfileTextureReloadCmd" procedure which is  one of the MAYA's inbuilt procedure.
A turnaround for this problem is to click on one of the reload buttons on the file node once and after that execute the procedure.


Script Number03:Change the Directory Path


Purpose: This script is quite essential for me to manage my files and folders throughout the project. As I am working on a limited space on my desktop, usually I get stuck with the low space in case of  heavy rendered images  and other files. Moreover, in situations where I want to move 40-50 files to a new directory I use this script to help me out with the directory change process. The script invokes a dialog box and takes the directory input from the user and updates it for all file nodes in the scene.
Below are some screen shots for this script:

BEFORE: Scene with no wrong file texture path













AFTER:













Limitation:This script does not have a File Browser GUI where user can simply click on the set button and can automatically  set a new path. Moreover, one has to be very cautious while typing in the path in the input box as Maya treats "\" as a key word (which actually means an escape character which tells Maya to treat anything after this symbol as a special character).So a valid path would be:

C:/Users/WhoKnows/


instead of

C:\Users\IKnow\

The same bug associated with the 2AEfileTextureReloadCmd" procedure exists in the script as it is dependent on reload_2DTextures procedure.

A small update on the directory path change script, I fixed few bugs related to nodes espcecially mental ray material file node, more on the script can be found on the below mentioned link:

https://www.creativecrash.com/



I will be refining other scripts and will be preparing a new GUI after finding few bugs while working on different scenarios.







No comments:

Post a Comment