当前位置: 首页>>代码示例>>C++>>正文


C++ MFileObject::name方法代码示例

本文整理汇总了C++中MFileObject::name方法的典型用法代码示例。如果您正苦于以下问题:C++ MFileObject::name方法的具体用法?C++ MFileObject::name怎么用?C++ MFileObject::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MFileObject的用法示例。


在下文中一共展示了MFileObject::name方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: identifyFile

// *****************************************************************************
MPxFileTranslator::MFileKind GtoIO::identifyFile( const MFileObject &file,
                                                  const char *magic,
                                                  short magicSize ) const
{
    if( magicSize < 4 )
    {
        return MPxFileTranslator::kNotMyFileType;
    }

    const unsigned int magicInt = *((unsigned int *)magic );
    if( magicInt == Gto::Header::Magic
        || magicInt == Gto::Header::Cigam )
    {
        return MPxFileTranslator::kIsMyFileType;
    }

    const char gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
    if( magic[0] == gz_magic[0] && magic[1] == gz_magic[1] )
    {
        if( strstr( file.name().asChar(), ".gto" ) )
        {
            return MPxFileTranslator::kIsMyFileType;
        }
    }

    return MPxFileTranslator::kNotMyFileType;
}
开发者ID:AtomicFiction,项目名称:open-gto,代码行数:28,代码来源:GtoIO.cpp

示例2: identifyFile

MPxFileTranslator::MFileKind NifTranslator::identifyFile(const MFileObject& fileName, const char* buffer, short size) const
{
	MString fName = fileName.name();
	if (fName.toUpperCase() != "NIF" && fName.toUpperCase() != "KF")
		return kNotMyFileType;

	return kIsMyFileType;
}
开发者ID:Alecu100,项目名称:maya_nif_plugin,代码行数:8,代码来源:NifTranslator.cpp

示例3: identifyFile

MPxFileTranslator::MFileKind metro_model_translator::identifyFile(const MFileObject &file, const char *buffer, short size) const
{
	MString name = file.name();
	MString ext = name.substring( name.rindex( '.' ), name.length() ).toLowerCase();
	if( ext != MString( ".model" ) )
		return MPxFileTranslator::kNotMyFileType;

	return MPxFileTranslator::kIsMyFileType;
}
开发者ID:CakeZCanaaN,项目名称:metro2033-tools,代码行数:9,代码来源:metro_model_translator.cpp

示例4: identifyFile

MPxFileTranslator::MFileKind DCTranslator::identifyFile(
	const MFileObject &fileName, const char *, short) const
{
	const char * name = fileName.name().asChar();
	size_t   nameLength = strlen(name);

	if ((nameLength > 14) && !_stricmp(name + nameLength - 7, MAYA_TRANSLATOR_EXT))
		return kCouldBeMyFileType;
	else
		return kNotMyFileType;
}
开发者ID:gitter-badger,项目名称:kaleido3d,代码行数:11,代码来源:DCTranslator.cpp

示例5: identifyFile

    MPxFileTranslator::MFileKind FileTranslator::identifyFile ( 
        const MFileObject &fileObject,
        const char *buffer,
        short size )
    const
    {
        // Just check for the proper extension for now
        MFileKind rval = kNotMyFileType;
        int extLocation = fileObject.name().rindex ( '.' );

        if ( extLocation > 0 )
        {
            MString ext = fileObject.name().substring ( extLocation + 1, fileObject.name().length()-1 ).toLowerCase();
            if ( ext == "dae" || ext == "xml" )
            {
                rval = kIsMyFileType;
            }
        }

        return rval;
    }
开发者ID:juricast,项目名称:OpenCOLLADA,代码行数:21,代码来源:COLLADAMayaFileTranslator.cpp

示例6: identifyFile

MPxFileTranslator::MFileKind ObjTranslator::identifyFile (
                                        const MFileObject& fileName,
                                        const char* buffer,
                                        short size) const
{
    const char * name = fileName.name().asChar();
    int   nameLength = strlen(name);
    
    if ((nameLength > 4) && !strcasecmp(name+nameLength-4, ".dae"))
        return kCouldBeMyFileType;
    else
        return kNotMyFileType;
}
开发者ID:Belxjander,项目名称:Asuna,代码行数:13,代码来源:colladaExport.cpp

示例7: identifyFile

