THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/10/2012 at 00:02, xxxxxxxx wrote:
Thanks to Lennard
I learn so much this weekend.
M fault was that I used spaces and tabs mixed
But now there is a new problem:
I tryed to define a funktion.
(Funtions have to be placed before the execute. wright?)
But nothing happens when the plugin is executet.
Can somebody give me a smal advice! Please
Here is my code
Thanks to all
"""
V4D-Power-Reducer
Copyright: VISION 4D
Written for CINEMA 4D R14
Modified Date: 18/10/2012
"""
import c4d
import math
import os
from c4d import documents, plugins, bitmaps
#Welcome to the world of Python
PLUGIN_ID = 1029229
class MYPLUGIN(plugins.CommandData) :
#pass
def Execute(self, doc) :
def Test(self) :
print 'test'
return True
print 'Hello'
print 'Hello again'
Test
#Check_serialinfo
c4d.CallCommand(5159) # Würfel
return True
if __name__ == "__main__":
# load icon.tif from res into bmp
bmp = bitmaps.BaseBitmap()
dir, file = os.path.split(__file__)
fn = os.path.join(dir, "res", "icon.tif")
bmp.InitWith(fn)
# register the plugin
okyn = plugins.RegisterCommandPlugin(id=PLUGIN_ID, str="V4D-Power-Reducer", info=c4d.PLUGINFLAG_COMMAND_HOTKEY, icon=bmp, help="", dat=MYPLUGIN())
c4d.CallCommand(13957) # Konsole löschen
print " "
print "----------------------------------"
print "V4D-Power-Reducer ", okyn
print "----------------------------------"