THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/06/2011 at 15:48, xxxxxxxx wrote:
I'm trying to load a dialog created with the resedit plugin in a CommandData plugin.
At this stage it's just an example plugin with a single checkbox dialog but I can't get it to work
My Folder Structure is :
And the code for my plugin is :
from c4d import plugins, bitmaps, gui
PLUGIN_ID = 1000001 #be sure to use a unique ID obtained from www.plugincafe.com
class MyDialog(gui.GeDialog) :
def CreateLayout(self) :
class Example(plugins.CommandData) :
def Execute(self, doc) :
dialog = MyDialog()
if __name__ == "__main__":
path, fn = os.path.split(__file__)
bmp = bitmaps.BaseBitmap()
bmp.InitWith(os.path.join(path, "res", "Example.tif"))
plugins.RegisterCommandPlugin(id = PLUGIN_ID,
str = "Example", help = "Command Plugin Example",
dat = Example(), info = 0, icon = bmp)
A dialog is succesfully created but it's empty, and when I close it,
I get the error :
"NameError:global name 'IDD_EXAMPLE' is not defined".
So it seems I need to do something more to initialise the resource or point to the 'res' folder but I don't know what.
None of the plugin examples seem to load an external dialog file, so I'm a bit stuck.
Any help would be gratefully recieved.