//----------------------------------------------------------------------------- // Saves an SFM file //----------------------------------------------------------------------------- void CSFMGenApp::SaveSFMFile( CDmElement *pRoot, const char *pOutputDir, const char *pFileName ) { // Construct actual file name from the model name + dmx file name char pFullPathBuf[MAX_PATH]; Q_snprintf( pFullPathBuf, sizeof(pFullPathBuf), "%s/%s.dmx", pOutputDir, pFileName ); const char *pFullPath = pFullPathBuf; CP4AutoEditAddFile checkout( pFullPath ); if ( !g_pDataModel->SaveToFile( pFullPath, NULL, g_pDataModel->GetDefaultEncoding( "sfm_session" ), "sfm_session", pRoot ) ) { Warning( "sfmgen: Unable to write file %s\n", pFullPath ); return; } Msg( "sfmgen: Wrote file %s\n", pFullPath ); }