MAYA Tools
MAYA Tools siteadmin Sun, 12/24/2006 - 18:12Tools created for use with Maya
PDC Utils
PDC Utils siteadmin Fri, 12/29/2006 - 03:46Maya Particle Disk Cache (PDC) Utils :
PDC Utils help in creating PDC files of external data. These file can then be used to drive particle system in Maya. It contains 2 programs one to create pdc files and another to read them. Both are command line only utility.
Writepdc program creates a pdc file using ascii input files
Readpdc program can read pdc files and display their content on the terminal window
Both programs are compatible with Maya 6 and 7 PDC format. No testing done for prior versions
Download: Source code and executible bundle (89 kb)Updated March 13th 2006
Tutorial: As time permits there would be a tutorial available showing how to put together things. Below are some clues to glue things together
Hints:
- Create a particle system in maya (Dynamics menuset)
- Save scene and set the project directory (Very Imporant)
- Solvers -> Create Particle Disk Cache
- Solvers -> Disable Memory Cache
- Save scene (Important)
- Browse to the project folder and then to particles/yourSceneName folder
- There should be *.#.pdc files in increments of 200 or 250 or something like that
- Now you just need to create your own pdc files using the writepdc tool above with same filename (They should match exactly) and replace/overwrite the one's that maya created.
- You should be able to see the changes in Maya instantaneously
Source Code Credits: Amit Chourasia (San Diego Supercomputer Center) and Peter J. Lu (Harward University) and generous help from John Moreland at SDSC.
Maya PDC format Simplified |
||||||||
The PDC file is used by Maya's particle disk caching and startup cache. It is a binary file that holds one frame's worth of data for a single particle object. The unit for PDC files is always cm |
||||||||
Row no |
Content |
Byte Count |
Description |
Default |
Extra Info |
Example |
Example Explanation |
Row no |
1 |
PDC file header
|
4
|
Characters indicating that this is a PDC file. This will be the 4 characters "P", "D", "C", " ". |
"P", "D", "C"," "
|
last one is space character (no commas or quotes)
|
"P", "D", "C", " "
|
Compulsory. No changes should be made here. | 1 |
2 |
4
|
One Integer indicating the file format version number.
|
1
|
Avoid changing this untill you know for certain. No documentation about it.
|
1
|
Lets stick to default | 2 | |
3 |
4
|
One Integer holding bit information about whether the values stored in the file are BIG_ENDIAN or LITTLE_ENDIAN.
|
1
|
Maya only likes Big_Endian. So always use 1. |
1
|
Always use 1 for this | 3 | |
4 |
8
|
2 Integers holding extra bit information that various file format version might decide to use.
|
0, 0
|
Avoid changing these. No documentation about them |
0 0 |
Lets stick to default | 4 | |
5 |
4
|
1 Integer indicating the number of particles represented in this file |
"N"
|
N is the no of particle you need
|
5
|
Lets say our particle system contains 5 particles | 5 | |
6 |
4
|
1 Integer indicating the number of attributes that have values stored in this file. |
" M "
|
M is the no of attributes you'll write in the file (eg position, particleID, rgbpp,etc) |
1
|
We'll just write 1 attribute for position on per particle basis. | 6 | |
Header size
|
28 Bytes
|
28 Bytes
|
||||||
There will be "M" records ie record for each attribute. Each record will consists of the following |
||||||||
7 |
Single Record
(There will be M records like this) |
4
|
Integer indicating the length of the attribute's name =L where L is the length of the name. |
8
|
8 (no of characters in string "postion") | 7 | ||
8 |
L
|
L Characters indicating the name of the attribute |
position
|
position | 8 | |||
9 |
4
|
1 Integer indicating the type of data for the current attribute. Choose the number from the following data type map below (Row no10) |
Per Object Attributes are set for all particles so they are single numbers. (ie of type 0,2,4 ) See row 10 Per Particle attributes are set for each particle so naturally they are an array of the data. (ie of type 1,3,5 ) See row 10 |
5
|
As position is specified as 3 doubles ie a vector and we have to specify this on per particle basis our datatype becomes 5 (vector array). See the info below on choosing data type.(Row No10) |
9 | ||
10 |
P
|
Data Type 0 ---> Integer 1 ---> Integer Array 2 ---> Double 3 ---> Double Array 4 ---> Vector 5 ---> Vector Array |
0 ---> Integer (just one int=4 bytes - usually per object attribute) 1 ---> Integer Array ( N ints=N*4bytes - where N is the number of particles, usually per particle attribute) 2 ---> Double (just one double=8bytes - usually per object attribute) 3 ---> Double Array ( N doubles=N*8bytes - where N is the number of particles, usually per particle attribute) 4 ---> Vector (3 doubles=3*8bytes - usually per object attribute) 5 ---> Vector Array ( N vectors=N*3 doubles=N*3*8bytes - where N is the number of particles, usually per particle attribute) |
1.0 1.0 1.0
2.0 2.0 2.0 3.0 3.0 3.0 4.0 4.0 4.0 5.0 5.0 5.0 |
x, y, z corrdinates for each particle. Maya stores floating points in double precision using 8 bytes. | 10 | ||
Single Record Size
(The record size for each attribute will vary according to data type) |
8+L+(N*B) Bytes |
N * B Bytes representing the data for this attribute, where L is the no of characters in attribute name N is the number of particles or 1 for non-array data B is the number of bytes needed to represent the data type. |
N*B= 5*(3*8)=120
8+L+N*B=8+8+120 =136 Bytes |
x y z are 3 doubles occuring 5 times | ||||
Total File Size
(Summation of header and M record size) |
28+size of M record Bytes |
28 bytes of header M records of size (8 + L + B) (8 + L + B) is going to be different for each attribute |
28 + 1*(136)=148
Bytes |
|||||
Reference: Maya Documentation
|
||||||||
Caution: Since format contains data that is not word aligned there could be potential problems with different compilers. In a loose words what it means is when you read data from memory by providing a memory address or pointer you might get incorrect results. As compilers will hand you the data from a valid address rather than from where you asked from. Our implementation takes care of this. |
Antibaker
Antibaker siteadmin Fri, 12/29/2006 - 03:41
AntiBaker:::::: Similar and more than Maya's Blendshape
Bake to external files :::::: AntiBaker AntiBaker is created to ease and automate workflow for repetitive tasks. Specifically to reuse/share work. AntiBaker saves the configured info to external files which can be passed to different artists and re-used. AntiBaker saves transforms of selected objects to external files. This is analogous to keyframes but there is no keying involved. The external files are available as presets and morphs which user can utilize at will. Example Use Scenarios:
Requirements: Windows 2000 + , Maya 5.x + <(not tested for previous versions of maya though it should work) Features:
Download: AntiBaker-0.92 ( 217 kb updated Feb 1st 2005) Limitations:
Disclaimer: AntiBaker is provided 'As is'. Use it at your own risk. Copyright (C) 2005 Amit Chourasia |
Usage and SetUp:
Running Basic Utilization of AntiBaker
Screen shot and Interaction info |
FAQ's:
|
License Agreement AntiBaker is a freeware program and may be used and/or redistributed freely without modification, provided that: Redistributions must reproduce the exact original copyright notice (Copyright © 2005 Amit Chourasia. All rights reserved), this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Cam2Vista
Cam2Vista siteadmin Fri, 12/29/2006 - 03:42Cam2Vista : MEL utility to read/import and write out camera files (camera matrices) to text files using Maya. The text file could then be used with Vista (command line volume renderer) and Mesh Viewer (interactive volume renderer) for custom camera movment and positioning.
Importing Camera files: The file should be in ascii format as follows. Each line contains only one camera martix of 16 floats after the keyword "CameraMatrix:" space or tab delimited. Each camera matrix is imported as a keyframe on a per frame basis
CameraMatrix: 1.0 2.0 3.0 4.0 5.0 6.0 7.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0
CameraMatrix: 1.0 2.0 3.0 4.0 5.0 6.0 7.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0
.
.
. and so on
Requirements : Windows, Linux, Mac; Maya 5.0+ (untested for earlier versions)
Notes : Vista's volume size is always 1 unit cube. Thus the path should be created with this information in mind. Good idea is to create a default cube and test out camera path by scrubing in timeline or Step 7.
Limitations :
- Jerky camera movement on preview of camera path.
- Camera axis Y is always Upvector
- Maya (PLE) does not allow write access to files so this script will show errors. The script prints out the info in the script editor when PLE option is checked.
Download : Cam2Vista-1.3 (36 kb) (right click and choose "Save Target As" or "Save Link As" ) Updated: Feb 22, 2008
Old Version : Cam2Vista-1.2(32 kb) (right click and choose "Save Target As" or "Save Link As" ) Updated: Jan 30, 2006
Running Cam2Vista :
- Download and save Cam2Vista-1.3.mel
- Open Script Editor - In Maya go to Window > General Editors > Script Editor
- In Script Editor go to File > Source Script > Cam2Vista-1.3.mel (browse to folder where you saved Cam2Vista-1.3.mel)
- Roll over buttons for tool tips
Usage :
- Choose Camera set up single camera=1cam; five camera setup for dome=5cam; seven camera setup for dome=7cam; eleven camera setup for dome=11cam (see Screenshot below - Step 1) Camera order for 5Cam dome rendering : Up, Front, Back, Left, Right
- Choose aim or look at direction (see Screenshot below - Step 2)
- Draw your own curve or create a test one (see Screenshot below - Step 3)NOTE: The maximum volume size in Vista is a unit size cube so make sure the path is appropriately scaled.
- Enter the number of frames you want to have on camera path (see Screenshot below - Step 4)
- Select the aim curve on which you want to move the camera's aim. (see Screenshot below - Step 5 optional ) Choose Camera looking towards MyPath or Norm2MyPath in Step 2
- Select the path curve on which you want to move the camera. Scale the size of the camera for if needed (see Screenshot below - Step 6)
- Save Camera File at desired location ".cam" would be appended to the typed filename (see Screenshot below - Step 7) or Save Reversed Camera File at desired location ".cam" would be appended to the typed filename (see Screenshot below - Step 7)
NOTE:When the camera position and aim are coincident. You'll notice warnings on script editor. Make sure you have correct camera Aim option selected in Step 2 - Preview the camera path and camera aim (Make sure the camera aim is selected correctly in Step 2) . Also Accesed via "View" drop down menu.
- Import an existing camera file. (File>Import)
- Path curve smoothing options. Look under "Tools" drop down menu.
Cam2Vista Screenshot
(Roll over buttons for tool tips)
Poly2Vista
Poly2Vista siteadmin Fri, 12/29/2006 - 03:44Poly2Vista : MEL utility created for writing out poly object info (vertex and normals) from Maya to a text file. The output file could be used with Vista (command line volume renderer) and Mesh Viewer (interactive volume renderer) for slicing of volumes in desirable manner.
Requirements : Windows, Linux, Mac; Maya 6.0+ (untested for earlier versions)
Notes : Poly objects in Maya should fit in bounding box for corresponding volume dimension.
Limitations : Polygons only (No NURBS, No Subdivision)
Download : Poly2Vista-0.3 (9 kb) (right click and choose "Save Target As" or "Save Link As" ) Updated: Aug 31th 2005
Running Poly2Vista :
- Download and save Poly2Vista-0.2.mel
- Open Script Editor - In Maya go to Window > General Editors > Script Editor
- In Script Editor go to File > Source Script > Poly2Vista-0.2.mel (browse to folder where you saved Poly2Vista-0.1.mel)
- Roll over buttons for tool tips
Usage :
- Select one or more objects (The object should be polygon type)
- Choose output setup (see Screenshot below - Step 2)
- Write a point and a normal per face = vtx+norm (Default)
- Write 3 points(vertices) per face = 3 vtx
- Write all vertices and vertex normals = all(vtx+norm)
- Save Clip File at desired location ".clp" would be appended to the typed filename (see Screenshot below - Step 3)
Poly2Vista Screenshot
(Roll over buttons for tool tips)
PolyVtxCoords
PolyVtxCoords siteadmin Fri, 01/25/2008 - 10:18PolyVtxCoords : Sometimes there is a need to see the vertex number and the actual coordinates of vertices . Doing so, using the Channel Editor or Attribute Editor could be cumbersome. The PolyVtxCoords mel utility addresses this issue by providing a simple user interface to display the vertex number and coordinate of the selected polygon vertices (See figure below). The scripts supports keyboard shortcuts to quickly see the coordinates of consecutive vertices by using arrow keys in addition to point and click selection. The vertex coordinate info is also shown in the script editor and the coordinates of the first selected vertex is displayed on the Maya's command feedback line.
Download : PolyVtxCoords.mel (7kb) (right click and choose "Save Target As" or "Save Link As" ) Updated: Feb 6th 2006
Limitations : Works only for polygon objects.
Notes : A scriptjob is created which auto reloads the vertex list and displays their coordinates in UI when selection changes. The scriptjob will persist if not killed through the interface untill maya is closed and started again.
PolyVtxCoords Screenshot
(Roll over buttons for tool tips)