On 23/05/2013 at 14:00, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R12+
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
I'm having problems (**sometimes** ) getting a document completely updated/polygonized for export...
The basic idea - for an animated export (multiple .obj files, or a .mdd cache file) - is:
- Animate the scene to the next frame to be exported.
- Polygonize the document - resolving any 'Primitive' objects to polygonal mesh form, as well as resolving any Deformer modifications.
- Export current polygonized scene.
- Wash, rinse, repeat until all animation frames have been exported.
...to animate the scene, I'm calling one of my 'compatibility' routines...
//-------------------------------------------------------------
// cmpAnimateDocument()
//-------------------------------------------------------------
void cmpAnimateDocument(BaseDocument *pDoc, const BaseTime& frameTime)
{
// StopAllThreads();
pDoc->SetTime(frameTime);
#ifdef _R12_SDK_
pDoc->ExecutePasses(NULL, TRUE, TRUE, TRUE, BUILDFLAGS_0);
#elif _R11p5_SDK_
pDoc->ExecutePasses(NULL, TRUE, TRUE, TRUE);
#else
pDoc->AnimateDocument(NULL, TRUE, TRUE);
#endif
EventAdd();
#ifdef _R12_SDK_
DrawViews(DRAWFLAGS_FORCEFULLREDRAW | DRAWFLAGS_NO_THREAD, NULL); // force completion of cache rebuild
#elif _R10p1_SDK_
DrawViews(DA_FORCEFULLREDRAW | DA_NO_THREAD, NULL);
#else
DrawViews(DA_FORCEFULLREDRAW);
#endif
}
...after which, I typically call:
pDoc = pBaseDoc->Polygonize()
...to get the scene in polygonal mesh form, for exporting.
The problem I'm (sometimes) seeing seems to be related to MoGraph objects in the scene and/or things like Text primitives.
In order for these to animate/polygonize/export correctly, the user has to manually "Make Editable", or even "Current State to Object" before exporting - which is a hassle, if they still want to maintain the Primitive form of those items.
I've even been able to manually 'adjust the hierarchy order' in the Object Manager to fix the export in some cases (when it seemed to be some 'priority' issue).
Does anyone know what I'm doing wrong or missing?
Thanks,
Keith