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
    • Login

    how to limit the type of files we can import?

    Cinema 4D SDK
    python 2024
    3
    3
    428
    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.
    • S
      sydney_ko
      last edited by

      hello,

      I'm new here. I'm trying to create an import button to import only tiff files. but it still shows all types of files when the file browser gets opened. any help? Is there a thing to import multiple files?

      c4d.storage.LoadDialog(c4d.FILESELECTTYPE_IMAGES, "Select Images", c4d.FILESELECT_LOAD, force_suffix=["tiff"])
      
      i_mazlovI 1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov @sydney_ko
        last edited by

        Hello @sydney_ko!

        Welcome to the Maxon developers forum and its community, it is great to have you with us!

        Getting Started

        Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.

        • Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.
        • Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.
        • Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.

        It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions.

        About your First Question

        The documentation for the c4d.storage.LoadDialog() function explicitly tells that the force_suffix argument is not used, hence providing any value to it doesn't make any effect on the behviour of your selection dialog. The reason why it is still there is due to c4d.storage.LoadDialog() and c4d.storage.SaveDialog() both being based on the same FileSelect() function, that uses "force_suffix" argument only in FILESELECT::SAVE mode.

        If you were on C++ plugin development side, you could easily make use of the FileSelectMultiple() function, which allows you to control files extension filters via "filterStrings" argument. However, this function is not exposed to our Python SDK, so the only way for you to make use of it is by switching to C++ development.

        Cheers,
        Ilia

        MAXON SDK Specialist
        developers.maxon.net

        M 1 Reply Last reply Reply Quote 0
        • M
          momoko @i_mazlov
          last edited by momoko

          @i_mazlov Thanks for your response! I learnt a lot!

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