本文整理汇总了C++中MFnDependencyNode::typeName方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnDependencyNode::typeName方法的具体用法?C++ MFnDependencyNode::typeName怎么用?C++ MFnDependencyNode::typeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnDependencyNode
的用法示例。
在下文中一共展示了MFnDependencyNode::typeName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dumpInfo
void dumpInfo( MObject fileNode,
MFnDependencyNode& nodeFn,
MObjectArray& nodePath )
{
MObject currentNode;
MObject fileAttr = nodeFn.attribute("fileTextureName");
MPlug plugToFile( fileNode, fileAttr );
MFnDependencyNode dgFn;
MStatus stat;
cerr << "Name: " << nodeFn.name() << endl;
MObject fnameValue;
stat = plugToFile.getValue( fnameValue );
if ( !stat ) {
stat.perror("error getting value from plug");
} else {
MFnStringData stringFn( fnameValue );
cerr << "Texture: " << stringFn.string() << endl;
}
cerr << "Path: ";
for ( int i = nodePath.length()-1; i >= 0; i-- ) {
currentNode = nodePath[i];
dgFn.setObject( currentNode );
cerr << dgFn.name() << "(" << dgFn.typeName() << ")";
if ( i > 0)
cerr << " ->\n ";
}
cerr << endl;
}
示例2: plugHasAnimation
//---------------------------------------------------
bool DagHelper::plugHasAnimation ( const MPlug& plug )
{
MPlugArray connections;
plug.connectedTo ( connections, true, false );
unsigned int connectionsCount = connections.length();
for ( unsigned int i = 0; i < connectionsCount; i++ )
{
MPlug connectedToPlug = connections[i];
MObject nodeObj = connectedToPlug.node();
MFnDependencyNode nodeFn ( nodeObj );
MString typeName = nodeFn.typeName();
if ( ( typeName == "animCurveTU" ) || ( typeName == "animCurveTL" )
|| ( typeName == "animCurveTA" ) )
{
return true;
}
}
return false;
}
示例3: RunScripts
void CScriptedShapeTranslator::RunScripts(AtNode *atNode, unsigned int step, bool update)
{
std::map<std::string, CScriptedTranslator>::iterator translatorIt;
MFnDependencyNode fnNode(GetMayaObject());
translatorIt = gTranslators.find(fnNode.typeName().asChar());
if (translatorIt == gTranslators.end())
{
AiMsgError("[mtoa.scriptedTranslators] No command to export node \"%s\" of type %s.", fnNode.name().asChar(), fnNode.typeName().asChar());
return;
}
MString exportCmd = translatorIt->second.exportCmd;
MString cleanupCmd = translatorIt->second.cleanupCmd;
MFnDagNode node(m_dagPath.node());
bool isMasterDag = false;
bool transformBlur = IsMotionBlurEnabled(MTOA_MBLUR_OBJECT) && IsLocalMotionBlurEnabled();
bool deformBlur = IsMotionBlurEnabled(MTOA_MBLUR_DEFORM) && IsLocalMotionBlurEnabled();
char buffer[64];
MString command = exportCmd;
command += "(";
sprintf(buffer, "%f", GetExportFrame());
command += buffer;
command += ", ";
sprintf(buffer, "%d", step);
command += buffer;
command += ", ";
// current sample frame
sprintf(buffer, "%f", GetSampleFrame(m_session, step));
command += buffer;
command += ", ";
// List of arnold attributes the custom shape export command has overriden
MStringArray attrs;
if (!m_masterNode)
{
command += "(\"" + m_dagPath.partialPathName() + "\", \"";
command += AiNodeGetName(atNode);
command += "\"), None)";
isMasterDag = true;
}
else
{
command += "(\"" + m_dagPath.partialPathName() + "\", \"";
command += AiNodeGetName(atNode);
command += "\"), (\"" + GetMasterInstance().partialPathName() + "\", \"";
command += AiNodeGetName(m_masterNode);
command += "\"))";
}
MStatus status = MGlobal::executePythonCommand(command, attrs);
if (!status)
{
AiMsgError("[mtoa.scriptedTranslators] Failed to export node \"%s\".", node.name().asChar());
return;
}
// Build set of attributes already processed
std::set<std::string> attrsSet;
for (unsigned int i=0; i<attrs.length(); ++i)
{
attrsSet.insert(attrs[i].asChar());
}
std::set<std::string>::iterator attrsEnd = attrsSet.end();
// Should be getting displacement shader from master instance only
// as arnold do not support displacement shader overrides for ginstance
MFnDependencyNode masterShadingEngine;
MFnDependencyNode shadingEngine;
float dispPadding = -AI_BIG;
float dispHeight = 1.0f;
float dispZeroValue = 0.0f;
bool dispAutobump = false;
bool outputDispPadding = false;
bool outputDispHeight = false;
bool outputDispZeroValue = false;
bool outputDispAutobump = false;
const AtNodeEntry *anodeEntry = AiNodeGetNodeEntry(atNode);
GetShapeInstanceShader(m_dagPath, shadingEngine);
if (!IsMasterInstance())
{
GetShapeInstanceShader(GetMasterInstance(), masterShadingEngine);
}
else
{
masterShadingEngine.setObject(shadingEngine.object());
}
AtMatrix matrix;
MMatrix mmatrix = m_dagPath.inclusiveMatrix();
//.........这里部分代码省略.........