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

    Filename Gui how get empty folder path

    Cinema 4D SDK
    python s26
    2
    3
    376
    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.
    • chuanzhenC
      chuanzhen
      last edited by chuanzhen

      Hi
      I create a filename gui, when an empty folder is choosed, there is no file to choose from. What I want to get is the path of the empty folder. How to do it!

      For example, the following figure,i want to get its path
      未标题-1.png

      Thanks for any help!

      相信我,可以的!

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @chuanzhen
        last edited by ferdinand

        Hello @chuanzhen,

        Thank you for reaching out to us. While I understand your question, it is slightly ambiguous, as you do not tell us how and where this file name custom GUI is being created. It could be a dialog or a description, and you could use a resource file or the GeDialog methods to create it.

        A FilenameCustomGui has multiple flags which change its behavior, one of which is FILENAME_DIRECTORY. The '...' button will then open a directory selection dialog instead of a file selection dialog. If you want some sort of conditional operation ("select files by default, but if a directory is empty, allow the selection of such directory"), this is unfortunately not possible. You can only select files or directories, not both based on a custom condition.

        When you have defined your GUI in a resource file, you must add the DIRECTORY flag to the element, here is an example from a Team Render resource.

            LONG PREF_ASSETCHUNKSIZE { ANIM OFF; MIN 2; MAX 256;}
            SEPARATOR PREF_SEP_PATHS { }
            FILENAME PREF_SERVICEREPOSITORYPATH { DIRECTORY; }
          }
        }
        

        When you add the gadget manually in a CreateLayout, you must set the bool c4d.FILENAME_DIRECTORY to True in the customdata container passed to GeDialog.AddCustomGui.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        chuanzhenC 1 Reply Last reply Reply Quote 0
        • chuanzhenC
          chuanzhen @ferdinand
          last edited by

          @ferdinand Thanks.
          I create Filename Gui in CreateLayout
          it work,this is code:

           bc = c4d.BaseContainer()
           bc.SetBool(c4d.FILENAME_DIRECTORY,True)
           self.AddCustomGui(1012, c4d.CUSTOMGUI_FILENAME,"",c4d.BFH_SCALEFIT, 50, 20, bc)
          

          相信我,可以的!

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