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

    How to cancel FileLoad error message.

    Cinema 4D SDK
    2
    3
    721
    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.
    • V
      visualride
      last edited by m_adam

      I have a plugin that I need to use c4d.documents.LoadFile(). I get a pop up question if I load a file with a New XRef that is missing a reference, asking a Yes or No question. Can I answer yes or no in code, or cancel the load if I get an error? I tried using c4d.documents.LoadDocument() but this is causing another xref issue. My Legacy XRefs aren't always keeping their options set and often times all display and on/off options (under the XRef O tab) all turn on. The plugin replaces text in an xref path/filename.

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @visualride first of all welcome in the plugin cafe community.
        Don't worry since it's your first post, but please next time try to follow these rules:

        • Q&A New Functionality.
        • How to Post Questions especially the tagging part.
          I've set up this post correctly, but please for the next ones.

        Regarding your issue, no there is no way with CInema 4D API to control popup.
        Regarding your issue instead of LoadFile you could use [LoadDocument](https://developers.maxon.net/docs/py/2023_2/modules/c4d.documents/index.html?highlight=load#c4d.documents.LoadDocument] with the flag SCENEFILTER_IGNOREXREFS.

        like so:

            path = r"C:\Users\username\Desktop\test.c4d"
            doc = c4d.documents.LoadDocument(path, c4d.SCENEFILTER_IGNOREXREFS | c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS)
            if doc:
                c4d.documents.InsertBaseDocument(doc)
        

        If you have any question, please let me know.
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • V
          visualride
          last edited by

          Thanks for the reply! I'll try that, though I thought that SCENEFILTER_IGNOREXREFS would keep xrefs from being loaded, and since my plugin edits the xref path/name, this would not work. But then again, perhaps I assumed wrong. I appreciate the help! By the way, the idea of classification by tags appears to be a good way to escape the messy folding out tree of classification system that we are all used to. I'll use it next time.

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