MECO™ API Reference
Public Member Functions | Static Public Member Functions | List of all members
mMayaCore.optionVarLib.OptionVar Class Reference

[ CLASS ] - Class provides functionalities to operate on optionVar in Maya. More...

Inheritance diagram for mMayaCore.optionVarLib.OptionVar:

Public Member Functions

def __init__ (self, name)
 Constructor. More...
 
def name (self)
 Name of the option variable. More...
 
def exists (self)
 Check whether the option variable exists. More...
 
def remove (self)
 Remove the option variable. More...
 
def setValue (self, value)
 Set value of the option variable. More...
 
def value (self)
 Get the value of the option variable. More...
 

Static Public Member Functions

def list ()
 List all option variables. More...
 

Detailed Description

[ CLASS ] - Class provides functionalities to operate on optionVar in Maya.

import sys
optionVar = mMayaCore.optionVarLib.OptionVar('lastSelectedObject')
sys.stdout.write(optionVar.exists())
# False
optionVar.setValue('cube1')
sys.stdout.write(optionVar.exists())
# True
sys.stdout.write(optionVar.value())
# cube1
sys.stdout.write(optionVar.name())
# lastSelectedObject

Constructor & Destructor Documentation

◆ __init__()

def mMayaCore.optionVarLib.OptionVar.__init__ (   self,
  name 
)

Constructor.

Parameters
name[ str | None | in ] - Name of the variable.
Exceptions
N/A
Returns
None

Member Function Documentation

◆ name()

def mMayaCore.optionVarLib.OptionVar.name (   self)

Name of the option variable.

Exceptions
N/A
Returns
str - Name of the option variable.
None - If name is not set.

◆ exists()

def mMayaCore.optionVarLib.OptionVar.exists (   self)

Check whether the option variable exists.

Exceptions
N/A
Returns
bool - Result.

◆ remove()

def mMayaCore.optionVarLib.OptionVar.remove (   self)

Remove the option variable.

Exceptions
N/A
Returns
None

◆ setValue()

def mMayaCore.optionVarLib.OptionVar.setValue (   self,
  value 
)

Set value of the option variable.

Parameters
value[ int, float, str | None | in ] - Value to be set.
Exceptions
N/A
Returns
None

◆ value()

def mMayaCore.optionVarLib.OptionVar.value (   self)

Get the value of the option variable.

Exceptions
N/A
Returns
int, float, str - Value of the option variable.
None - If option variable doesn't exist.

◆ list()

def mMayaCore.optionVarLib.OptionVar.list ( )
static

List all option variables.

Exceptions
N/A
Returns
str list - Option variables

The documentation for this class was generated from the following file:
mMayaCore.optionVarLib
[ FILE ] - Operate on optionVar in Maya.
Definition: optionVarLib.py:1
mMayaCore.optionVarLib.OptionVar
[ CLASS ] - Class provides functionalities to operate on optionVar in Maya.
Definition: optionVarLib.py:59