On 22/02/2017 at 07:29, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R17.055
Platform: Windows ;
Language(s) : PYTHON ;
---------
Hi,guys.
I'm learning to create a simple dialog with python,but it is not working,I don't know how to solve the issue.could you help me? Any help would be greatly appreciated!
Here is the code below:
import c4d
import os
from c4d import gui
id_1=1001
class Layout(gui.GeDialog,) :
def CreateLayout(self) :
self.SetTitle("HDRI Created")
self.AddButton(id_1,c4d.BFH_CENTER,100,name='Hdri')
return True
def InitValues(self) :
self.SetBool(id_1,False)
return True
def Command(self,id,msg) :
if (id == id_1) :
sky = c4d.BaseObject(c4d.Osky)
sky.SetName("Relfect sky")
mat = c4d.BaseMaterial(c4d.Mmaterial)
mat.SetName("Reflection")
doc.InsertMaterial(mat)
tag = sky.MakeTag(c4d.Ttexture)
tag[c4d.TEXTURETAG_MATERIAL] = mat
doc.InsertObject(sky)
c4d.EventAdd()
return True
def main() :
test = Layout()
test.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE)
if __name__=='__main__':
main()