Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    SceneLoaderData merge [SOLVED]

    SDK Help
    0
    3
    301
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 19/01/2016 at 07:51, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R16+ 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      My latest plugin does import/export.  Export works flawlessly.  Import is a bit more troublesome since it must be 'merged' with the active document.

      For registration, this is the setup:

      return RegisterSceneLoaderPlugin(ID_IMEXANIM_SCENELOADER, "ImExAnim (*.iea)", PLUGINFLAG_SCENELOADER_MERGEORIGINAL, ImportAnim::Alloc, "Fimportanim", "iea");
      

      And the filter:

      if (!(filterflags & SCENEFILTER_MERGESCENE))
      		return FILEERROR_NONE;
      

      No matter what filters I check on Load(), if I use "Open...", it creates a new document (or fails as an Unknown File Format).  Must one use "Merge..." to get the active document for importing information into the active document?  The documentation and examples do not explain.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 20/01/2016 at 07:24, xxxxxxxx wrote:

        Hi Robert,

        The Cinema 4D documentation states for the Open and Merge commands:

        Open: "This command loads a file (a scene, a material, etc.) from a storage device (such as a hard disk) into memory and opens it in a new project window. If the current project window is empty, this is used instead."

        Merge: "This command lets you add scenes, objects, materials, etc. to the active project."

        So it's not possible to merge a file with the Open command as it creates a new document for the loaded file.
        And yes, the Merge command has to be used to import a file into the active document.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 20/01/2016 at 10:48, xxxxxxxx wrote:

          Good to know.  This way I can instruct users on how to use the import properly.  You can call this solved. 🙂

          1 Reply Last reply Reply Quote 0
          • First post
            Last post