SplineGUI for python plugin

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 11 November 2012   #1
SplineGUI for python plugin

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)

self.GroupEnd()
return True

def InitValues(self):

self.sd = c4d.SplineData()
self.sd.MakeLinearSplineBezier(3)

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

return True

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

class ASSP(plugins.ToolData):

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

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


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

okyn = plugins.RegisterToolPlugin(id=PLUGIN_ID, str="SplineControl",info=0, icon=bmp, help="Statusbar Text",dat=ASSP())
if (okyn): print "SplineControl Plugin V09 initialized."
__________________
Please have a look at Plugins4D for plugin development and free plugins.
 
Old 11 November 2012   #2
NiklasR answered me on PluginCafe.com.
Thanks NiklasR
__________________
Please have a look at Plugins4D for plugin development and free plugins.
 
Old 11 November 2012   #3
You're welcome.
I'll just add the link so others don't have to search: http://www.plugincafe.com/forum/for...ts.asp?TID=7318
__________________
Cinema 4D Plugin Developer
niklasrosenstein.com/ | Freebies | Plugins
 
Old 11 November 2012   #4
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:01 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.