c.o.f.f.e.e. help!



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 11/12/2006 at 04:05, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   9.6 
    Platform:      
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    Hello!
    I've got a question:
    I've got the following code:

    var file = new(Filename);
    file=GeGetRootFilename();
    file->RemoveLast();
    file->AddLast("objekt.c4d");
    LoadDocument(file);
    var currentObject = GetActiveObject(doc);
    var clone;
    clone=currentObject->GetClone(CL_NO_HIERARCHY);
    var actdoc=GetActiveDocument();
    actdoc->InsertObject(clone,NULL,NULL);
    //KillDocument();
    EventAdd(DOCUMENT_CHANGED);

    I would like to load "objekt.c4d" into my actual scene.
    But in this case cinema opens a new scene called "objekt.c4d". That's not what I want. Cinema should insert the object from "objekt.c4d" to my actual scene, and not open a new one.
    Shouldn't it work with "KillDocument();". I cannot find the function in SDK 9.5.
    Could anybody helf me?
    Thanks a lot!



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 11/12/2006 at 06:42, xxxxxxxx wrote:

    Afaik! not possible in COFFEE. Sorry, only via C++.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 11/12/2006 at 06:44, xxxxxxxx wrote:

    As a workaround I would suggest this.

    1. Load the document
    2. Copy the objects and materials
    3. Insert them into your already opened scene
    4. Close the loaded document

    There doesn´t seem to be another way imo.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 11/12/2006 at 06:45, xxxxxxxx wrote:

    You would have to copy-paste the object from the document opened with LoadDocument. You can step through open documents with GetNext/GetPrev. It's not actually fun to do with COFFEE, the C++ API is much easier to use in this regard.

    cheers,
    Matthias


Log in to reply