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

    How to make a Open a File Dialog [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 490 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 18/02/2016 at 14:37, xxxxxxxx wrote:

      Hello All, I am searching for a way to open a File Dialog using gui.GeDialog in R16.  I want to have the user be able to browse to a file and select it. Then I use that file path to do some other stuff. I can't seem to figure it out or find it in the python docs. Maybe I am not searching the proper name for it.

      https://www.dropbox.com/s/4nnvsv27lwe8680/openBrowser.JPG?dl=0
      ^ An image of what I am trying to make

      Thank you all in advanced.

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

        On 19/02/2016 at 00:50, xxxxxxxx wrote:

        Hello,

        you can create this custom GUI element using AddCustomGui() with the ID of CUSTOMGUI_FILENAME. You find an example how to do that in this thread:

        • "Is there a filename gui for a GeDialog?"

        best wishes,
        Sebastian

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

          On 19/02/2016 at 07:42, xxxxxxxx wrote:

          Hello Sebastian thanks so much for the quick response! Sorry for the repeated question I could not find that thread in a search. I will also be sure to keep my eye on the c++ documentation because the Python docs do no show everything like the missing CUSTOMGUI_FILENAME.

          Thank you,
          Andrez

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

            On 19/02/2016 at 09:21, xxxxxxxx wrote:

            Due to my lack of C++ knowledge, how do I implement the  FILENAME_DIRECTORY or FILENAME_SAVE definitions? in Python? I want to open a directory path and not a file.

            Thanks so much!

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

              On 19/02/2016 at 11:25, xxxxxxxx wrote:

              Hello I figured it out, sorry for that. I guess you can change the Settings in the baseContainer.

              settings = c4d.BaseContainer() # Create Base Container
              settings.SetBool(c4d.FILENAME_SAVE, True) #Change settings
              self.AddCustomGui(MY_FILENAME, c4d.CUSTOMGUI_FILENAME,"",c4d.BFH_SCALEFIT,0,0,settings)

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