pymel.core.nodetypes.FluidShape

Inheritance diagram of FluidShape

class FluidShape(*args, **kwargs)
ColorMethod = Enum( EnumValue('ColorMethod', 0, 'useShadingColor'), EnumValue('ColorMethod', 1, 'staticColorGrid'), EnumValue('ColorMethod', 2, 'dynamicColorGrid'))
CoordinateMethod = Enum( EnumValue('CoordinateMethod', 0, 'fixed'), EnumValue('CoordinateMethod', 1, 'grid'))
FalloffMethod = Enum( EnumValue('FalloffMethod', 0, 'noFalloffGrid'), EnumValue('FalloffMethod', 1, 'staticFalloffGrid'))
FluidGradient = Enum( EnumValue('FluidGradient', 0, 'constant'), EnumValue('FluidGradient', 1, 'XGradient'), EnumValue('FluidGradient', 2, 'YGradient'), EnumValue('FluidGradient', 3, 'ZGradient'), EnumValue('FluidGradient', 4, 'negXGradient'), EnumValue('FluidGradient', 5, 'negYGradient'), EnumValue('FluidGradient', 6, 'negZGradient'), EnumValue('FluidGradient', 7, 'centerGradient'))
FluidMethod = Enum( EnumValue('FluidMethod', 0, 'zero'), EnumValue('FluidMethod', 1, 'staticGrid'), EnumValue('FluidMethod', 2, 'dynamicGrid'), EnumValue('FluidMethod', 3, 'gradient'))
create2D(Xres, Yres, Xdim, Ydim, parent='MObject::kNullObj')

Creates a fluid object from the specified data and sets this function set to operate on the new fluid object.

Parameters :
Xres : int

number of fluid grid cells in the x dimension

Yres : int

number of fluid grid cells in the y dimension

Xdim : float

object space size in the x dimension

Ydim : float

object space size in the y dimension

parent : PyNode

specifies what to do with the new fluid object. If a DAG object or NULL is given then a transform will be created for the new fluid shape and placed under the specified (optional)parent.

Return type:

PyNode

Derived from api method maya.OpenMayaFX.MFnFluid.create2D

create3D(Xres, Yres, Zres, Xdim, Ydim, Zdim, parent='MObject::kNullObj')

Creates a fluid object from the specified data and sets this function set to operate on the new fluid object.

Parameters :
Xres : int

number of fluid grid cells in the x dimension

Yres : int

number of fluid grid cells in the y dimension

Zres : int

number of fluid grid cells in the z dimension

Xdim : float

object space size in the x dimension

Ydim : float

object space size in the y dimension

Zdim : float

object space size in the z dimension

parent : PyNode

specifies what to do with the new fluid object. If a DAG object or NULL is given then a transform will be created for the new fluid shape and placed under the specified (optional)parent.

Return type:

PyNode

Derived from api method maya.OpenMayaFX.MFnFluid.create3D

emitIntoArrays(val, x, y, z, density, heat, fuel, doColor, emitColor)

Use this method to add density, heat, fuel, and/or color to a particular voxel of a fluid.

Parameters :
val : float

multiplier applied to the specified density, heat, and fuel values.

x : int

voxel index in x

y : int

voxel index in y

z : int

voxel index in z

density : float

amount of density to add to the voxel

heat : float

amount of heat to add to the voxel

fuel : float

amount of fuel to add to the voxel

doColor : bool

if true, then color specified by “emitColor” will be blended into the voxel’s current color, with the blend coefficients being determined by the amount of density that is being added to the voxel.

emitColor : Color

color to be blended into the voxel.

Derived from api method maya.OpenMayaFX.MFnFluid.emitIntoArrays

Undo is not currently supported for this method

getColorMode()

Get the modes by which the color values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

Return type:FluidShape.ColorMethod

Derived from api method maya.OpenMayaFX.MFnFluid.getColorMode

getColors()

This method returns pointers to the storage for the color data in the fluid. The size of these arrays can be obtained using the “gridSize” call.

Return type:(float, float, float)

Derived from api method maya.OpenMayaFX.MFnFluid.getColors

getCoordinateMode()

Get the modes by which the UVW coordinates values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

Return type:FluidShape.CoordinateMethod

Derived from api method maya.OpenMayaFX.MFnFluid.getCoordinateMode

getCoordinates()

This method returns pointers to the storage for the uvw coordinate data in the fluid. The size of these arrays can be obtained using the “gridSize” call. The uvw values supply the 3D texture mapping coordinates for each cell.

