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