InExclude list python plugin?

On 29/07/2016 at 14:51, xxxxxxxx wrote:


I feel like I'm asking a lot this week, buuut does anyone have an example of a python plugin (this one is CommandData, but I don't think that'll matter) that has a functional InExclude list with it?  I got one to show up with a simple

self.AddCustomGui(PLA_OBJECTS, c4d.CUSTOMGUI_INEXCLUDE_LIST, "PLA Objects", c4d.BFH_LEFT, 300, 50)

but I'm having trouble properly using/initializing it (no objects can be added to it in c4d; I suspect because I haven't attached any InExcludeData, yet).

I'm trying to make some of the scripts that get passed around here at work into proper plugins to make things less janky, but UserData setups can be a crutch...

Thanks a million

On 29/07/2016 at 21:20, xxxxxxxx wrote:

You probably just need to set up the containers for it.
Here's an example:

    def CreateLayout(self) :      
      res = self.LoadDialogResource(ResBasedMenu)    #Loads GUI stuff from the .res file if desired  
      ###### An InExclude gizmo created here in the .pyp code (not in the .res file) #######  
      #First create a container that will hold the items we will allow to be dropped into the INEXCLUDE_LIST gizmo  
      acceptedObjs = c4d.BaseContainer()  
      acceptedObjs.InsData(c4d.Obase, "")   #accept all objects (change as desired)  
      acceptedObjs.InsData(c4d.Tbase, "")   #accept all  tags (change as desired)  
      #Create another container for the INEXCLUDE_LIST gizmo's settings and add the above container to it  
      IEsettings = c4d.BaseContainer()  
      IEsettings.SetData(c4d.DESC_ACCEPT, acceptedObjs)    
      #Lastly, create the  INEXCLUDE_LIST gizmo itself and point it at the "IEsettings" container       
      self.IEList = self.AddCustomGui(6666, c4d.CUSTOMGUI_INEXCLUDE_LIST, "", c4d.BFH_SCALEFIT|c4d.BFV_CENTER, 0, 0, IEsettings)  
      return res


On 30/07/2016 at 10:22, xxxxxxxx wrote:

Awesome, Scott, thanks so much!

It seems obvious, now, but I was having a hard time doing it right.  Here's to the weekend warriors ^^