MPxFileTranslator::MFileKind CXRayCameraExport::identifyFile (
                                        const MFileObject& fileName,
                                        const char* buffer,
                                        short size) const
{
    const char * name = fileName.name().asChar();
    int   nameLength = xr_strlen(name);
    
	if ((nameLength > 4) && !stricmp(name+nameLength-4, ".anm"))
        return kCouldBeMyFileType;
    else
        return kNotMyFileType;
}
开发者ID:2asoft,项目名称:xray,代码行数:13,代码来源:maTranslator.cpp

示例8: identifyFile

MPxFileTranslator::MFileKind atomExport::identifyFile(
								const MFileObject& fileName,
								const char* buffer,
								short size) const
{
	const char *name = fileName.name().asChar();
	int   nameLength = (int)strlen(name);

	if ((nameLength > 5) && !strcasecmp(name+nameLength-5, ".atom")) {
		return kIsMyFileType;
	}

	return	kNotMyFileType;
}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:14,代码来源:atomImportExport.cpp

示例9: identifyFile

OSGFileTranslator::MFileKind OSGFileTranslator::identifyFile (const MFileObject &file, const char *buffer, short size) const
{
    std::string filename = file.name().asChar();
    if ( filename.substr( filename.size()-4, 4 ).compare(".osg") )
        return kIsMyFileType;
    else if ( filename.substr( filename.size()-4, 4 ).compare(".ive") )
        return kIsMyFileType;
    else if ( filename.substr( filename.size()-5, 5 ).compare(".osgt") )
        return kIsMyFileType;
    else if ( filename.substr( filename.size()-5, 5 ).compare(".osgb") )
        return kIsMyFileType;
    else if ( filename.substr( filename.size()-5, 5 ).compare(".osgx") )
        return kIsMyFileType;

    return kNotMyFileType;       
}
开发者ID:rpavlik,项目名称:maya2osg,代码行数:16,代码来源:osgfiletranslator.cpp

示例10: PathFindExtensionA

