- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions

# MFnVolumeLight Class Reference

# OpenMaya - API module for common classes | FunctionSet classes

Search for all occurrences

## Detailed Description

Manage volume Light dependency Nodes.

MFnVolumeLight facilitates creation and manipulation of dependency graph nodes representing voume lights.

Examples:

  volumeLightCmd.cpp.

`#include <MFnVolumeLight.h>`

Inheritance diagram for MFnVolumeLight:
[legend]

List of all members.

## Public Types
enum | MLightShape { kBoxVolume, kSphereVolume, kCylinderVolume, kConeVolume }
| Available shapes for a volume light. More...
enum | MLightDirection { kOutward, kInward, kDownAxis }
| Direction that light travels. More...
## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnVolumeLight ()
| Destructor.
| MFnVolumeLight ()
| Default constructor.
| MFnVolumeLight (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
| MFnVolumeLight (const MDagPath &object, MStatus *ret=NULL)
| Constructor.
MObject | create (bool UIvisible=true, MStatus *ReturnStatus=NULL)
| Creates a new volume light dependency graph node and adds it to the dependency graph.
MObject | create (const MObject &parent, bool UIvisible=true, bool wantTransform=false, MStatus *ReturnStatus=NULL)
| Creates a new volume light dependency graph node and adds it to the dependency graph.
MFnVolumeLight::MLightShape | lightShape (MStatus *ReturnStatus=NULL) const
| Retrieves the "lightShape" attribute of the light.
MStatus | setLightShape (const MFnVolumeLight::MLightShape &light_shape)
| Sets the value of the "lightShape" attribute of a volume light node.
MFnVolumeLight::MLightDirection | volumeLightDirection (MStatus *ReturnStatus=NULL) const
| Retrieves the value of the "volumeLightDirection" attribute.
MStatus | setVolumeLightDirection (const MFnVolumeLight::MLightDirection &volume_light_direction)
| Sets the value of the "volumeLightDirection" attribute of a volume light node.
float | arc (MStatus *ReturnStatus=NULL) const
| Retrieves the value of the "arc" attribute.
MStatus | setArc (const float &arc)
| Sets the value of the "arc" attribute of a volume light node.
float | coneEndRadius (MStatus *ReturnStatus=NULL) const
| Retrieves the value of the "coneEndRadius" attribute.
MStatus | setConeEndRadius (const float &cone_end_radius)
| Sets the value of the "coneEndRadius" attribute of a volume light node.
bool | emitAmbient (MStatus *ReturnStatus=NULL) const
| Retrieves the value of the "emitAmbient" attribute.
MStatus | setEmitAmbient (const bool &emit_ambient)
| Sets the value of the "emitAmbient" attribute of a volume light node.
MRampAttribute | colorRamp (MStatus *ReturnStatus=NULL) const
| Retrieves the "colorRamp" attribute.
MRampAttribute | penumbraRamp (MStatus *ReturnStatus=NULL) const
| Retrieves the "penumbraRamp" attribute.
float | shadowAngle (MStatus *ReturnStatus=NULL) const
| Retrieves the value of the "shadowAngle" attribute of a volume light node.
MStatus | setShadowAngle (const float &shadow_angle)
| Sets the value of the "shadowAngle" attribute of a volume light node.
| MFnVolumeLight (const MObject &object, MStatus *ret=NULL)
| Constructor.
MObject | create (const MObject &parent, bool UIvisible=true, MStatus *ReturnStatus=NULL)
| NO SCRIPT SUPPORT.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Member Enumeration Documentation

enum MLightShape

Search for all occurrences

Available shapes for a volume light.

Enumerator:

  kBoxVolume | Search for all occurrences
  kSphereVolume | Search for all occurrences
  kCylinderVolume | Search for all occurrences
  kConeVolume | Search for all occurrences

enum MLightDirection

Search for all occurrences

Direction that light travels.

Enumerator:

  kOutward | Light travels outwared from the center of a box- or sphere-shaped volume, and outward from the axis of a cylinder- or cone-shaped volume. Search for all occurrences
  kInward | Light travels inward toward the center of a box- or sphere-shaped volume, and inward toward the axis of a cylinder- or cone-shaped volume. Search for all occurrences
  kDownAxis | Light travels down the axis, like a directional light pointing in the negative Y direction. Search for all occurrences

## Constructor & Destructor Documentation

~MFnVolumeLight | ( |  | ) | `[virtual]`

Destructor.

The class destructor.

MFnVolumeLight | ( | MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnVolumeLight | ( | const MDagPath & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given constant MDagPath object.

Parameters:

  [in] | object | The const MDagPath to attach the function set to
  [out] | ReturnStatus | The return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnVolumeLight | ( | const MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

## Member Function Documentation

MFn::Type type | ( |  | ) | const `[virtual]`

Search for all occurrences

Function set type.

Return the class type : MFn::kVolumeLight.

Reimplemented from MFnPointLight.

const char * className | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

Class name.

Return the class name : "MFnVolumeLight".

Reimplemented from MFnPointLight.

MObject create | ( | bool | UIvisible = `true`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Creates a new volume light dependency graph node and adds it to the dependency graph.

If the UIvisible parameter is true, the new node will be connected to the light classification node (which allows the UI to recognize the node as a light) and added to the default light list. If UIvisible is false, the node will be created in isolation.

The light node is added to the current model, under a new transformation.

Parameters:

  [in] | UIvisible | determines whether or not to connect the new node to the light classification node and add it to the default light list.
  [out] | ReturnStatus | return status

Returns:
  MObject representing the new dependency node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInsufficientMemory ran out of memory
  - MS::kNoModelActive no model is currently active
  - MS::kLicenseFailure application not licensed for attempted operation
  - MS::kFailure the new node could not be added to the model, or the function set could not be properly initialized with the new object.

Reimplemented from MFnPointLight.

Examples:
  volumeLightCmd.cpp.

MObject create | ( | const MObject & | parent,
|  | bool | UIvisible = `true`,
|  | bool | wantTransform = `false`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Creates a new volume light dependency graph node and adds it to the dependency graph.

If the UIvisible parameter is true, the new node will be connected to the light classification node (which allows the UI to recognize the node as a light) and added to the default light list. If UIvisible is false, the node will be created in isolation.

If wantTransform parameter is false ( which is by default ), the new shape node is created under the specified parent and no transform node is created. If the specified parent is null, then no shape node will be created.

The light node is added to the current model, under the specified parent.

Parameters:

  [in] | parent | the node under which the new light and its transform will be added.
  [in] | wantTransform | Boolean to indicate whether the transform node is needed or not, which is 'false' by default.
  [in] | UIvisible | determines whether or not to connect the new node to the light classification node and add it to the default light list.
  [out] | ReturnStatus | return status

Returns:
  MObject representing the new dependency node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInsufficientMemory ran out of memory
  - MS::kNoModelActive no model is currently active
  - MS::kLicenseFailure application not licensed for attempted operation
  - MS::kFailure the new node could not be added to the model, or the function set could not be properly initialized with the new object.

Reimplemented from MFnPointLight.

MFnVolumeLight::MLightShape lightShape | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Retrieves the "lightShape" attribute of the light.

The shape can be one of the following.

- MFnVolumeLight::kBoxVolume
- MFnVolumeLight::kCylinderVolume
- MFnVolumeLight::kSphereVolume
- MFnVolumeLight::kConeVolume

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The value of the "lightShape" attribute of the volume light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object.

Examples:
  volumeLightCmd.cpp.

MStatus setLightShape | ( | const MFnVolumeLight::MLightShape & | light_shape | ) |

Search for all occurrences

Sets the value of the "lightShape" attribute of a volume light node.

The shape can be one of the following:

- MFnVolumeLight::kBoxVolume
- MFnVolumeLight::kCylinderVolume
- MFnVolumeLight::kSphereVolume
- MFnVolumeLight::kConeVolume

Parameters:

  [in] | light_shape | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object,

Examples:
  volumeLightCmd.cpp.

MFnVolumeLight::MLightDirection volumeLightDirection | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Retrieves the value of the "volumeLightDirection" attribute.

The volumeLightDirection attribute determines the direction of the light within the volume. Outward has light moving away from the center of a Box or Sphere and away from the central axis of a Cylinder or Cone. Inward is the reverse of the direction. One can light from the outside of a sphere going in. Up Axis is like a directional light pointing in the positive y direction. Down axis points in the negative y direction. Note that Inward will not always shadow in a desirable fashion. The volumeLightDirection attribute can be one of the following:

- MFnVolumeLight::kInward
- MFnVolumeLight::kOutward
- MFnVolumeLight::kDownAxis

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The value of the "lightDirection" attribute of the volume light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object.

Examples:
  volumeLightCmd.cpp.

MStatus setVolumeLightDirection | ( | const MFnVolumeLight::MLightDirection & | volume_light_direction | ) |

Search for all occurrences

Sets the value of the "volumeLightDirection" attribute of a volume light node.

The shape can be one of the following.

- MFnVolumeLight::kBoxVolume
- MFnVolumeLight::kCylinderVolume
- MFnVolumeLight::kSphereVolume
- MFnVolumeLight::kConeVolume

Parameters:

  [in] | volume_light_direction | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object,

Examples:
  volumeLightCmd.cpp.

float arc | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Retrieves the value of the "arc" attribute.

The arc is an angular slice of the light about the y axis. The value can range from 0 to 360 degrees.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The value of the "arc" attribute of the volume light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object.

Examples:
  volumeLightCmd.cpp.

MStatus setArc | ( | const float & | arc | ) |

Search for all occurrences

Sets the value of the "arc" attribute of a volume light node.

Parameters:

  [in] | arc | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object,

Examples:
  volumeLightCmd.cpp.

float coneEndRadius | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Retrieves the value of the "coneEndRadius" attribute.

The coneEndRadius attribute determines the relative size of the one end of the cone. At a value of 1.0 it is a cylinder, while at 0 it is a cone.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The value of the "coneEndRadius" attribute of the volume light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object.

Examples:
  volumeLightCmd.cpp.

MStatus setConeEndRadius | ( | const float & | cone_end_radius | ) |

Search for all occurrences

Sets the value of the "coneEndRadius" attribute of a volume light node.

Parameters:

  [in] | cone_end_radius | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object,

Examples:
  volumeLightCmd.cpp.

bool emitAmbient | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Retrieves the value of the "emitAmbient" attribute.

If true, then light affects surfaces in a non directional fashion. When combined with Emit Diffuse the lighting at a surface will be half applied using the surface/light angle, and half in a nondirectional fashion. If Emit Diffuse is off then the light will be totally omnidirectional.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The value of the "emitAmbient" attribute of the volume light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object.

Examples:
  volumeLightCmd.cpp.

MStatus setEmitAmbient | ( | const bool & | emit_ambient | ) |

Search for all occurrences

Sets the value of the "emitAmbient" attribute of a volume light node.

Parameters:

  [in] | emit_ambient | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object,

Examples:
  volumeLightCmd.cpp.

MRampAttribute colorRamp | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Retrieves the "colorRamp" attribute.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The color ramp attribute

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object.

Examples:
  volumeLightCmd.cpp.

MRampAttribute penumbraRamp | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Retrieves the "penumbraRamp" attribute.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The penumbra ramp attribute

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object.

Examples:
  volumeLightCmd.cpp.

float shadowAngle | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Retrieves the value of the "shadowAngle" attribute of a volume light node.

This attribute represents an angular divergence from the direction vector of the light used to calculate soft shadows. It's enabled only if the volume light direction is kDownAxis.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The value of the "shadowAngle" attribute of the light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object.

MStatus setShadowAngle | ( | const float & | shadow_angle | ) |

Search for all occurrences

Sets the value of the "shadowAngle" attribute of a volume light node.

It's enabled only if the volume light direction is kDownAxis.

Parameters:

  [in] | shadow_angle | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object.

MObject create | ( | const MObject & | parent,
|  | bool | UIvisible = `true`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

NO SCRIPT SUPPORT.

Creates a new volume light dependency graph node and adds it to the dependency graph.

If the UIvisible parameter is true, the new node will be connected to the light classification node (which allows the UI to recognize the node as a light) and added to the default light list. If UIvisible is false, the node will be created in isolation.

The light node is added to the current model, under a new transformation. The transformation is added to the current model under the specified parent.

Parameters:

  [in] | parent | the node under which the new light and its transform will be added.
  [in] | UIvisible | determines whether or not to connect the new node to the light classification node and add it to the default light list.
  [out] | ReturnStatus | return status

Returns:
  MObject representing the new dependency node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInsufficientMemory ran out of memory
  - MS::kNoModelActive no model is currently active
  - MS::kLicenseFailure application not licensed for attempted operation
  - MS::kFailure the new node could not be added to the model, or the function set could not be properly initialized with the new object.

Reimplemented from MFnPointLight.

MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight
MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight MFnVolumeLight