Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Merging files with PLUGINFLAG_SCENELOADER_MERGEORIGINAL

    Cinema 4D SDK
    2025 c++
    2
    3
    533
    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.
    • B
      bojidar
      last edited by bojidar

      Hello,
      We recently noticed that when merging files through our scene file loaders in 2025 the colors on existing materials in the scene were changing. Our loaders just insert some objects/materials in the document we are provided with in ::Load(...) and are registered with PLUGINFLAG_SCENELOADER_MERGEORIGINAL which seems to be the problem. If I remember correctly we use it because of some problems with document scale when merging. Without it everything seems to work and I also noticed that PLUGINFLAG_SCENELOADER_HANDLES_COLOR_MANAGEMENT fixes it. However, I'm a bit confused now.... How do these flags cause the behavior we are seeing and why would other materials in the scene ever change when merging? And are these 2 flags a valid combination?

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @bojidar
        last edited by

        Hey @bojidar,

        Thank you for reaching out to us. Let me preface my answer that I do not have that much time this week. I will try to talk with Fritz when I have a bit more time.

        This flag has been added with 2025.0.1 by Fritz in the wake of the 2025 OCIO changes. I think he added that in the wake of what he did for importing legacy colors, e.g., what has been reflected how colors are handled in NodeData::Init now, there is at least a version control commit description which heavily implies that ('fix loader double conversion').

        2f24d698-3c4c-4c9b-8c31-0e651cb296e0-image.png

        And yes, you can mix that flag with PLUGINFLAG_SCENELOADER_MERGEORIGINAL our own Forger importer does that. The flag is used very rarely in our code base (only three hits). So, it strikes me mostly as a hack/fix for importers that do not yet do a more intricate (OCIO) color management. It looks so that when the flag is set, it will cause the color management settings (partially) being copied from the merged document into the resulting document. For the details I would have to talk with Fritz.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 1
        • ferdinandF
          ferdinand
          last edited by ferdinand

          Hey,

          so I talked with Fritz, I got the direction right, but there are some relevant details. When you set the flag for an importer hook, it signals that you do not want Cinema 4D to carry out the automatic scene color conversion along the conversion path implied in the settings.

          So, when you have a importer, and it does NOT set the flag, and you would import a scene with these settings:

          c3e3d6f8-2734-41d2-abfb-f7af807c12f8-image.png

          Cinema 4D would transform all scene colors from sRGB-2.1 to the Render Space. When you DO set the flag, Cinema 4D will NOT do that, and the importer is expected to handle that.

          So, when you need to set this flag, this implicitly means that something with your scene data is not correct, they are not meant to be sRGB. You can of course also change the respective setting, Raw for example means as always no conversion. Without a bit more details about your scene data and its provenance, it is hard to give here good advice.

          Cheers,
          Ferdinand

          PS: I might update the im/exporter examples at some point to showcase the custom case, but the default should be to NOT to set the flag, and let the intended color management of Cinema 4D do its work.

          MAXON SDK Specialist
          developers.maxon.net

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