Cortex  10.0.0-a4
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
IECoreMaya::ParameterisedHolder< BaseType > Class Template Reference

#include <ParameterisedHolder.h>

+ Inheritance diagram for IECoreMaya::ParameterisedHolder< BaseType >:

Public Member Functions

virtual void postConstructor ()
 
virtual MStatus setDependentsDirty (const MPlug &plug, MPlugArray &plugArray)
 
virtual MStatus shouldSave (const MPlug &plug, bool &isSaving)
 
ParameterisedHolderInterface implementation
virtual MStatus setParameterised (IECore::RunTimeTypedPtr p)
 
virtual MStatus setParameterised (const std::string &className, int classVersion, const std::string &searchPathEnvVar)
 
virtual MStatus updateParameterised ()
 
virtual IECore::RunTimeTypedPtr getParameterised (std::string *className=0, int *classVersion=0, std::string *searchPathEnvVar=0)
 
virtual MStatus setNodeValues ()
 
virtual MStatus setNodeValue (IECore::ParameterPtr pa)
 
virtual MStatus setParameterisedValues ()
 
virtual MStatus setParameterisedValue (IECore::ParameterPtr pa)
 
virtual MPlug parameterPlug (IECore::ConstParameterPtr parameter)
 
virtual IECore::ParameterPtr plugParameter (const MPlug &plug)
 
- Public Member Functions inherited from IECoreMaya::ParameterisedHolderInterface
IECore::ParameterisedInterfacegetParameterisedInterface ()
 Convenience method to return dynamic_cast<IECore::ParameterisedInterface *>( getParameterised().get() )
 
IECore::ParameterisedInterfacegetParameterisedInterface (std::string *className, int *classVersion=0, std::string *searchPathEnvVar=0)
 

Static Public Member Functions

static void * creator ()
 
static MStatus initialize ()
 

Static Public Attributes

static MTypeId id
 
static MString typeName
 
Attributes
static MObject aParameterisedClassName
 
static MObject aParameterisedVersion
 
static MObject aParameterisedSearchPathEnvVar
 

Protected Member Functions

MStatus setParameterisedValues (bool lazy)
 
MStatus createOrUpdateAttribute (IECore::ParameterPtr parameter, const MString &attributeName, bool callRestore=false)
 Creates an attribute to represent the specified parameter, or updates an existing attribute.
 

Protected Attributes

IECore::RunTimeTypedPtr m_parameterised
 
bool m_failedToLoad
 

Static Protected Attributes

static const std::string g_attributeNamePrefix
 

Detailed Description

template<typename BaseType>
class IECoreMaya::ParameterisedHolder< BaseType >

A base class from which nodes to hold IECore::Parameterised objects should derive (for example, Maya RI procedurals). It's templated to allow inheritance from any Maya proxy.

This class represents the hierarchy of parameters in a flattened form using name munging to generate unique names for the maya attributes. We would much rather it used maya compound attributes to maintain the hierarchy but this is problematic - it seems the maya api doesn't implement the on the fly modification of compound attributes after they've been added to a node, and that is required by a series of changing calls to setParameterised(). Maya also requires the names of children of nested compounds to be unique to the node anyway, forcing a name munging approach even in the case that compound usage was possible.

Member Function Documentation

template<typename BaseType>
virtual IECore::RunTimeTypedPtr IECoreMaya::ParameterisedHolder< BaseType >::getParameterised ( std::string *  className = 0,
int *  classVersion = 0,
std::string *  searchPathEnvVar = 0 
)
virtual

Returns the held Parameterised object, loading it if necessary. May return 0 if loading fails. Note that this doesn't update the values of the parameters - you can use the separate setParameterisedValues() call for that. If provided, the optional className, classVersion and searchPathEnvVar are updated to reflect the last values passed to setParameterised - in the case of a 0 return value these values are left unchanged.

Implements IECoreMaya::ParameterisedHolderInterface.

Reimplemented in IECoreMaya::OpHolder< BaseType >.

Referenced by IECoreMaya.FnProceduralHolder::getProcedural(), IECoreMaya.FnParameterisedHolder::ls(), IECoreMaya.FnParameterisedHolder::removeSetClassParameterClassCallback(), and IECoreMaya.FnParameterisedHolder::setParameterised().

template<typename BaseType>
virtual MPlug IECoreMaya::ParameterisedHolder< BaseType >::parameterPlug ( IECore::ConstParameterPtr  parameter)
virtual

