On 13/02/2013 at 02:10, xxxxxxxx wrote:
Sorry for super-basic questions, but I´m stucked...
Learning Python without any programming background is giving me a hard time, although a Python for Children book was a great help already ;-)
Understanding many easy things now, I want to make a first plugin. Nothing of real use, just the same thing a simple user Script can do in plugin form.
I got so far, that my plugin loads, but no way I could get it to work by using it. Best I got were no errors messages ;-)
import c4d
from c4d import plugins
import os
PLUGIN_ID = 10000010
doc = c4d.documents.GetActiveDocument()
obj = doc.GetActiveObject()
class Starter(c4d.plugins.CommandData) :
def Execute(self, doc) :
obj.SetAbsPos(c4d.Vector(111.0, 22.0, 22.0))
c4d.EventAdd()
if __name__=='__main__':
bmp = c4d.bitmaps.BaseBitmap()
dir, file = os.path.split(__file__)
fn = os.path.join(dir, "res", "Icon.tif")
bmp.InitWith(fn)
print "transformer_testloaded."
result = plugins.RegisterCommandPlugin(PLUGIN_ID, "transformer_test", 0, bmp, "transformer_test", Starter())
And if anybody knows a good tutorial on plugin creation, or a very well documented small plugin, I´d be happy :-)
Thanks