MPxFileTranslator::MFileKind 
XFileTranslator::identifyFile(	
	const MFileObject& fileName,
	const char* buffer,
	short size) const
{ 
    LPSTR extension = PathFindExtensionA(fileName.name().asChar());
    if(0==lstrcmpA(extension, ".x"))
	{
		return kIsMyFileType;
	}
	else
	{
		return kNotMyFileType; 
	}
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:16,代码来源:FileTranslator.cpp

示例11: identifyFile

//
// Maya calls this method to find out if this translator is capable of
// handling the given file.
//
MPxFileTranslator::MFileKind maTranslator::identifyFile(
		const MFileObject& file, const char* buffer, short bufferLen
) const
{
	MString	tagStr = comment(fTranslatorName);
	int		tagLen = tagStr.length();

	//
	// If the buffer contains enough info to positively identify the file,
	// then use it.  Otherwise we'll base the identification on the file
	// extension.
	//
	if (bufferLen >= tagLen)
	{
		MString	initialContents(buffer, bufferLen);
		MStringArray	initialLines;

		initialContents.split('\n', initialLines);

		if (initialLines.length() > 0)
		{
			if (((int)initialLines[0].length() >= tagLen)
			&&	(initialLines[0].substring(0, tagLen-1) == tagStr))
			{
				return kIsMyFileType;
			}
		}
	}
	else
	{
		MString	fileName(file.name());
		int		fileNameLen = fileName.length();
		int		startOfExtension = fileName.rindex('.') + 1;

		if ((startOfExtension > 0)
		&&	(startOfExtension < fileNameLen)
		&&	(fileName.substring(startOfExtension, fileNameLen) == fExtension))
		{
			return kIsMyFileType;
		}
	}

	return kNotMyFileType;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:48,代码来源:maTranslator.cpp

示例12: identifyFile

MPxFileTranslator::MFileKind CVsDmxIOTranslator::identifyFile(
	const MFileObject &i_mFileObject,
	const char * /* i_buffer */,
	const short /* i_size */ ) const
{
	MFileKind retVal( kNotMyFileType );

	const MString &name( i_mFileObject.name() );

	if ( name.length() )
	{
		if ( name.substring( name.rindex( '.' ) + 1, name.length() - 1 ) == MString( "dmx" ) )
		{
			retVal = kIsMyFileType;
		}
	}

	return retVal;
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:19,代码来源:CVsDmxIOTranslator.cpp

示例13: warning

// Write method of the GE2.0 translator / file exporter
MStatus ge2Translator::writer ( const MFileObject & fileObject,
								  const MString & options,
								  MPxFileTranslator::FileAccessMode mode)
{
	char            LTmpStr[MAXPATHLEN];
	unsigned int	i,
					LN;

	// const MString   fname = fileObject.fullName ();
	MString         extension;
	MString         baseFileName;


	// Lets strip off the known extension of .grp if it is there.
	extension.set (".grp");
	int  extLocation = fileObject.name ().rindex ('.');

	if ( (extLocation != -1) && // no '.' in name
		 (extLocation != 0) && // name was ".grp" -- that's ok??
		 (fileObject.name ().substring (extLocation, fileObject.name ().length () - 1) == extension) )
	{
		baseFileName = fileObject.name ().substring (0, extLocation - 1);
	} else
	{
		baseFileName = fileObject.name ();
		extension.clear ();
	}

	geWrapper.setBaseFileName( baseFileName );
	geWrapper.setPathName( fileObject.fullName() );

	geWrapper.pluginVersion = version;

	// Set the directory at the Dt level
	strncpy( LTmpStr, geWrapper.getPathName().asChar(), MAXPATHLEN );
	LN = (int)strlen( LTmpStr );
	if ( LTmpStr[LN - 1] == '/' )
		LTmpStr[LN - 1] = '\0';
	DtSetDirectory( LTmpStr );	

	// in an ideal world, everything in setDefaults() should be overridden
	// with the option parsing. If the mel script doesn't get run for whatever
	// reason, or neglects to return some values, hopefully setDefaults will
	// enable the export to go through anyway
	geWrapper.setDefaults();

// Turn off this pesky warning on NT - performance warning
// for int -> bool conversion.
#ifdef WIN32
#pragma warning ( disable : 4800 )
#endif

	// Lets now do all of the option processing	
	if ( options.length () > 0 )
	{
		//Start parsing.

		MStringArray optionList;
		MStringArray    theOption;

		options.split(';', optionList);

		//break out all the options.

		for ( i = 0; i < optionList.length (); ++i )
		{
			theOption.clear ();
			optionList[i].split( '=', theOption );
			if ( theOption.length () > 1 )
			{
				if ( theOption[0] == MString( "enableAnim" ) )
				{
					geWrapper.enableAnim = (bool) ( theOption[1].asInt() );
				}  else if ( theOption[0] == MString( "animStart" ) )
				{
					geWrapper.frameStart = (int) ( theOption[1].asInt() );
				} else if ( theOption[0] == MString( "animEnd" ) )
				{
					geWrapper.frameEnd = (int) ( theOption[1].asInt() );
				} else if ( theOption[0] == MString( "animStep" ) )
				{
					geWrapper.frameStep = (int) ( theOption[1].asInt() );
				} else if ( theOption[0] == MString( "animVertices" ) )
				{
					geWrapper.animVertices = (bool) ( theOption[1].asInt() );
				} else if ( theOption[0] == MString( "animDisplacement" ) )
				{
					if ( theOption[1].asInt() == 1 )
						geWrapper.vertexDisplacement = ge2Wrapper::kVDRelative;
					else
						geWrapper.vertexDisplacement = ge2Wrapper::kVDAbsolute;
				} else if ( theOption[0] == MString( "animTransforms" ) )
				{
					geWrapper.animTransforms = (bool) ( theOption[1].asInt() );
				} else if ( theOption[0] == MString( "animShaders" ) )
				{
					geWrapper.animShaders = (bool) ( theOption[1].asInt() );
				} else if ( theOption[0] == MString( "animLights" ) )
				{
//.........这里部分代码省略.........
开发者ID:DimondTheCat,项目名称:xray,代码行数:101,代码来源:ge2Translator.cpp

示例14: writer

//
// Maya calls this method to have the translator write out a file.
//
MStatus maTranslator::writer(
		const MFileObject& file,
		const MString& /* options */,
		MPxFileTranslator::FileAccessMode mode
)
{
	//
	// For simplicity, we only do full saves/exports.
	//
	if ((mode != kSaveAccessMode) && (mode != kExportAccessMode))
	   	return MS::kNotImplemented;

	//
	// Let's see if we can open the output file.
	//
	fstream	output(file.fullName().asChar(), ios::out | ios::trunc);

	if (!output.good()) return MS::kNotFound;

	//
	// Get some node flags to keep track of those nodes for which we
	// have already done various stages of processing.
	//
	MStatus	status;

	fCreateFlag = MFnDependencyNode::allocateFlag(fPluginName, &status);

	if (status)
		fAttrFlag = MFnDependencyNode::allocateFlag(fPluginName, &status);

	if (status)
		fConnectionFlag = MFnDependencyNode::allocateFlag(fPluginName, &status);

	if (!status)
	{
		MGlobal::displayError(
			"Could not allocate three free node flags."
			"  Try unloading some other plugins."
		);

		return MS::kFailure;
	}

	//
	// Run through all of the nodes in the scene and clear their flags.
	//
	MItDependencyNodes	nodesIter;

	for (; !nodesIter.isDone(); nodesIter.next())
	{
		MObject				node = nodesIter.item();
		MFnDependencyNode	nodeFn(node);

		nodeFn.setFlag(fCreateFlag, false);
		nodeFn.setFlag(fAttrFlag, false);
		nodeFn.setFlag(fConnectionFlag, false);
	}

	//
	// Write out the various sections of the file.
	//
	writeHeader(output, file.name());
	writeFileInfo(output);
	writeReferences(output);
	writeRequirements(output);
	writeUnits(output);
	writeDagNodes(output);
	writeNonDagNodes(output);
	writeDefaultNodes(output);
	writeReferenceNodes(output);
	writeConnections(output);
	writeFooter(output, file.name());

	output.close();

	MFnDependencyNode::deallocateFlag(fPluginName, fCreateFlag);

	return MS::kSuccess;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:82,代码来源:maTranslator.cpp

示例15: writer

MStatus rtgTranslator::writer ( const MFileObject & fileObject,
								  const MString & options,
								  MPxFileTranslator::FileAccessMode mode)
{
	char            LTmpStr[MAXPATHLEN];
	unsigned int	i;
	int             LN;

	const MString   fname = fileObject.fullName ();
	MString         extension;
	MString         baseFileName;

    int             TimeSlider = 0;
    int             AnimEnabled = 0;


	// Lets strip off the known extension of .rtg if it is there.
	
	extension.set (".rtg");
	int  extLocation = fileObject.name ().rindex ('.');

	if (extLocation > 0 && fileObject.name ().substring (extLocation,
			     fileObject.name ().length () - 1) == extension)
	{
		baseFileName = fileObject.name ().substring (0, extLocation - 1);
	} else
	{
		baseFileName = fileObject.name ();
		extension.clear ();
	}


    DtExt_SceneInit( (char *)baseFileName.asChar() );
	
	// Lets now do all of the option processing
	
	if (options.length () > 0)
	{
		//Start parsing.

		MStringArray optionList;
		MStringArray    theOption;

		options.split (';', optionList);

		//break out all the options.

		for ( i = 0; i < optionList.length (); ++i)
		{
			theOption.clear ();
			optionList[i].split ('=', theOption);
			if (theOption.length () > 1)
			{
				if (theOption[0] == MString ("v18compatible"))
				{
					rtg_v18_compatible = (int) (theOption[1].asInt() );
					
				} else if (theOption[0] == MString ("timeslider"))
				{
					TimeSlider = (int) (theOption[1].asInt ());
                } else if (theOption[0] == MString ("animEnabled"))
                {
                    AnimEnabled = (int) (theOption[1].asInt ());

				} else if (theOption[0] == MString ("animStart"))
				{
                    DtFrameSetStart( (int) (theOption[1].asInt ()) );

				} else if (theOption[0] == MString ("animEnd"))
				{
                    DtFrameSetEnd( (int) (theOption[1].asInt ()) );

				} else if (theOption[0] == MString ("animStep"))
				{
                    DtFrameSetBy( (int) (theOption[1].asInt ()) );

				} else if (theOption[0] == MString ("hrcType"))
				{
                    switch ( theOption[1].asInt () - 1)
                    {
                        case VRHRC_FLAT:
                            DtExt_setOutputTransforms (kTRANSFORMMINIMAL);
                            DtExt_setParents (0);
                            break;
                            
                        case VRHRC_WORLD:
                            DtExt_setOutputTransforms (kTRANSFORMNONE);
                            DtExt_setParents (0);
                            break;
                            
                        case VRHRC_FULL:
                        default:
                            DtExt_setOutputTransforms (kTRANSFORMALL);
                            DtExt_setParents (1);
                            break;
                    }       

                } else if (theOption[0] == MString ("joints"))
                { 
                    // Allow user to specify if the hierarchy should include
//.........这里部分代码省略.........
开发者ID:DimondTheCat,项目名称:xray,代码行数:101,代码来源:rtgTranslator.cpp


注:本文中的MFileObject::name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。