Returns the plug used to represent the specified parameter, which should be a child of getParameterised()->parameters(). On failure returns a plug for which plug.isNull() returns true.

Implements IECoreMaya::ParameterisedHolderInterface.

Referenced by IECoreMaya.FnParameterisedHolder::setNodeValue().

template<typename BaseType>
virtual IECore::ParameterPtr IECoreMaya::ParameterisedHolder< BaseType >::plugParameter ( const MPlug &  plug)
virtual

Returns the parameter represented by the specified plug, returning 0 if no such parameter exists.

Implements IECoreMaya::ParameterisedHolderInterface.

template<typename BaseType>
virtual MStatus IECoreMaya::ParameterisedHolder< BaseType >::setNodeValue ( IECore::ParameterPtr  pa)
virtual

Sets the attribute of the node to reflect the current value of the specified parameter in the held Parameterised object. Performs validation of the parameter values and will return kFailure if any one is not valid.

Implements IECoreMaya::ParameterisedHolderInterface.

template<typename BaseType>
virtual MStatus IECoreMaya::ParameterisedHolder< BaseType >::setNodeValues ( )
virtual

Sets the attributes of the node to reflect the current values of the parameters in the held Parameterised object. Performs validation of the parameter values and will return kFailure if any one is not valid.

Implements IECoreMaya::ParameterisedHolderInterface.

template<typename BaseType>
virtual MStatus IECoreMaya::ParameterisedHolder< BaseType >::setParameterised ( IECore::RunTimeTypedPtr  p)
virtual

Set the node to hold a particular Parameterised object. When using this version of setParameterised the node will not be able to preserve the object across scene save/load - this becomes your responsibility if it's necessary.

Implements IECoreMaya::ParameterisedHolderInterface.

Reimplemented in IECoreMaya::OpHolder< BaseType >.

Referenced by IECoreMaya.FnProceduralHolder::setProcedural().

template<typename BaseType>
virtual MStatus IECoreMaya::ParameterisedHolder< BaseType >::setParameterised ( const std::string &  className,
int  classVersion,
const std::string &  searchPathEnvVar 
)
virtual

Sets the Parameterised object this node is holding. An IECore.ClassLoader object will be used with searchpaths obtained from the specified environment variable to actually load the Parameterised object. This mechanism is used rather than passing a ParameterisedPtr as it allows the Parameterised object to be loaded again when a maya scene is opened.

Implements IECoreMaya::ParameterisedHolderInterface.

Referenced by IECoreMaya.FnProceduralHolder::setProcedural().

template<typename BaseType>
virtual MStatus IECoreMaya::ParameterisedHolder< BaseType >::setParameterisedValue ( IECore::ParameterPtr  pa)
virtual

Sets the value of the specified parameter of the held Parameterised object to reflect the value of the corresponding attribute on the node. Performs validation of the parameter values and will return kFailure if any one in not valid.

Implements IECoreMaya::ParameterisedHolderInterface.

template<typename BaseType>
virtual MStatus IECoreMaya::ParameterisedHolder< BaseType >::setParameterisedValues ( )
virtual

Sets the values of the parameters of the held Parameterised object to reflect the values of the attributes of the node. Performs validation of the parameter values and will return kFailure if any one in not valid.

Implements IECoreMaya::ParameterisedHolderInterface.

Referenced by IECoreMaya.FnParameterisedHolder::setParameterised().

template<typename BaseType>
MStatus IECoreMaya::ParameterisedHolder< BaseType >::setParameterisedValues ( bool  lazy)
protected

As for setParameterisedValues(), but when lazy==true, the work is only done for parameters whose plug value has changed since the last time the value was set.

Referenced by IECoreMaya.FnParameterisedHolder::setParameterised().

template<typename BaseType>
virtual MStatus IECoreMaya::ParameterisedHolder< BaseType >::updateParameterised ( )
virtual

Updates this object to represent any changes in the held parameters. It is the responsibility of the caller to ensure that there is some means of preserving these changes across file save/open if this is desired - the ClassParameterHandler provides an example of doing this.

Implements IECoreMaya::ParameterisedHolderInterface.

Member Data Documentation

template<typename BaseType>
MTypeId IECoreMaya::ParameterisedHolder< BaseType >::id
static

This is a template class instantiated into many different classes, so we specialise these in the implementation.


The documentation for this class was generated from the following file: