2 #include "AL/usdmaya/Common.h"
3 #include "AL/maya/NodeHelper.h"
4 #include "pxr/usd/usd/stage.h"
6 #include "maya/MPxLocatorNode.h"
28 : MPxNode(),
NodeHelper(), m_handle(), m_shape(0) {}
143 SdfLayerHandle m_handle;
150 void postConstructor()
override;
151 bool getInternalValueInContext(
const MPlug& plug, MDataHandle& dataHandle, MDGContext& ctx)
override;
152 bool setInternalValueInContext(
const MPlug& plug,
const MDataHandle& dataHandle, MDGContext& ctx)
override;
Layer()
ctor
Definition: Layer.h:27
A custom proxy shape node that attaches itself to a USD file, and then renders it. The stage is held internally as a member variable, and it will be composed based on a change to the "filePath" attribute.
Definition: ProxyShape.h:33
bool removeSubLayer(Layer *subLayer)
removes a sub layer from this layer
void addSubLayer(Layer *subLayer, MDGModifier *pmodifier=0)
adds a new sub layer to this layer
Layer * getParentLayer()
returns the parent layer (or NULL)
void buildSubLayers(MDGModifier *pmodifier=0)
constructs the sub layers after a proxy shape has loaded.
AL_MAYA_DECLARE_NODE()
Type Info & Registration.
void setHasBeenTheEditTarget(bool value)
Sets a flag that indicates whether this layer has been set as the edit target.
Layer * findLayer(SdfLayerHandle handle)
locate a layer within the layer stack
std::vector< Layer * > getSubLayers()
Methods to work with sublayers.
MPlug parentLayerPlug()
returns the plug to the parent layer message attribute
void setLayerAndClearAttribute(SdfLayerHandle handle)
If the 'serialized' string attribute has data, then this method will initialize the layer specified t...
static MString toMayaNodeName(std::string name)
convert a usd display name into something maya can use as a node name
void init(ProxyShape *shape, SdfLayerHandle handle)
Called within the proxy shape to initialise the layer to the specified proxy shape and layer handle...
AL_DECL_ATTRIBUTE(comment)
Type Info & Registration.
NodeHelper()
ctor
Definition: NodeHelper.h:212
bool hasBeenTheEditTarget() const
Methods to handle the saving and restoring of layer data.
SdfLayerHandle getHandle()
get access to the internal layer handle this node represents
Definition: Layer.h:37
void populateSerialisationAttributes()
If the 'hasBeenTheEditTarget' flag is true, this method will copy the contents of the layer this node...
The layer node stores a reference to an SdfLayer.
Definition: Layer.h:20
std::vector< Layer * > getChildLayers()
returns an array of all the child layers connected to this layer (assets essentially) ...
This is a little helper object designed to reduce the amount of boilerplate GUI code you need to jump...
Definition: NodeHelper.h:175