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 list python plugin?

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 298 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 29/07/2016 at 14:51, xxxxxxxx wrote:

      Hellooo,

      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

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

        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
        

        -ScottA

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

          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 ^^

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