本文整理汇总了C++中MFileObject::setResolveMethod方法的典型用法代码示例。如果您正苦于以下问题:C++ MFileObject::setResolveMethod方法的具体用法?C++ MFileObject::setResolveMethod怎么用?C++ MFileObject::setResolveMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFileObject
的用法示例。
在下文中一共展示了MFileObject::setResolveMethod方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doIt
//.........这里部分代码省略.........
status = argData.getCommandArgument(0, filename);
MString abcNodeName;
if (status == MS::kSuccess)
{
{
MString fileRule, expandName;
MString alembicFileRule = "alembicCache";
MString alembicFilePath = "cache/alembic";
MString queryFileRuleCmd;
queryFileRuleCmd.format("workspace -q -fre \"^1s\"",
alembicFileRule);
MString queryFolderCmd;
queryFolderCmd.format("workspace -en `workspace -q -fre \"^1s\"`",
alembicFileRule);
// query the file rule for alembic cache
MGlobal::executeCommand(queryFileRuleCmd, fileRule);
if (fileRule.length() > 0)
{
// we have alembic file rule, query the folder
MGlobal::executeCommand(queryFolderCmd, expandName);
}
// resolve the expanded file rule
if (expandName.length() == 0)
{
expandName = alembicFilePath;
}
// get the path to the alembic file rule
MFileObject directory;
directory.setRawFullName(expandName);
MString directoryName = directory.resolvedFullName();
// resolve the relative path
MFileObject absoluteFile;
absoluteFile.setRawFullName(filename);
absoluteFile.setResolveMethod(MFileObject::kInputFile);
#if MAYA_API_VERSION < 201300
if (absoluteFile.resolvedFullName() !=
absoluteFile.expandedFullName())
{
#else
if (!MFileObject::isAbsolutePath(filename)) {
#endif
// this is a relative path
MString absoluteFileName = directoryName + "/" + filename;
absoluteFile.setRawFullName(absoluteFileName);
filename = absoluteFile.resolvedFullName();
}
else
{
filename = absoluteFile.resolvedFullName();
}
}
MFileObject fileObj;
status = fileObj.setRawFullName(filename);
if (status == MS::kSuccess && fileObj.exists())
{
ArgData inputData(filename, debugOn, reparentObj,
swap, connectRootNodes, createIfNotFound, removeIfNoUpdate,
recreateColorSets, filterString, excludeFilterString);
abcNodeName = createScene(inputData);
if (inputData.mSequenceStartTime != inputData.mSequenceEndTime &&
inputData.mSequenceStartTime != -DBL_MAX &&
inputData.mSequenceEndTime != DBL_MAX)
{
if (argData.isFlagSet("fitTimeRange"))
{
MTime sec(1.0, MTime::kSeconds);
setPlayback(
inputData.mSequenceStartTime * sec.as(MTime::uiUnit()),
inputData.mSequenceEndTime * sec.as(MTime::uiUnit()) );
}
if (argData.isFlagSet("setToStartFrame"))
{
MTime sec(1.0, MTime::kSeconds);
MGlobal::viewFrame( inputData.mSequenceStartTime *
sec.as(MTime::uiUnit()) );
}
}
}
else
{
MString theError("In AbcImport::doIt(), ");
theError += filename;
theError += MString(" doesn't exist");
printError(theError);
}
}
MPxCommand::setResult(abcNodeName);
return status;
}