Installation
Maya plugin
1) Unpack the .zip archive
2) Windows only: Install Visual Studio 2010 redistributable
3) Copy maya directory over your user maya directory
| Windows 7 | C:\Users\<your user account>\Documents\maya |
| english Windows XP | C:\Documents and Settings\<your user account>\My Documents\maya |
| german Windows XP | C:\Dokumente und Einstellungen\<your user account>\Eigene Dateien\maya |
| Mac OS X | /Users/Shared/Autodesk/maya |
4) Open Maya or restart it
5) Load the plugin "DigiMayaExport" in Maya via Window -> Settings/Preferences -> Plug-in Manager
First test
1) Set the project to the examples folder and open an example
2) Export using File -> Export All... (Maya 2010 and below: click on square)
3) Select File type: Inka3D html Exporter
4) Enter the following options (File Type Specific Options)
| Interface Nodes | None |
| List of Nodes | leave empty |
| Interface Transforms | unchecked |
| Interface Cameras | checked |
| Interface Lights | unchecked |
| Export Render Layers | None |
Note: a camera shape named “cameraShape1” must be present.
5) Export to the WebGL directory (contained in the .zip archive) as test.html
6) Start MiniServer inside WebGL directory (do it inside a console as double-clicking from explorer/finder starts it with some other directory as current directory)
7) Go to http://localhost/test.html or http://localhost:8080/test.html (see output of MiniServer)
Troubleshooting
Maya plugin does not load: Install Visual Studio 2010 redistributable.
When exporting maya says Cannot find procedure "DigiMayaExportOptions": Restart Maya. If it does not help, DigiMayaExportOptions.mel may be missing in maya/scripts directory. Repeat step 3 of installation and make sure to copy the whole maya directory, not only the plugin itself.
Install new graphics driver. Maybe yours is blacklisted by your browser.
Make sure you use a HTTP server (e.g. MiniServer) to view exported content as loading from file does not work.
Scene loading stops at progress bar: set "Interface Cameras" export option and make sure cameraShape1 is present in your scene.
Other strange behavior: In the header of the exported html file after
<script type="text/javascript" src="js/digi.js"></script>add this line:
<script type="text/javascript" src="js/digiDebug.js"></script>Then open a javascript debug console.
Supported Features
Scene
AnimCurve
Standard animation curve, created when using „Set Key“. All tangent types are supported except Stepped Next.
Expression
All C-Like constructs supported. Example:
if (pCube1.rotateX > 30.0)
{
pCube1.translateX = sin(0.5 * time);
}
else
{
pCube1.translateX = pCube1.translateZ;
}
Object types and lists are not supported.
Limit functions:
| abs(x) | Absolute value: abs(-1) → 1 |
| ceil(x) | Round up: ceil(0.1) → 1 |
| floor(x) | Round down: floor(0.9) → 0 |
| clamp(min, max, x) | Clamp |
| min(x, y) | Minimum |
| max(x, y) | Maximum |
| sign(x) | Sign: -1, 0 or 1 |
| trunc(x) | Truncate: trunc(1.5) → 1, trunc(-1.5) → -1 |
Exponential functions:
| exp(x) | e^x |
| log(x) | Logarithm base e |
| log10(x) | Logarithm base 10 |
| pow(x, y) | x^y |
| sqrt(x) | Square root |
Trigonometric functions:
| cos(x) | Cosine |
| cosd(x) | Cosine taking degrees |
| sin(x) | Sine |
| sind(x) | Sine taking degrees |
| tan(x) | Tangent (sin(x)/cos(x)) |
| tand(x) | Tangent taking degrees |
| atan2(y, x) | Arc tangent |
| atan2d(y, x) | Arc tangent returning degrees |
| hypot(x, y) | Length of 2D vector (x, y) |
Vector functions:
| angle(x, y) | Angle between two vectors |
| cross(x, y) | Cross product |
| dot(x, y) | Dot product |
| mag(x) | Length of vector |
| unit(x) | Normalized vector, unit length |
Random functions:
| noise(x) | 1D Perlin scalar noise |
| noise(x, y) | 2D Perlin scalar noise |
| noise(vector) | 3D Perlin scalar noise |
| dnoise(vector) | 3D Perlin vector noise |
Curve functions:
| linstep(start, end, parameter) | Linear step from 0 to 1 |
| smoothstep(start, end, parameter) | Smooth step from 0 to 1 |
| hermite(p1, p2, tan1, tan2, alpha) | Hermite spline with tangents tan1 and tan2 |
Camera
Defines view and projection matrix.
| focalLength | Animatable |
| nearClipPlane | Animatable |
| farClipPlane | Animatable |
| cameraAperture | Animatable |
| filmOffset | Animatable |
| orthographic | Constant |
| orthographicWidth | Animatable |
Camera Aperture defines the film size in inch, film Offset is also in inch.
When Orthographic is enabled, Focal Length, Camera Aperture and Film Offset have no effect in Maya.
Joint
A Skeleton is made up of joints
| translate | Animatable |
| rotate | Animatable |
| scale | Animatable |
| rotateOrder | Constant |
| roateAxis | Constant |
| inheritsTransform | Constant |
| jointOrient | Constant |
| visibility | Animatable |
Look At
Look At controller for camera
| offset | Constant |
| aimVector | Constant |
| upVector | Constant |
| worldUpType | Constant |
| worldUpVector | Animatable |
| twist | Animatable |
Twist only works for World Up Type = Scene or Vector.
Transform
Basic transform node
| translate | Animatable |
| rotate | Animatable |
| scale | Animatable |
| shear | Animatable |
| rotateOrder | Constant |
| roateAxis | Constant |
| inheritsTransform | Constant |
| rotatePivot | Constant |
| scalePivot | Constant |
| visibility | Animatable |
Geometry
Blend Shape
WebGL: will exceed maximum vertex inputs for more than one target.
One mesh per blend target is supported.
Mesh
Fully supported. Automatic triangulation is done on polygons, but the quality of Maya's triangulation may be better. Automatic vertex cache optimization is performed.
| visibility | Animatable |
Sine Deformer
| amplitude | Animatable |
| wavelength | Animatable |
| offset | Animatable |
| lowBound | Animatable |
| highBound | Animatable |
Skin Cluster
A maximum of 8 bones per vertex is the limit for performance reasons but can be extended on request.
Shading
Note: Maya defines transparency separately for all three color channels. DigiMayaExport currently only uses the red component as monochrome transparency since current hardware shaders support only monochrome transparency. Maya applies the transparency to a pixel in the render target as follows:
Pixel = Transparency * Pixel
+ (1 – Transparency) * (Sum of Lights + Ambient Color) * Surface Color
+ Incandescence
Lambert
| color | Animatable, Texture |
| transparency | Animatable, Texture (See Note) |
| ambientColor | Animatable, Texture |
| incandescence | Animatable, Texture |
| bumpMapping | Tangent Space Normal Texture |
Phong
Inherits Lambert
| cosinePower | Animatable, Texture |
| specularColor | Animatable, Texture |
| reflectivity | Animatable, Texture |
| reflectedColor | Animatable, Texture |
PhongE
Inherits Lambert
| roughness | Animatable, Texture |
| highlightSize | Animatable, Texture |
| whiteness | Animatable, Texture |
| specularColor | Animatable, Texture |
| reflectivity | Animatable, Texture |
| reflectedColor | Animatable, Texture |
Blinn
Inherits Lambert
| eccentricity | Animatable, Texture |
| specularRollOff | Animatable, Texture |
| specularColor | Animatable, Texture |
| reflectivity | Animatable, Texture |
| reflectedColor | Animatable, Texture |
Anisotropic
Inherits Lambert
| angle | Animatable, Texture |
| spreadX | Animatable, Texture |
| spreadY | Animatable, Texture |
| roughness | Animatable, Texture |
| fresnelIndex | Animatable, Texture |
| specularColor | Animatable, Texture |
| reflectivity | Animatable, Texture |
| reflectedColor | Animatable, Texture |
| anisotropicReflectivity | Not Supported, always off |
Surface Shader
The surface shader is mainly for head-up-displays and therefore no lighting is applied to it. As a special feature all file textures that are only used by the surface shader do not get mipmaps.
| outColor | Animatable, Texture |
| outTransparency | Animatable, Texture |
Fog
Settable via Render Settings window, Maya Software tab, Render Options, Post Processing.
| color | Animatable |
| saturationDistance | Animatable |
| useHeight | Constant |
| minHeight | Animatable |
| maxHeight | Animatable |
| distanceClipPlanes | Constant |
| fogNearDistance | Animatable |
| fogFarDistance | Animatable |
Lighting
When light parameters are connected to a Texture, these projections are used:
| Ambient Light | Spherical-Cylindrical |
| Directional Light | Planar |
| Point Light | Projective |
| Spot Light | Spherical |
Ambient Light
| color | Animatable, Texture |
| intensity | Animatable, Texture |
| ambientShade | Animatable |
Directional Light, Point Light
| color | Animatable, Texture |
| intensity | Animatable, Texture |
| emitDiffuse | Constant |
| emitSpecular | Constant |
| decayRate | Constant |
Spot Light
| color | Animatable, Texture |
| intensity | Animatable, Texture |
| emitDiffuse | Constant |
| emitSpecular | Constant |
| decayRate | Constant |
| coneAngle | Animatable |
| penumbraAngle | Animatable |
Texturing
All textures have a 'Color Balance' section that can be used to modify the output:
| defaultColor | Animatable, Texture |
| colorGain | Animatable, Texture |
| colorOffset | Animatable, Texture |
| alphaGain | Animatable, Texture |
| alphaOffset | Animatable, Texture |
| alphaIsLuminance | Constant |
If Alpha Is Luminance is on, the outAlpha output is the luminance of the color component and the outTransparency output is the inverse luminance of the color component
From 'Effects' these attributes can be used:
| invert | Constant |
File Texture
References a texture by its file name.
| imageName | Constant |
| useImageSequence | Constant |
| imageNumber | Animatable |
| frameOffset | Animatable |
| uvCoord | UV, Texture |
| outColor | Output |
| outAlpha | Output |
| outTransparency | Output |
Animated textures are created by setting „Use Image Sequence“. Then right-click on Image Number and edit the script if necessary. The image sequence must be of the format name.#.ext (preferred) or name#.ext where # is the value of the frameExtension attribute of the file texture.
Example for image sequence:
MyAnimation.0.png
MyAnimation.1.png
MyAnimation.2.png
MyAnimation.3.png
…
Example expression for cyclic texture animation that changes once per second:
file1.frameExtension = time % 4;
As a special feature there is the distinction between normal and surface textures. Surface textures are textures that are used only by the Maya surface shader. Normal textures are rescaled to power of two, i.e. an image of 800x600 is rescaled to 512x512. The resolution of surface textures is arbitrary, but if it is not power of two it is clamped at the borders due to a limitation of WebGL. This is summarized in the following table:
| Texture type | Resolution | Action | Mode |
| Standard | Power of two | Create mipmaps | Repeat |
| Standard | Non power of two | Rescale to power of two, create mipmaps | Repeat |
| Surface | Power of two | None | Repeat |
| Surface | Non power of two | None | Clamp |
Possible power of two values for texture resolutions are: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096
Ramp Texture
Supported ramp types:
| V Ramp |
| U Ramp |
| Diagonal Ramp |
| Radial Ramp |
| Circular Ramp |
| Box Ramp |
Supported interpolation types:
| None |
| Linear |
Attributes:
| uvCoord | UV, Texture |
| outColor | Output |
| outAlpha | Output |
Checker Texture
| color1 | Animatable, Texture |
| color2 | Animatable, Texture |
| contrast | Animatable, Texture |
| uvCoord | UV, Texture |
| outColor | Output |
| outAlpha | Output |
Bulge Texture
| uWidth | Animatable, Texture |
| vWidth | Animatable, Texture |
| uvCoord | UV, Texture |
| outColor | Output |
| outAlpha | Output |
Layered Texture
All blend modes are supported.
Parameters per blend stage:
| color | Animatable, Texture |
| alpha | Animatable, Texture |
| blendMode | Constant |
| layerIsVisible | Constant |
| outColor | Output |
| outAlpha | Output |
Place2dTexture
| coverage | Animatable, Texture, Correct when >= 1.0 |
| translateFrame | Animatable, Texture |
| rotateFrame | Animatable, Texture |
| mirrorU | Constant |
| mirrorV | Constant |
| wrapU | Constant |
| wrapV | Constant |
| stagger | Constant |
| repeatUV | Animatable, Texture |
| offset | Animatable, Texture |
| rotateUV | Animatable, Texture |
| noiseUV | Not supported |
| uvCoord | Output |
UV Chooser
Chooses the UV set for following texture in the shading network. To create/edit UV choosers use Window → Relationship Editors → UV Linking.
Env Ball
Environment ball. The environment is captured on a texture by taking a picture of a reflective ball that is inside the environment. The objects are given the appearance of the ball.
| eyeSpace | Contant |
| reflect | Must be on |
| outColor | Output |
Env Sphere
Environment sphere. The environment is created by mapping a texture on an infinitely large sphere. The reflection vectors on an object do a texture lookup on this sphere.
| flip | Contant |
| outColor | Output |
Vertex Colors
Vertex colors are supported via the Mental Ray vertex colors node. Use the mental ray renderer in maya to preview the result. Only red, green and blue of the vertex colors are exported, not the alpha channel.
mentalrayVertexColors
| cpvSets[ ] | Constant |
| defaultColor | Animatable, Texture |
| colorGain | Animatable, Texture |
| colorOffset | Animatable, Texture |
| alphaGain | Animatable, Texture |
| alphaOffset | Animatable, Texture |
| alphaIsLuminance | On |
| invert | Constant |
| outColor | Output |
| outAlpha | Output |
Utility
Utility nodes can be used in a scene or in a shading network.
Add Double Linear
| input1 | Animatable, Texture |
| input2 | Animatable, Texture |
| output | Output |
Angle Between
| vector1 | Animatable, Texture |
| vector2 | Animatable, Texture |
| angle | Output |
| axis | Output |
Blend Colors
| color1 | Animatable, Texture |
| color2 | Animatable, Texture |
| output | Output |
Clamp
| min | Animatable, Texture |
| max | Animatable, Texture |
| input | Animatable, Texture |
| output | Output |
Condition
| firstTerm | Animatable, Texture |
| secondTerm | Animatable, Texture |
| operation | Constant |
| colorIfTrue | Animatable, Texture |
| colorIfFalse | Animatable, Texture |
| output | Output |
Contrast
| value | Animatable, Texture |
| contrast | Animatable, Texture |
| bias | Animatable, Texture |
| outValue | Output |
Gamma Correct
| value | Animatable, Texture |
| gamma | Animatable, Texture |
| outValue | Output |
Luminance
| value | Animatable, Texture |
| outValue | Output |
Mult Double Linear
| input1 | Animatable, Texture |
| input2 | Animatable, Texture |
| output | Output |
Multiply Divide
| input1 | Animatable, Texture |
| input2 | Animatable, Texture |
| output | Output |
PlusMinusAverage
| input1D[ ] | Animatable, Texture |
| input2D[ ] | Animatable, Texture |
| input3D[ ] | Animatable, Texture |
| output1D | Output |
| output2D | Output |
| output3D | Output |
Reverse
| input | Animatable, Texture |
| output | Output |
Sampler Info
This node works only inside a shading network. Only a few attributes are supported so far:
| flippedNormal | Output |
| facingRatio | Output |
Unit Conversion
This node is usually hidden by Maya
| input | Animatable, Texture |
| output | Output |
Particle Systems
Particle systems not supported for WebGL
Particle systems can currently only be rendered using an Instancer (Geometry Replacement). Sprites are not yet supported.
Particle System
Emission Attributes
| Max Count | Constant, must be > 0 |
| Emission in World | Constant |
Lifespan Attributes
| Lifespan Mode | Constant |
| Lifespan | Animatable |
| Lifespan Random | Animatable |
Time Attributes
| Current Time | Animatable |
Instancer (Geometry Replacement)
Supported attributes: Position, Scale, Shear, Visibility, Object Index, Rotation.
Rotation Type must be None, then Maya uses the particle attribute selected in Rotation as rotation.
Per Particle (Array) Attributes
Not yet supported are Ramp Position, Ramp Velocity and Ramp Acceleration. All other attributes including custom attributes can be used in creation, before dynamics and after dynamics expression.
Instancer
| Rotation Angle Units | Constant |
| Rotation Order | Constant |
| Cycle | Constant |
| Cycle Step Unit | Constant |
| Cycle Step | Animatable |
Field
All particle force fields have the following attributes:
| Magnitude | Animatable |
| Attenuation | Animatable |
| Use Max Distance | Constant |
| Max Distance | Animatable |
Air Field
Inherits Field
| Direction | Animatable |
| Speed | Animatable |
Drag Field
Inherits Field
| Use Direction | Constant |
| Direction | Animatable |
Newton
Inherits Field
| Min Distance | Animatable |
Radial
Inherits Field
Uniform/Gravity
Inherits Field
| Direction | Animatable |
Vortex
Inherits Field
| Axis | Animatable |
Constraints and IK
Aim Constraint
Lets a node aim at a target
| Offset | Constant |
| Aim Vector | Constant |
| Up Vector | Constant |
| World Up Type | Constant (Scene Up or Vector) |
| World Up Vector | Animatable |
IK Handle
Not supported for WebGL
Only ikRPsolver supported, IK solution is different from Maya for more than one intermediate joint. The position and scale of joints in an IK chain are considered constant by the IK solver (except position of root joint).
| Pole Vector | Animatable |
Orient Constraint
Transfers the orientation of one or multiple nodes to another node
| Offset | Constant |
Parent Constraint
Transfers the transformation of one or multiple nodes to another node
Point Constraint
Transfers the position of one or multiple nodes to another node
| Offset | Constant |
Pole Vector Constraint
Lets the pole vector of a IK Handle point at a node
| Offset | Constant |
Scale Constraint
Transfers the scale of one or multiple nodes to another node
| Offset | Constant |