Return type:(float, float, float)

Derived from api method maya.OpenMayaFX.MFnFluid.getCoordinates

getDensityMode()

Get the modes by which the density values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

Return type:(FluidShape.FluidMethod, FluidShape.FluidGradient)

Derived from api method maya.OpenMayaFX.MFnFluid.getDensityMode

getDimensions()

Gets the dimensions of the fluid. The dimensions give the object space size of the fluid object in each direction.

Return type:(float, float, float)

Derived from api method maya.OpenMayaFX.MFnFluid.getDimensions

getFalloffMode()

Get the modes by which the falloff values in the grid are determined. If the falloff grid is enabled, its values must be set by the user.

Return type:FluidShape.FalloffMethod

Derived from api method maya.OpenMayaFX.MFnFluid.getFalloffMode

getForceAtPoint(point, velocity, mass, deltaTime=0.041666666666666664)

Compute the force of the fluid as a field on an array of points, given their position, velocity, and mass.

Parameters :
point : Point list

array of positions for each point.

velocity : Vector list

array of velocities for each point. If the length of the velocity array is 0, a velocity of 0.0 is assumed for all the points.

mass : float list

array of mass values for each point. If the length of the mass array is 0, a mass of 1.0 is assumed for all the points.

deltaTime : float

time increment in seconds. Default is (1.0 / 24.0 fps).

Return type:

Vector list

Derived from api method maya.OpenMayaFX.MFnFluid.getForceAtPoint

getFuelMode()

Get the modes by which the fuel values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

Return type:(FluidShape.FluidMethod, FluidShape.FluidGradient)

Derived from api method maya.OpenMayaFX.MFnFluid.getFuelMode

getResolution()

Gets the resolution of the fluid. The resolution gives the number of cells in the fluid grid in each direction.

Return type:(int, int, int)

Derived from api method maya.OpenMayaFX.MFnFluid.getResolution

getTemperatureMode()

Get the modes by which the temperature values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

Return type:(FluidShape.FluidMethod, FluidShape.FluidGradient)

Derived from api method maya.OpenMayaFX.MFnFluid.getTemperatureMode

getVelocity()

This method returns pointers to the storage for the velocity data in the fluid. The size of these arrays can be obtained using the “gridSize” call.

Return type:(float, float, float)

Derived from api method maya.OpenMayaFX.MFnFluid.getVelocity

getVelocityMode()

Get the modes by which the velocity values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

Return type:(FluidShape.FluidMethod, FluidShape.FluidGradient)

Derived from api method maya.OpenMayaFX.MFnFluid.getVelocityMode

gridSize()

Returns the number of elements in the grid. This is equal to (x resolution * y resolution * z resolution). This routine is provided as a convenience to be used with the methods that give direct access to the fluid data. This gives the upper bound on the arrays. This size applies to all grids except for the 3 velocity grids.

Return type:int

Derived from api method maya.OpenMayaFX.MFnFluid.gridSize

setColorMode(method)

Set the modes by which the color values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

Parameters :
method : FluidShape.ColorMethod

method for determining the fluid color in the grid

values: ‘useShadingColor’, ‘staticColorGrid’, ‘dynamicColorGrid’

Derived from api method maya.OpenMayaFX.MFnFluid.setColorMode

setCoordinateMode(method)

Set the modes by which the UVW coordinate values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

Parameters :
method : FluidShape.CoordinateMethod

method for determining the fluid UVW coordinates in the grid

values: ‘fixed’, ‘grid’

Derived from api method maya.OpenMayaFX.MFnFluid.setCoordinateMode

setDensityMode(method, gradient)

Set the modes by which the density values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

Parameters :
method : FluidShape.FluidMethod

method for determining the fluid density in the grid

values: ‘zero’, ‘staticGrid’, ‘dynamicGrid’, ‘gradient’

gradient : FluidShape.FluidGradient

gradient type, only used if the method is kGradient

values: ‘constant’, ‘XGradient’, ‘YGradient’, ‘ZGradient’, ‘negXGradient’, ‘negYGradient’, ‘negZGradient’, ‘centerGradient’

Derived from api method maya.OpenMayaFX.MFnFluid.setDensityMode

setFalloffMode(method)

Set the modes by which the shader falloff values in the grid are determined. If the falloff grid is enabled, its values must be set by the user.

Parameters :
method : FluidShape.FalloffMethod

method for determining the falloff value in the grid

values: ‘noFalloffGrid’, ‘staticFalloffGrid’

