本文整理汇总了C++中MFileObject::expandedFullName方法的典型用法代码示例。如果您正苦于以下问题:C++ MFileObject::expandedFullName方法的具体用法?C++ MFileObject::expandedFullName怎么用?C++ MFileObject::expandedFullName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFileObject
的用法示例。
在下文中一共展示了MFileObject::expandedFullName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reader
MStatus metro_model_translator::reader(const MFileObject &file, const MString &optionsString, FileAccessMode mode)
{
m2033::file_system fs;
m2033::model model;
bool res = MStatus::kFailure;
fs.set_root_from_fname( file.expandedFullName().asChar() );
res = model.load( file.expandedFullName().asChar() );
if( !res ) {
return MStatus::kFailure;
}
return read( model );
}
示例2: writer
MStatus OSGFileTranslator::writer( const MFileObject &file, const MString &optionsString,
MPxFileTranslator::FileAccessMode mode )
{
// Set Config ExportSelection Attribute
if ( ( mode == MPxFileTranslator::kExportAccessMode ) || ( mode == MPxFileTranslator::kSaveAccessMode ) )
Config::instance()->setExportSelection( false ) ;
else if( mode == MPxFileTranslator::kExportActiveAccessMode )
Config::instance()->setExportSelection( true ) ;
// the first character in the optinsString is a ";", so get rid of it with substring
MString options = optionsString.substring( 1 , optionsString.length() -1 ) ;
MStringArray argStringArray ;
std::cout << optionsString.asChar() ;
// split the String with " " to get and option Array
MStatus status = options.split( ' ' , argStringArray ) ;
OSGWrite::parseArgs( argStringArray ) ;
OSGWrite::exporta( file.expandedFullName() ) ;
return MStatus::kSuccess;
}
示例3: 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;
}
示例4: doIt
//.........这里部分代码省略.........
// save the workspace. maya may discard file rules on exit
MGlobal::executeCommand("workspace -s");
// 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();
// make sure the cache folder exists
if (!directory.exists())
{
// create the cache folder
MString createFolderCmd;
createFolderCmd.format("sysFile -md \"^1s\"", directoryName);
MGlobal::executeCommand(createFolderCmd);
}
// resolve the relative path
MFileObject absoluteFile;
absoluteFile.setRawFullName(fileName.c_str());
#if MAYA_API_VERSION < 201300
if (absoluteFile.resolvedFullName() !=
absoluteFile.expandedFullName())
{
#else
if (!MFileObject::isAbsolutePath(fileName.c_str())) {
#endif
// this is a relative path
MString absoluteFileName = directoryName + "/" +
fileName.c_str();
absoluteFile.setRawFullName(absoluteFileName);
fileName = absoluteFile.resolvedFullName().asChar();
}
else
{
fileName = absoluteFile.resolvedFullName().asChar();
}
// check the path must exist before writing
MFileObject absoluteFilePath;
absoluteFilePath.setRawFullName(absoluteFile.path());
if (!absoluteFilePath.exists()) {
MString error;
error.format("Path ^1s does not exist!", absoluteFilePath.resolvedFullName());
MGlobal::displayError(error);
return MS::kFailure;
}
// check the file is used by any AlembicNode in the scene
MItDependencyNodes dgIter(MFn::kPluginDependNode);
for (; !dgIter.isDone(); dgIter.next()) {
MFnDependencyNode alembicNode(dgIter.thisNode());
if (alembicNode.typeName() != "AlembicNode") {
continue;
}