On 01/01/2013 at 06:29, xxxxxxxx wrote:
Dear users,
I see this video for create a script for show a dialog, but when i run the script, show me the next message: "EnvironmmentError: cannot find the pyp file - plugin registration failed".
I sure that the problem is because i don´t know how to create the pyp file.
This is my script:
import c4d
from c4d import gui
from c4d import utils
from c4d import plugins
PLUGIN_ID=1029596
#Welcome to the world of Python
class MiDialogo(c4d.gui.GeDialog) :
def CreateLayout(self) :
self.element=self.AddStaticText(id=1001,flags=c4d.BFH_LEFT,initw=200, name="Diametro")
self.element=self.AddEditText(id=1001,flags=c4d.BFH_SCALEFIT|C4D.BFV_SCALEFIT,initw=400,inith=10,name="VDiametro")
return True
class MyMenuPlugin(c4d.plugins.CommandData) :
dialog = None
def Execute(self, doc) :
#self.dialog=MiDialogo()
return MiDialogo.Open(dlgtype=c4d.DLG_TYPE_ASYNC,pluginid=PLUGIN_ID,xpos=-1, ypos=-1,defaultw=200, defaulth=150)
def RestoreLayout(self, sec_ref) :
# manage the dialog
if self.dialog is None:
self.dialog = MyDialog()
return self.dialog.Restore(pluginid=PLUGIN_ID, secret=sec_ref)
if __name__=='__main__':
okyn = plugins.RegisterCommandPlugin(PLUGIN_ID, "Generador de anillos",0,None, "Menu de anillos", MyMenuPlugin())
if (okyn) :
print "Inicializado el generador de anillos"
main()
Thanks.