class MDynamicsUtil

Jump to documentation

Utility class for Maya dynamics (OpenMayaFX) (OpenMayaFX.py)

public members:

static bool hasValidDynamics2dTexture ( const MObject & node, const MObject & texAttr, MStatus * status = NULL )
static MStatus evalDynamics2dTexture ( const MObject & node, const MObject & texAttr, MDoubleArray & uCoords, MDoubleArray & vCoords, MVectorArray * resultColors, MDoubleArray * resultAlphas )

Documentation

Access utility methods for Maya dynamics.
Description

MDynamicsUtil provides utility methods related to Maya dynamics (eg. particles and fluids).

Functions

bool MDynamicsUtil:: hasValidDynamics2dTexture ( const MObject & node, const MObject & texAttr, MStatus *status )

Description

Certain aspects of Maya's dynamics can be textured using 2d textures. For example, surface particle emitters can use a 2d texture to modulate the emission rate over the surface. For these purposes, only a subset of Maya's textures are supported, namely the default 2d textures (bulge, checker, cloth, file, fluid texture 2d, fractal, grid, mountain, movie, noise, ocean, ramp, water). No other nodes are supported. This method takes an attribute and determines if there is a supported texture connected to it. If the texture is supported, then the evalDynamics2dTexture() method can be called to evaluate the texture at various (u,v) coordinate values.

Arguments

  • node node to be tested for a valid texture connection.
  • texAttr attribute to be tested for a valid texture connection.
  • status status code.

Status Codes

  • MS::kSuccess The connected texture was successfully examined.
  • MS::kUnknownParameter There was no node connected to the specified attribute.

Return Value

  • true if the node connected to the specified attribute is a texture that can be evaluated using the evalDynamics2dTexture() method, false otherwise.

MStatus MDynamicsUtil:: evalDynamics2dTexture ( const MObject & node, const MObject & texAttr, MDoubleArray & uCoords, MDoubleArray & vCoords, MVectorArray * resultColors, MDoubleArray * resultAlphas )

Description

If a supported 2d texture (see hasValidDynamics2dTexture() method documentation) is connected to the specified attribute, this method can be called to evaluate that texture at a number of (u,v) texture coordinate values.

Arguments

  • node node whose connected texture is to be evaluated.
  • texAttr attribute whose connected texture is to be evaluated.
  • uCoords array of u coordinate values
  • vCoords array of v coordinate values
  • resultColors if non-NULL, receives the result of the connected texture's outColor attribute, evaluated at all the (u,v) coordinates given by the uCoords and vCoords arrays.
  • resultAlphas if non-NULL, receives the outAlpha values evaluated from the texture at these same points.

Status Codes

  • MS::kSuccess The connected texture was successfully evaluated
  • MS::kUnknownParameter There was no texture, or an unsupported texture connected to the specified attribute, so textured values could not be evaluated.

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright