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

    InExclude CustomGUI in Python-Plugin

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 899 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 03/05/2018 at 08:14, xxxxxxxx wrote:

      Hey guys,

      I'm running into this problem again, where I want to make use of the In-Exclude CustomGUI inside of a plugin. (see attached picture.)
      (Dialog is created using a *.res file via ResEdit v1.3)

      I don't fully understand how I have to setup the Dialog to accept Drag and Drop of Objects.
      Sadly, there is a lot of convoluted Information online...

      In the end I want to have a unqiue collection of Objects which are stored within my PLUGINID with every Scene.

      Hope you understand what I'm trying to achieve.
      Can someone give me some advice..?

      Thanks & Cheers,
      Lasse

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

        On 04/05/2018 at 04:37, xxxxxxxx wrote:

        Hi Lasse,

        It's not possible to get an In-/Exclude GUI working with a loaded dialog because there's no way to set the accepted types by the list.
        The solution is to manually add the In-Exclude list to the dialog in CreateLayout().

        For instance to setup an In-/Exclude list that expects all kind of objects:

        def CreateLayout(self) :
          
            ...
          
            # Build accepted object types
            accepted = c4d.BaseContainer()
            accepted.InsData(c4d.Obase, "")
            settings = c4d.BaseContainer()
            # Set accepted object types into InExclude custom GUI settings  
            settings[c4d.DESC_ACCEPT] = accepted
          
            objectsList = self.AddCustomGui(IDC_OBJECTSLIST, c4d.CUSTOMGUI_INEXCLUDE_LIST, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0, settings)
          
            ...
        

        About saving the objects list, the In-/Exclude cannot do this as it is a control inside a dialog and cannot store persistent data.
        But you can save the data from the list. Call GetData() on the custom GUI, then set the obtained InExcludeData into the document's data with doc[PLUGIN_ID], where PLUGIN_ID is a unique plugin ID.

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