Derived from api method maya.OpenMayaFX.MFnFluid.setFalloffMode

setFuelMode(method, gradient)

Set the modes by which the fuel values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation. The fuel value for a cell can be thought of as the amount of fuel contained in the cell that will be consumed during the simulation.

Parameters :
method : FluidShape.FluidMethod

method for determining the fluid fuel in the grid

values: ‘zero’, ‘staticGrid’, ‘dynamicGrid’, ‘gradient’

gradient : FluidShape.FluidGradient

gradient type, only used if the method is kGradient

values: ‘constant’, ‘XGradient’, ‘YGradient’, ‘ZGradient’, ‘negXGradient’, ‘negYGradient’, ‘negZGradient’, ‘centerGradient’

Derived from api method maya.OpenMayaFX.MFnFluid.setFuelMode

setSize(Xres, Yres, Zres, Xdim, Ydim, Zdim, resample)

Sets the size and resolution of the grid. The resolution parameters control the number of cells in the fluid grid and the dimension parameters set the size of the fluid shape in object space.

Parameters :
Xres : int

number of fluid grid cells in the x dimension

Yres : int

number of fluid grid cells in the y dimension

Zres : int

number of fluid grid cells in the z dimension

Xdim : float

object space size in the x dimension

Ydim : float

object space size in the y dimension

Zdim : float

object space size in the z dimension

resample : bool

true if the previous contents of the grid should be scaled to fit the new size by resampling the previous data at the new resolution

Derived from api method maya.OpenMayaFX.MFnFluid.setSize

Undo is not currently supported for this method

setTemperatureMode(method, gradient)

Set the modes by which the temperature values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

Parameters :
method : FluidShape.FluidMethod

method for determining the fluid temperature in the grid

values: ‘zero’, ‘staticGrid’, ‘dynamicGrid’, ‘gradient’

gradient : FluidShape.FluidGradient

gradient type, only used if the method is kGradient

values: ‘constant’, ‘XGradient’, ‘YGradient’, ‘ZGradient’, ‘negXGradient’, ‘negYGradient’, ‘negZGradient’, ‘centerGradient’

Derived from api method maya.OpenMayaFX.MFnFluid.setTemperatureMode

setVelocityMode(method, gradient)

Set the modes by which the velocity values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

Parameters :
method : FluidShape.FluidMethod

method for determining the fluid velocity in the grid

values: ‘zero’, ‘staticGrid’, ‘dynamicGrid’, ‘gradient’

gradient : FluidShape.FluidGradient

gradient type, only used if the method is kGradient

values: ‘constant’, ‘XGradient’, ‘YGradient’, ‘ZGradient’, ‘negXGradient’, ‘negYGradient’, ‘negZGradient’, ‘centerGradient’

Derived from api method maya.OpenMayaFX.MFnFluid.setVelocityMode

toGridIndex(objectSpacePoint)

For the given point in object space, get the grid indices of the voxel that it happens to lie in. If the point is outside the fluid, the method returns false, and the indices should not be used.

Parameters :
objectSpacePoint : Point

an object space location

Return type:

(bool, (int, int, int))

Derived from api method maya.OpenMayaFX.MFnFluid.toGridIndex

updateGrid()

Tells the fluid shape that the contents of the fluid grid has changed. It is necessary to call this routine after modifying internal fluid data via a pointer recieved from any of the access routines in this function set. Failure to call this will result in the fluid not drawing with your changes. Derived from api method maya.OpenMayaFX.MFnFluid.updateGrid

Undo is not currently supported for this method

velocityGridSizes()

Returns the number of elements in the velocity grids. X velocity size = (x resolution+1 * y resolution * z resolution). Y velocity size = (x resolution * y resolution+1 * z resolution). Z velocity size = (x resolution * y resolution * z resolution+1).

Return type:(int, int, int)

Derived from api method maya.OpenMayaFX.MFnFluid.velocityGridSizes

voxelCenterPosition(xi, yi, zi)

For the given voxel, get the location of the center in object space. If the voxel indices are not valid, the point may not be set to a valid point

Parameters :
xi : int

the voxel x index

yi : int

the voxel y index

zi : int

the voxel z index

Return type:

Point

Derived from api method maya.OpenMayaFX.MFnFluid.voxelCenterPosition

Previous topic

pymel.core.nodetypes.FluidEmitter

Next topic

pymel.core.nodetypes.FluidTexture2D

Core

Core Modules

Other Modules

This Page