Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi guys,
I'm drafting a tool that will inform the user with any plugins/scripts updates and that will point to the relevant wiki page for more information.
I have a few questions that hopefully you can help me address.
The next steps would be to change the dialog to a treeview, which will look a lot cleaner.
Thank you in advance!
Andre
Hi @AndreAnjos ,
Cinema 4D offers multiple Messages that can be caught in the PluginMessage method of your plugin.
You can find relevant messages ID in the Plugin Functions Manual C++ manuals in the Start section.
Note all these Messages are also sent to Python plugin. See c4dpl
Here a full example
import c4d PLUGIN_ID = 1000001 class MyDialog(c4d.gui.GeDialog): def CreateLayout(self): self.SetTitle("My Python Dialog") return True def PluginMessage(id, data): print "Pluginmessage" if id==c4d.C4DPL_PROGRAM_STARTED: c4d.CallCommand(PLUGIN_ID) class CommandDataPlugin(c4d.plugins.CommandData): dialog = None def Execute(self, doc): if self.dialog is None: self.dialog = MyDialog() return self.dialog.Open(dlgtype=c4d.DLG_TYPE_ASYNC, pluginid=PLUGIN_ID, defaulth=400, defaultw=400) def RestoreLayout(self, sec_ref): if self.dialog is None: self.dialog = MyDialog() return self.dialog.Restore(pluginid=PLUGIN_ID, secret=sec_ref) if __name__ == "__main__": c4d.plugins.RegisterCommandPlugin( PLUGIN_ID, "CommandDataPlugin", 0, None, None, CommandDataPlugin())
But in any case, this will not work for a TreeView.
If you have any questions please let me now. Cheers, Maxime.
@m_adam Hi Maxime,
It works like a treat! I've ended up changing the UI to a treeView and it's still working great. Thank you very much!