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

    How to hide plugin from Plugins menu?

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 644 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 11/03/2018 at 05:17, xxxxxxxx wrote:

      Hello plugincafe 🙂

      I have an Object Generator plugin and I would like to hide it from plugins menu and show another plugin(Command plugin) that will add my Object Generator plugin to the scene, assign the desired tags to it, and change some render settings.

      Unfortunately, I have never tried something like this and I would like to know how to register 2 plugins from one python code.

      Here is a test plugin(Object Generator) that creates Helix Spline.

        1. import c4d, os
        2.   
        3. class Testplugin(c4d.plugins.ObjectData) :
        4.   
        5.     def GetVirtualObjects(self, op, hh) :
        6.         return c4d.BaseObject(5185)
        7.   
        8. if __name__ == "__main__":
        9.     bmp = c4d.bitmaps.BaseBitmap()
        10.     dir, file = os.path.split(__file__)
        11.     fn = os.path.join(dir, "res", "icon.tif")
        12.     bmp.InitWith(fn)
        13.     result = c4d.plugins.RegisterObjectPlugin(id = 1040447, 
        14.                                               str = "Test Plugin", 
        15.                                               g = Testplugin, 
        16.                                               description = "Otestplugin", 
        17.                                               info = c4d.OBJECT_GENERATOR | c4d.OBJECT_ISSPLINE, 
        18.                                               icon = bmp)
      
      

      I wonder which parts of this code should I change and what should I add there in order to make this plugin work correctly.

      Have a nice day! 🙂

      -Merk

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

        On 11/03/2018 at 07:01, xxxxxxxx wrote:

        Ok. I figured out how to hide Object Generator Plugin from C4D's menu. 
        I simply had to add c4d.PLUGINFLAG_HIDE

        1. if __name__ == "__main__":
        2. bmp = c4d.bitmaps.BaseBitmap()
        3. dir, file = os.path.split(__file__)
        4. fn = os.path.join(dir, "res", "icon.tif")
        5. bmp.InitWith(fn)
        6. result = c4d.plugins.RegisterObjectPlugin(id = 1040447,
        7. str = "Test Plugin",
        8. g = Testplugin,
        9. description = "Otestplugin",
        10. info = c4d.OBJECT_GENERATOR | c4d.OBJECT_ISSPLINE | c4d.PLUGINFLAG_HIDE ,
        11. icon = bmp)
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 11/03/2018 at 07:21, xxxxxxxx wrote:

          Figured out 🙂

            1. import c4d, os
            2.   
            3. #Create Object Generator Plugin
            4. class Testplugin(c4d.plugins.ObjectData) :
            5.     def GetVirtualObjects(self, op, hh) :
            6.         return c4d.BaseObject(5185)
            7.   
            8. #Create Command Data Plugin
            9. class TestpluginCommand(c4d.plugins.CommandData) :
            10.     def Execute(self, doc) :
            11.         obj = c4d.BaseObject(1040447)
            12.         doc.InsertObject(obj)
            13.         c4d.EventAdd()
            14.         return True
            15.   
            16. if __name__ == "__main__":
            17.     bmp = c4d.bitmaps.BaseBitmap()
            18.     dir, file = os.path.split(__file__)
            19.     fn = os.path.join(dir, "res", "icon.tif")
            20.     bmp.InitWith(fn)
            21.   
            22. #Register Object Generator Plugin
            23.     c4d.plugins.RegisterObjectPlugin(id = 1040447, 
            24.                                      str = "Test Plugin", 
            25.                                      g = Testplugin, 
            26.                                      description = "Otestplugin", 
            27.                                      info =  c4d.OBJECT_GENERATOR | c4d.OBJECT_ISSPLINE | c4d.PLUGINFLAG_HIDE,
            28.                                      icon = bmp)
            29.   
            30. #Register Command Data Plugin
            31.     c4d.plugins.RegisterCommandPlugin(id=1000010 , 
            32.                                       str="Test Plugin",
            33.                                       help="Create Test Plugin",
            34.                                       info=0,
            35.                                       dat=TestpluginCommand(), 
            36.                                       icon=bmp)
          
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post