int Ss3exp::DoExport(const TCHAR *name,ExpInterface *ei,Interface *i, BOOL suppressPrompts, DWORD options) // Export file { //TODO: Implement the actual file import here and // return TRUE If the file is imported properly if(!suppressPrompts) { if(!DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_PANEL), GetActiveWindow(), Ss3expOptionsDlgProc, (LPARAM)this)) return true; } DWORD start,end; start=timeGetTime(); BEInitLog(NULL,hInstance); log("Export Started ( %d )\n",start); Exporter exporter; RSMObject rsm; exporter.DoExport(name,i,&rsm); log("Model exported.\n"); rsm.Optimize(bVertex); log("Model Optimized.\n"); if(bAnimation) { log("Constructing Animation.\n"); AnimConstructor *ac=new AnimConstructor; ac->BuildAnimation(i,"default",1.0f,bVertex); rsm.AddAnimation(ac); log("Animation built.\n"); } FILE *file=fopen(name,"wb+"); if(!file) return false; rsm.SaveRML(file); rsm.SaveRSM(file); rsm.SaveCameraInfo(file); fputc(bSky ? 1 : 0,file); fclose(file); /* rsm.SaveRML("ss3test.rml"); rsm.SaveRSM("ss3test.rsm"); */ end=timeGetTime(); log("Export Ended ( %d ) %d seconds elapsed \n",end, (end-start)/1000); BECloseLog(); return true; }
void BatchExporter::Do(HWND hWnd) { BEWorkSheet_SetFileName(rbefile); if(BEWorkSheet_Work(hWnd)==BEWORKSHEET_OK) { BECommandList *pCommandList=BEWorkSheet_GetCommandList(); BEInitLog(hWnd); log("starting batch processing containing %d works.\n",pCommandList->GetCount()); DoBatchExport(ip,hWnd,BEWorkSheet_GetCommandList()); strcpy(rbefile,BEWorkSheet_GetFileName()); WriteConfig(); log("Done."); BECloseLog(); } }