class MFnSet

Jump to documentation

: public MFnDependencyNode Function Set for Sets of Objects. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnSet < MFnDependencyNode < MFnBase

public members:

MFnSet ()
MFnSet ( MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnSet ()
virtual MFn::Type type () const
enum Restriction
kNone
kVerticesOnly
kEdgesOnly
kFacetsOnly
kEditPointsOnly
kRenderableOnly
MObject create ( const MSelectionList & members, Restriction restriction = kNone , MStatus * ReturnStatus = NULL )
MStatus getUnion ( const MObject & withSet, MSelectionList & result )
MStatus getUnion ( const MObjectArray & setList, MSelectionList & result )
MStatus getIntersection ( const MObject & withSet, MSelectionList & result )
MStatus getIntersection ( const MObjectArray & setList, MSelectionList & result )
MStatus clear ()
MStatus getMembers ( MSelectionList &members, bool flatten ) const
MStatus addMember ( const MObject &obj )
MStatus addMember ( const MDagPath &obj, const MObject &component = MObject::kNullObj )
MStatus addMember ( const MPlug &plug )
MStatus addMembers ( const MSelectionList &list )
MStatus removeMember ( const MObject &obj )
MStatus removeMember ( const MDagPath &obj, const MObject &component )
MStatus removeMember ( const MPlug &plug )
MStatus removeMembers ( const MSelectionList &list )
bool isMember ( const MObject &object, MStatus * ReturnStatus = NULL ) const
bool isMember ( const MDagPath &object, const MObject &component = MObject::kNullObj , MStatus * ReturnStatus = NULL ) const
bool isMember ( const MPlug &plug, MStatus * ReturnStatus = NULL ) const
bool intersectsWith ( const MObject & otherSet, MStatus * ReturnStatus = NULL ) const
bool hasRestrictions ( MStatus * ReturnStatus = NULL ) const
Restriction restriction ( MStatus * ReturnStatus = NULL ) const
MString annotation ( MStatus * ReturnStatus = NULL ) const
MStatus setAnnotation ( const MString & annotation )
MFnSet ( const MObject & object, MStatus * ReturnStatus = NULL )

Inherited from MFnDependencyNode:

public members:

virtual MFn::Type type () const
enum MAttrClass
kGlobalDynamicAttr
kLocalDynamicAttr
MObject create ( const MTypeId & typeId , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , const MString & name , MStatus * ReturnStatus = NULL )
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MString typeName ( MStatus * ReturnStatus = NULL ) const
MString name ( MStatus * ReturnStatus = NULL ) const
MString setName ( const MString & name , MStatus * ReturnStatus = NULL )
MStatus getConnections ( MPlugArray & array ) const
unsigned int attributeCount ( MStatus * ReturnStatus=NULL) const
MObject attribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject reorderedAttribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject attribute ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MAttrClass attributeClass ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MStatus getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const
MStatus getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const
MPlug findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MStatus addAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MStatus removeAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MPxNode * userNode ( MStatus * ReturnStatus=NULL ) const
bool isFromReferencedFile ( MStatus * ReturnStatus=NULL) const
bool isShared ( MStatus * ReturnStatus=NULL) const
bool hasUniqueName ( MStatus * ReturnStatus=NULL) const
MString parentNamespace ( MStatus * ReturnStatus=NULL) const
bool isLocked ( MStatus * ReturnStatus=NULL) const
MStatus setLocked ( bool locked )
static MString classification ( const MString & nodeTypeName )
bool isNewAttribute ( const MObject & attr, MStatus * ReturnStatus=NULL) const
static unsigned int allocateFlag ( const MString pluginName, MStatus * ReturnStatus=NULL )
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
static MStatus deallocateAllFlags (const MString pluginName)
MStatus setFlag (unsigned int flag, bool state)
bool isFlagSet (unsigned int flag, MStatus * ReturnStatus=NULL) const
bool isDefaultNode ( MStatus * ReturnStatus=NULL) const
MStatus setDoNotWrite ( bool flag )
bool canBeWritten ( MStatus * ReturnStatus=NULL) const
bool hasAttribute (const MString & name , MStatus * ReturnStatus=NULL) const
MObject getAliasAttr (bool force, MStatus * ReturnStatus=NULL)
bool setAlias (const MString & alias,const MString & name , const MPlug & plug, bool add=true, MStatus * ReturnStatus=NULL)
bool findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus=NULL) const
bool getAliasList ( MStringArray & strArray, MStatus * ReturnStatus=NULL)
MString plugsAlias (const MPlug & plug, MStatus * ReturnStatus=NULL)
public
bool getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus=NULL)

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

