1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| import maya.cmds as cmds
import maya.cmds as cmda
Active = False
# Partie prévisu
############################################
# Fonction #
############################################
def acivation():
global Active
Active = not(Active)
if Active == True:
#passage en mode vertex
#cmds.modelEditor(model, edit=True, displayAppearance='flatShaded',av=True)#tentative mode forme plaines avec texture
cmds.button(controlButton, e = True, label = u"Désactiver l'édition des maisons")
if Active == False:
cmds.selectMode( object=True )#passage en mode objet
cmds.modelEditor(model, edit=True, displayAppearance='smoothShaded',av=True)#mode forme plaines sans texture
cmds.button(controlButton, e = True, label = u"Activer l'édition des maisons")
print(Active)
############################################
# Interface #
############################################
window = cmds.window( title=u"genere une ville", iconName='Short Name', widthHeight=(1000, 1000) )
p = cmds.paneLayout()
cmds.setParent()
mycontest = cmds.manipMoveContext()
cmds.selectMode( object=True )#mode objet
model = cmds.modelEditor(cmds.modelEditor(modelPanel=cmds.modelPanel()), edit=True, displayAppearance='smoothShaded',av=True)#mode forme plaines sans texture
controlButton = cmds.button(label = "Activer l'édition des maisons", command="acivation()")
cmds.showWindow( window ) |
Partager