pymel.core.nodetypes.FluidShape¶
digraph inheritanced24ed3013b { rankdir=TB; ranksep=0.15; nodesep=0.15; size="8.0, 12.0"; "ContainerBase" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.ContainerBase.html#pymel.core.nodetypes.ContainerBase",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "DependNode" -> "ContainerBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ControlPoint" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.ControlPoint.html#pymel.core.nodetypes.ControlPoint",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "DeformableShape" -> "ControlPoint" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DagNode" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.DagNode.html#pymel.core.nodetypes.DagNode",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "Entity" -> "DagNode" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DeformableShape" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.DeformableShape.html#pymel.core.nodetypes.DeformableShape",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "GeometryShape" -> "DeformableShape" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DependNode" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.DependNode.html#pymel.core.nodetypes.DependNode",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "PyNode" -> "DependNode" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Entity" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.Entity.html#pymel.core.nodetypes.Entity",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "ContainerBase" -> "Entity" [arrowsize=0.5,style="setlinewidth(0.5)"]; "FluidShape" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="#pymel.core.nodetypes.FluidShape",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "SurfaceShape" -> "FluidShape" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeometryShape" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.GeometryShape.html#pymel.core.nodetypes.GeometryShape",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "Shape" -> "GeometryShape" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ProxyUnicode" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="../pymel.util.utilitytypes/pymel.util.utilitytypes.ProxyUnicode.html#pymel.util.utilitytypes.ProxyUnicode",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "PyNode" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="../pymel.core.general/pymel.core.general.PyNode.html#pymel.core.general.PyNode",style="setlinewidth(0.5)",tooltip="Abstract class that is base for all pymel nodes classes.",height=0.25,shape=box,fontsize=8]; "ProxyUnicode" -> "PyNode" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Shape" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.Shape.html#pymel.core.nodetypes.Shape",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "DagNode" -> "Shape" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SurfaceShape" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.SurfaceShape.html#pymel.core.nodetypes.SurfaceShape",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "ControlPoint" -> "SurfaceShape" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
- 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
- density()¶
This method returns a pointer to the storage for the density data in the fluid. The size of this array can be obtained using the “gridSize” call.
Return type: float Derived from api method maya.OpenMayaFX.MFnFluid.density
- 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
- expandToInclude(min, max)¶
Tells the fluid shape to autoresize to include these two points This would normally be used in a fluid emitter node if the fluid had resizeToEmitter turned on. This may fail if the fluid is not autoRise and resizeToEmitter, or if the fluid has reached its maxResolution
Parameters: - min : Point
point at lower corner of bounding box
- max : Point
point at upper corner of boinding box
Derived from api method maya.OpenMayaFX.MFnFluid.expandToInclude
Undo is not currently supported for this method
- falloff()¶
This method returns a pointer to the storage for the falloff data in the fluid. The size of this array can be obtained using the “gridSize” call.
Return type: float Derived from api method maya.OpenMayaFX.MFnFluid.falloff
- fuel()¶
This method returns a pointer to the storage for the fuel data in the fluid. The size of this array can be obtained using the “gridSize” call.
Return type: float Derived from api method maya.OpenMayaFX.MFnFluid.fuel
- 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 “velocityGridSizes” 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
- isAutoResize()¶
Is this an autoresize fluid?
Return type: bool Derived from api method maya.OpenMayaFX.MFnFluid.isAutoResize
- isResizeToEmitter()¶
If this is an autoresize fluid, should it also resize to the emitter
Return type: bool Derived from api method maya.OpenMayaFX.MFnFluid.isResizeToEmitter
- pressure()¶
This method returns a pointer to the storage for the pressure data in the fluid. The size of this array can be obtained using the “gridSize” call. Note that the pressure data only exists if the velocity method is kStaticGrid or kDynamicGrid
Return type: float Derived from api method maya.OpenMayaFX.MFnFluid.pressure
- 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
- temperature()¶
This method returns a pointer to the storage for the temperature data in the fluid. The size of this array can be obtained using the “gridSize” call.
Return type: float Derived from api method maya.OpenMayaFX.MFnFluid.temperature
- 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