Function set for sets of objects
Description

MFnSet is the function set that is used for manipulating sets of objects. Sets in Maya are dependency nodes, so it is possible for one set to contain others.

A set is a list of dependency nodes and dag nodes. Sets are useful for keeping track of lists of objects for many purposes such as selection or applying common rendering parameters. Sets in Maya are also dependency nodes, so it is possible for one set to contain others.

Functions

MFnSet:: MFnSet ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnSet:: MFnSet ( MObject & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • 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

MFnSet:: MFnSet ( const MObject & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • 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

MFnSet:: ~MFnSet ()

Description

The class destructor.

MFn::Type MFnSet:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kSet

MObject MFnSet:: create ( const MSelectionList & members, Restriction restriction , MStatus * ReturnStatus )

Description

Creates a new set dependency node and puts it in the dependency graph.

Arguments

  • members list of members for new set
  • restriction restriction applied to members
  • ReturnStatus return status

Return Value

  • a handle for the new set object

Status Codes

  • MS::kSuccess operation successful
  • MS::kLicenseFailure application not licensed for attempted operation
  • MS::kInsufficientMemory out of memory

MStatus MFnSet:: getUnion ( const MObject & withSet, MSelectionList & result )

Description

This method calculates the union of two sets. The result will be the union of this set and the set passed into the method.

Arguments

  • withSet set to find union of with this set
  • result storage for the result of the union operation

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInvalidParameter one of the sets is invalid

MStatus MFnSet:: getUnion ( const MObjectArray & setList, MSelectionList & result )

Description

This method calculates the union of a list of sets. The result will be the union of this set and the sets passed into the method.

Arguments

  • setList sets to find union of with this set
  • result storage for the result of the union operation

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInvalidParameter one of the sets is invalid

MStatus MFnSet:: getIntersection ( const MObject & withSet, MSelectionList & result )

Description

This method calculates the intersection of two sets. The result will be the intersection of this set and the set passed into the method.

Arguments

  • withSet set to find intersection of with this set
  • result storage for the result of the intersection operation

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInvalidParameter the set passed in is invalid

MStatus MFnSet:: getIntersection ( const MObjectArray & setList, MSelectionList & result )

Description

This method calculates the intersection of a list of sets. The result will be the intersection of this set and the sets passed into the method.

Arguments

  • setList sets to find intersection of with this set
  • result storage for the result of the intersection operation

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInvalidParameter one of the sets is invalid

MObject MFnSet:: createFromUnion ( const MObjectArray & listOfSets, MStatus * ReturnStatus )

Description

Creates a new set that is the union of the given sets. All objects that are in any of the given sets will become members of this set.

Arguments

  • listOfSets a list of the sets to union

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter one of the sets is invalid
  • MS::kLicenseFailure application not licensed for attempted operation
  • MS::kInsufficientMemory out of memory

MObject MFnSet:: createFromIntersection ( const MObject & set1, const MObject & set2, MStatus * ReturnStatus )

Description

Changes the contents of this set to be the intersection of the given sets. All objects that are in both of the given sets will become members of this set.

Arguments

  • set1 first set
  • set1 second set

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter one of the sets is invalid
  • MS::kFailure this set cannot used for this operation (cannot be a render set)
  • MS::kLicenseFailure application not licensed for attempted operation
  • MS::kInsufficientMemory out of memory

MObject MFnSet:: createFromIntersection ( const MObjectArray & listOfSets, MStatus * ReturnStatus )

Description

Changes the contents of this set to be the intersection of the given sets. All objects that are in all of the given sets will become members of this set.

Arguments

  • listOfSets list of sets to intersect

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter one of the sets is invalid
  • MS::kFailure this set cannot used for this operation (cannot be a render set)
  • MS::kLicenseFailure application not licensed for attempted operation
  • MS::kInsufficientMemory out of memory

MStatus MFnSet:: clear ()

Description

Removes all elements from this set

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object

MStatus MFnSet:: getMembers ( MSelectionList &members, bool flatten ) const

Description

Get the members of this set as a selection list. This information is provided as a selection list so that all of the path information is retained for DAG nodes.

It is possible to ask for the returned list to be flattened. This means that all sets that exist inside this set will be expanded into a list of their contents.

Arguments

  • members storage for the returned list of members
  • flatten whether to flatten the returned list.

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInsufficientMemory out of memory

MStatus MFnSet:: addMember ( const MObject &obj )

Description

Add a new object (dependency node) to the set.

Arguments

  • obj the object to add

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInsufficientMemory out of memory

MStatus MFnSet:: addMember ( const MDagPath &obj, const MObject &component )

Description

Add a new object (DAG node) to the set.

Arguments

  • obj the object to add
  • component the selection component

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInsufficientMemory out of memory

MStatus MFnSet:: addMember ( const MPlug &plug )

Description

Add a new plug to the set.

Arguments

  • plug the plug to add

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInsufficientMemory out of memory

MStatus MFnSet:: addMembers ( const MSelectionList &list )

Description

Add a list of new objects to the set.

Arguments

  • list the list of objects as a selection list

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInsufficientMemory out of memory

MStatus MFnSet:: removeMember ( const MObject &obj )

Description

Remove an object (dependency node) from the set.

Arguments

  • obj the object to remove

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInsufficientMemory out of memory

MStatus MFnSet:: removeMember ( const MDagPath &obj, const MObject &component )

Description

Remove an object (DAG node) from the set.

Arguments

  • obj the object to remove
  • component the selection component

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInsufficientMemory out of memory

MStatus MFnSet:: removeMember ( const MPlug &plug )

Description

Remove an plug from the set.

Arguments

  • plug the plug to remove

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object
  • MS::kInsufficientMemory out of memory

MStatus MFnSet:: removeMembers ( const MSelectionList &list )

Description

Remove items of the selection list from the set.

Arguments

  • list the selection list of items to remove

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object or an item is not in set
  • MS::kInsufficientMemory out of memory

bool MFnSet:: isMember ( const MObject &object, MStatus * ReturnStatus ) const

Description

Returns true if the given object (dependency node) is a member of this set

Arguments

  • object object to test for membership
  • ReturnStatus return status

Return Value

  • a boolean value indicating whether the object is a member

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object

bool MFnSet:: isMember ( const MDagPath &object, const MObject &component, MStatus * ReturnStatus ) const

Description

Returns true if the given object (DAG node) is a member of this set

Arguments

  • object object to test for membership
  • component selection component (optional)
  • ReturnStatus return status

Return Value

  • a boolean value indicating whether the object is a member

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object

bool MFnSet:: isMember ( const MPlug &plug, MStatus * ReturnStatus ) const

Description

Returns true if the given plug is a member of this set

Arguments

  • plug plug to test for membership
  • ReturnStatus return status

Return Value

  • a boolean value indicating whether the plug is a member

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object

bool MFnSet:: intersectsWith ( const MObject & otherSet, MStatus * ReturnStatus ) const

Description

Returns true if this set intersects with the given set. An intersection occurs if there are any common members between the two sets.

Arguments

  • otherSet set to test for intersection with
  • ReturnStatus return status

Return Value

  • boolean value indicating whether there was an intersection

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure otherSet is not a valid set

bool MFnSet:: hasRestrictions ( MStatus * ReturnStatus ) const

Description

Returns true if this function set has restrictions on the type of objects that it may contain.

Arguments

  • ReturnStatus return status

Return Value

  • a boolean value indicating whether this set has restriction

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object

MFnSet::Restriction MFnSet:: restriction ( MStatus * ReturnStatus ) const

Description

Returns the type of membership restriction that this set has.

Arguments

  • ReturnStatus return status

Return Value

  • the type of restriction

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object

MString MFnSet:: annotation ( MStatus * ReturnStatus ) const

Description

Returns the annotation string for this set. This allows a description of the set to be stored with it.

Arguments

  • ReturnStatus return status

Return Value

  • the annotation string

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object

MStatus MFnSet:: setAnnotation ( const MString & annotation )

Description

Sets the annotation string for this set. This allows a description of the set to be stored with it.

Arguments

  • annotation new annotation string

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid set object

Direct child classes:

- MFnCharacter

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