Example #1
0
void ShadingNode::setMObject(MObject mobj)
{
	this->mobject = mobj;
	if( this->mobject != MObject::kNullObj)
	{
		this->typeName = getDepNodeTypeName(this->mobject);
		this->fullName = getObjectName(this->mobject);	
	}
}
Example #2
0
void ShadingNode::setMObject(const MObject& mobj)
{
    mobject = mobj;
    if (mobject != MObject::kNullObj)
    {
        typeName = getDepNodeTypeName(mobject);
        fullName = getObjectName(mobject);
    }
}
Example #3
0
void ShadingNode::init(void)
{
	this->mobject = MObject::kNullObj;
	this->nodeState = INVALID;
	if( this->mobject != MObject::kNullObj)
	{
		this->typeName = getDepNodeTypeName(this->mobject);
		this->fullName = getObjectName(this->mobject);	
	}
}
Example #4
0
ShadingNode ShaderDefinitions::findShadingNode(MObject node)
{
	ShadingNode sn;
	MString nodeTypeName = getDepNodeTypeName(node);
	for(size_t nodeId = 0; nodeId < this->shadingNodes.size(); nodeId++)
	{
		//logger.feature(MString("Searching current node type ") + nodeTypeName + " in supported nodes " + this->shadingNodes[nodeId].typeName);
		if( this->shadingNodes[nodeId].typeName == nodeTypeName)
		{
			// copy attributes to the shading node
			sn = this->shadingNodes[nodeId];
			// initialize the shading node with the correct mobject
			sn.setMObject(node);
			break;
		}
	}
	return sn;
}