void ShadingNode::setMObject(MObject mobj) { this->mobject = mobj; if( this->mobject != MObject::kNullObj) { this->typeName = getDepNodeTypeName(this->mobject); this->fullName = getObjectName(this->mobject); } }
void ShadingNode::setMObject(const MObject& mobj) { mobject = mobj; if (mobject != MObject::kNullObj) { typeName = getDepNodeTypeName(mobject); fullName = getObjectName(mobject); } }
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); } }
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; }