On 06/08/2013 at 07:08, xxxxxxxx wrote:
Hi. Probably silly question, but I cannot figure out how to create layout without res file:
Am I missing something? Thank you.
import c4d
from c4d import gui, plugins, utils
import os, random
PLUGIN_ID = 3333333
PLUGIN_NAME = "pluginname"
PLUGIN_DESCRIPTION = "Opluginname"
class MYPLUGIN(c4d.plugins.ObjectData) :
def CreateLayout(self) :
self.SetTitle("My Dialog")
self.GroupBegin(id=100010, flags=0, cols=1, rows=1)
self.AddGroupSpace(4, 4)
self.AddGroupBorderSpace(4, 4, 4, 4)
self.AddStaticText(id=100011, flags=0, name="Hello World!")
self.GroupEnd()
return True
if __name__ == '__main__':
bmp = c4d.bitmaps.BaseBitmap()
dir, file = os.path.split(__file__)
fn = os.path.join(dir, "res", "Icon.tif")
bmp.InitWith(fn)
result = plugins.RegisterObjectPlugin(
id=PLUGIN_ID, str=PLUGIN_NAME, g=MYPLUGIN, description="", info=c4d.OBJECT_GENERATOR, icon=bmp
)