本文整理汇总了C++中MFnDagNode::setDoNotWrite方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnDagNode::setDoNotWrite方法的具体用法?C++ MFnDagNode::setDoNotWrite怎么用?C++ MFnDagNode::setDoNotWrite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnDagNode
的用法示例。
在下文中一共展示了MFnDagNode::setDoNotWrite方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
std::pair< EntityNode*, EntityInstanceNode*> EntityNode::CreateInstance( const Asset::EntityInstancePtr& entity )
{
EntityNode* artClass = &Get( entity->GetEntity()->GetPath() );
M_EntityNode::iterator instItor = artClass->m_Instances.find( entity->m_ID );
EntityInstanceNode* entityNode = NULL;
if( instItor == artClass->m_Instances.end() )
{
MFnDagNode nodeFn;
MObject instanceObject = nodeFn.create( EntityInstanceNode::s_TypeID, entity->GetName().c_str() );
nodeFn.setDoNotWrite( true );
entityNode = static_cast< EntityInstanceNode* >( nodeFn.userNode() );
artClass->m_Instances[ entity->m_ID ] = entityNode;
entityNode->SetBackingEntity( entity );
entityNode->Show( *artClass );
}
else
{
entityNode = instItor->second;
entityNode->SetBackingEntity( entity );
}
return std::pair< EntityNode*, EntityInstanceNode* >( artClass, entityNode );
}
示例2: if
EntityNode& EntityNode::Get( const Helium::Path& path, bool createIfNotExisting )
{
MFnDagNode dagFn;
try
{
M_IdClassTransform::iterator findItor = s_ClassTransformsMap.find( path.Hash() );
if( findItor != s_ClassTransformsMap.end() )
{
return *findItor->second;
}
else if ( createIfNotExisting )
{
// we couldn't find it, so create it and return the loaded art class
Asset::AssetClassPtr assetClass = Asset::AssetClass::LoadAssetClass( path );
if ( assetClass.ReferencesObject() )
{
tstring artFilePath = assetClass->GetPath().Get();
MObject classTransform = dagFn.create( EntityNode::s_TypeID, assetClass->GetShortName().c_str() );
dagFn.setDoNotWrite( true );
EntityNode* artClass = static_cast<EntityNode*>( dagFn.userNode() );
artClass->m_AssetPath = path;
artClass->SetArtFilePath( artFilePath.c_str() );
s_ClassTransformsMap[ path.Hash() ] = artClass;
artClass->LoadArt();
return *artClass;
}
}
}
catch (Helium::Exception& )
{
if ( createIfNotExisting )
{
MGlobal::displayError( MString("Unable to create EntityNode!") );
}
}
return EntityNode::Null;
}