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

    [SOLVED]LoadDialog / SaveDialog prefilled filename

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 563 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

      On 25/01/2017 at 08:03, xxxxxxxx wrote:

      Is there a way for set the default filename for a loadDialog or a saveDialog ?

      By reading hte sdk and doing some test it's look like not but maybe I missunderstand something.

      If not it will be a nice feature to have.

      Thansk in advance 🙂

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

        On 26/01/2017 at 06:19, xxxxxxxx wrote:

        Hi,

        unfortunately not, currently. This is a current limitation of the Python implementation. I filed a feature request.

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

          On 26/01/2017 at 06:47, xxxxxxxx wrote:

          Thanks for the answer.
          Moreover is their a working solution in C++? I was not able to find the equivalent c++ class of the storage python module.

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

            On 26/01/2017 at 07:33, xxxxxxxx wrote:

            Yes, there is. It's in the Filename class the FileSelect function. You just need to set the different parts of a Filename (SetDirectory() and SetFile()) to get the desired result.

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

              On 01/02/2017 at 00:59, xxxxxxxx wrote:

              As a workaround I coded an small application in autoit (windows only but it's not important since mac os FileDialog don't have a filename field).
              So basicly my autoit code wait a specific windows. And when it find it it write the argument into the name field.
              It's not the proper way but it's working.

              Here my autoit code -you can find information about compiling and more here => https://www.autoitscript.com/site/autoit/

              AutoItSetOption("SendKeyDelay",0)
              AutoItSetOption("SendKeyDownDelay",0)
                
              ;#Wait 100000s a windows named Texture Manager Replace
              If WinWait("My unique UI name Replacer", "", 100000) Then
              	;Send arguments to this windows in EDIT1 field (fieldname)
              	ControlSend("Texture Manager Replace", "", "Edit1", $CmdLineRaw)
              EndIf
              

              And here my python I used subprocess since c4d.storage.GeExecute don't seem to allow arguments

              import subprocess
              import platform
                
              if platform.system() == "Windows":
                  dir, file = os.path.split(__file__)
                  subprocess.Popen([os.path.join(dir, "writter.exe"), "text to fill"])
                  new_file = c4d.storage.LoadDialog(c4d.FILESELECTTYPE_IMAGES, "My unique UI name Replacer", c4d.FILESELECT_LOAD)
              
              1 Reply Last reply Reply Quote 0
              • First post
                Last post