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

    Simple asset browser example

    Cinema 4D SDK
    r20 c++
    3
    5
    851
    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.
    • R
      Rox
      last edited by

      Hi,

      I am looking for example code on how to create a TreeView GUI resembling (a bare minimum) S24 asset browser.

      Basically I would like to specify a folder inside my plugin folder and browse for folders inside it.
      This I can do using BrowseFiles
      Typically this is a 1 level search, so no recursion is required.

      Inside each folder, there is a number of images.

      The TreeView should show a list of these folders. When the user selects an item from the TreeView list, the images inside each folder should be displayed respectively. The user then would invoque a command when an image is clicked (or double clicked).

      I already looked into TreeView Made Simple 1[URL-REMOVED] and TreeView Made Simple 2[URL-REMOVED]

      I would convert the found folders into a BaseArray and navigate inside it.
      But where should the array be created, inside TreeViewFunctions or somewhere else, and more importantly, how to display the image content of each folder ?

      Thanks for any help on the subject.


      [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        Hi,

        Those examples are using a shader to store the hierarchy, but you can use GeListNode. I don't think you need a BaseArray to store all your folders as you can simply iterate trough your hierarchy[URL-REMOVED] if you got the root. And InsertUnder, GetName, SetName are coming for free with the GeListNode.

        If you want to keep the BaseArray approach, there's no "right place" where to create and store your information.
        To display all the images inside the view, you may want to use a bitmapbutton for each image or use a UserArea to draw all the images.
        Be careful that with the userArea you will need to manage the zone for each picture where the use may clic.

        Where are you stuck for now?

        Cheers,
        Manuel


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • R
          Rox
          last edited by Rox

          Hi,

          Example code on how to convert a folder structure into a GeListNode hierarchy, and how to use it in the TreeViewFunctions context would be helpful.

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            Hi,

            this thread will probably help you.

            Cheers,
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

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

              Hello @Rox,

              without any further questions or replies, we will consider this topic as solved by Wednesday and flag it accordingly.

              Thank you for your understanding,
              Ferdinand

              MAXON SDK Specialist
              developers.maxon.net

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