View Full Version : SplineGUI for python plugin

11 November 2012, 03:16 PM
Based on Scotts example, I'm trying to create a python plugin (not a tag) with a SplineGui in it and not using a .res file.
The result is a small square, but nothing else.
I'm not able to initialize it.

Here is the code (formatting is gone):

import c4d
import os
from c4d import gui, plugins, bitmaps, utils, documents

PLUGIN_ID = 10281843 #Test ID!
MY_SPLINE = 40001

class SettingsDialog(gui.SubDialog):

def CreateLayout(self):

self.GroupBegin(id=1002, flags=c4d.BFH_FIT)

self.splineBox = self.AddCustomGui(MY_SPLINE, c4d.CUSTOMGUI_SPLINE, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)

return True

def InitValues(self): = c4d.SplineData()

#data = doc.GetDataInstance() #BaseContainer for the tag - for plugin???
#data.SetData(MY_SPLINE, #Execute the splineGUI changes from memory

return True

def Command(self, id, msg):
return True

class ASSP(plugins.ToolData):

def __init__(self): = dict() #container

def AllocSubDialog(self, bc):
return SettingsDialog( #always return new instance(

if __name__ == "__main__":
bmp = bitmaps.BaseBitmap()
dir, file = os.path.split(__file__)
fn = os.path.join(dir, "res", "Icon.tif")

okyn = plugins.RegisterToolPlugin(id=PLUGIN_ID, str="SplineControl",info=0, icon=bmp, help="Statusbar Text",dat=ASSP())
if (okyn): print "SplineControl Plugin V09 initialized."

11 November 2012, 01:33 PM
NiklasR answered me on
Thanks NiklasR

11 November 2012, 07:50 PM
You're welcome. :)
I'll just add the link so others don't have to search:

CGTalk Moderation
11 November 2012, 07:50 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.