THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/10/2010 at 12:26, xxxxxxxx wrote:
Cinema 4D Version: R12
Platform: Windows ;
Language(s) : C++ ;
Is there a writing example of using the Melange library? There are some bits and pieces in the commandline example,
but it's not enough. I'm looking for an complete example that fills empty document and writes it out?
Preferably, an example that uses joints.
On 22/11/2010 at 02:27, xxxxxxxx wrote:
the commandline example includes a complete example how to create and export a scene with melange sdk. the LoadSaveC4DScene() has a part of source code where where CreateSceneToC4D() is used. comment in the part after "// ... or save new created scene" of the example code (and comment out the part before where BaseDocument::CopyTo() is used intstead).
the function CreateSceneToC4D() calls the functions:
BuildObjectsToC4D() -> CreateObjectToC4D
CreateObjectToC4D() shows the creation of polygon, null, camera, light and a few other objects. the creation of joints is not included yet.
here's a short example how to add a skin object, 2 joint objects and the weight tag to a document:
BaseDocument *newDoc = BaseDocument::Alloc();
// create and add polygon object here
BaseObject *mObj = BaseObject::Alloc(Opolygon);
// add points and polygons...
BaseTag *wTag = NULL;
wTag = mObj->MakeTag(Tweights);
// add skin object
BaseObject *sObj = BaseObject::Alloc(Oskin);
// add null object
BaseObject *nObj = BaseObject::Alloc(Onull);
nObj->SetRelPos( Vector(0.0,-400.0,0.0) );
// add 2 joint objects
BaseObject *jObj1 = BaseObject::Alloc(Ojoint);
jObj1->SetRelPos( Vector(0.0,0.0,0.0) );
BaseObject* jObj2 = BaseObject::Alloc(Ojoint);
jObj2->SetRelPos( Vector(0.0,450.0,0.0) );
if (wTag && jObj1 && jObj2)
// save the document and free the objects
On 22/11/2010 at 15:06, xxxxxxxx wrote: