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
    • Recent
    • Tags
    • Users
    • Login

    Using C4D Constants in Python

    Scheduled Pinned Locked Moved SDK Help
    8 Posts 0 Posters 687 Views
    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 Offline
      Helper
      last edited by

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

      On 09/09/2010 at 11:11, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   12 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :       PYTHON  ;

      ---------
      Hi all,

      I can't seem to figure out how to use c4d constants in my python code. For example, I want to use the the c4d.documents.SaveDocument function. It has these saveflags:

      SAVEFLAG_SHOWERROR
      _SAVEFLAG_SAVEAS
      _ SAVEFLAG_DONTADDTORECENTLIST
      SAVEFLAG_AUTOSAVE

      _<_dt id="c4d.s.save"_>_I've tried using c4d.SAVEFLAG_SHOWERROR and c4d.documents.SAVEFLAG_SHOWERROR, but those don't work. I can lookup the number that represents these flags in coffeesymbols.h, but obviously I would prefer to use the constant's name instead. 🙂
      I couldn't find any info about this in the python documentation I downloaded from the plugin cafe site, so any help would be appreciated.

      Cheers,
      - Ryan

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

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

        On 09/09/2010 at 11:26, xxxxxxxx wrote:

        Hi Ryan,

        it seems the old constants for SaveDocument are still in the documentation.
        Here are the correct constants:

        SAVEDOCUMENTFLAGS_0
        SAVEDOCUMENTFLAGS_DIALOGSALLOWED
        SAVEDOCUMENTFLAGS_SAVEAS
        SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST
        SAVEDOCUMENTFLAGS_AUTOSAVE
        SAVEDOCUMENTFLAGS_SAVECACHES
        SAVEDOCUMENTFLAGS_EXPORTDIALOG
        

        An update of the documentation will be available soon.

        Cheers, Sebastian

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

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

          On 09/09/2010 at 11:37, xxxxxxxx wrote:

          Thanks for the info! There are a couple others I need at the moment if possible.
           - The SaveDocument function also takes a format flag, and I want to pass FORMAT_C4DEXPORT.
           - The GeDialog.GroupBorder function takes a borderstyle flag, and I want to pass BORDER_THIN_IN.

          I think that's all I need for now.

          Thanks!
           - Ryan

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

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

            On 09/09/2010 at 11:44, xxxxxxxx wrote:

            All constants in Python of R12 are defined in the main module. Also the GroupBorder and SaveDocument constants.

            Cheers, Sebastian

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

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

              On 09/09/2010 at 12:11, xxxxxxxx wrote:

              Ah, cool. Sorry about that, I thought those might have had new names as well.

              Cheers,
              - Ryan

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

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

                On 09/09/2010 at 12:46, xxxxxxxx wrote:

                One more question related to the c4d.documents.SaveDocument function. I noticed that if I pass the active document as a parameter, it saves it just fine, but this isn't reflected in the C4D UI. It appears that I've just saved a copy of the active document, as opposed to saving the actual active document. I hope that made sense. 🙂

                When I used COFFEE in the past, I used the active document's Save function, which accepted a file name, and this seemed to work fine. However, the python docs don't show a similar Save function for the BaseDocument class, which is why I originally used the c4d.documents.SaveDocument function.

                So I guess I have 2 questions:

                1. Is there a Save function for the BaseDocument class that isn't documented?
                2. If not, is there a way to save the actual active document, as opposed to just saving a copy of it?

                Thanks!
                 - Ryan

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

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

                  On 09/09/2010 at 14:11, xxxxxxxx wrote:

                  There is no un-documentated save function. You can simulate the Save-Process by calling CallCommand(saveid), does this help?

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

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

                    On 10/09/2010 at 06:47, xxxxxxxx wrote:

                    That works great! Thanks again for your help.

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