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
    • Register
    • Register
    • Login
    1. Maxon Developers Forum
    2. Aeoll 0
    3. Posts
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by Aeoll 0

    • c4d.documents.SaveProject() preventing future save commands

      C4D 2023

      I am using the method in a custom script as follows:

      c4d.documents.SaveProject(doc, c4d.SAVEPROJECT_SCENEFILE | 
      c4d.SAVEPROJECT_ASSETS | 
      c4d.SAVEPROJECT_USEDOCUMENTNAMEASFILENAME,
      self.filedir,
                  [],
                  [],
              )
      

      When using this to save an open project to a different directory, the newly saved project file (which remains open in C4D) locks up and the user can no longer save the open project with Ctrl+S or File>Save Project.

      An error dialog pops up showing:

      Unable to write file "FILENAME" (file may be write protected)
      

      There are no additional errors in the Console.

      Any ideas? This is a blocker on our current pipeline.

      posted in Cinema 4D SDK 2023 python
      A
      Aeoll 0
    • RE: Saving Documents

      Hi Ilia,

      Thanks for the reply - you're correct about what I'm trying to do!

      I've tried your first option and unfortunately the following dialog pops up:

      "Unable to write file $FILE$ (file may be write protected)"
      

      This dialog does not appear if the file is saved manually with the File -> Save Project As... Dialog

      The save location is a network drive. Let me know if theres a workaround?

      For your second option - is it possible to specify the exact filename here?

      EDIT: It looks like you can also specify a filename here, which has worked - thanks !

      posted in Cinema 4D SDK
      A
      Aeoll 0
    • Saving Documents

      From what I can see

      c4d.documents.SaveDocument()
      

      Does not work as expected - saving the active document to the given filepath and keeping the active document open under that "new" name/filepath.

      It saves the document to disk at the given path and you must then load that new document from scratch and kill the previous one?

      c4d.documents.SaveDocument(filepath)
      c4d.documents.LoadFile(filepath)
      c4d.documents.KillDocument(doc) # close the previous doc
      

      Is this correct?

      If you have a heavy file and are saving to a network location with python, every 'save as' action means reloading the entire scene from disk, which can be pretty slow/inefficient?

      Is there a better method?

      Thanks

      posted in Cinema 4D SDK python 2023
      A
      Aeoll 0