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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
# -*- coding: cp1252 -*-
#script panel.py
#python version 2.7.1
#PeyeonScript 2.7_64bits
#import des modules
from Tkinter import * #pour éviter tout préfixage
import ttk #Module graphique
import PeyeonScript as eyeon #permet la communication entre BlackMagic Fusion et Python
#definition des actions/commandes
#Action test : Ouvre une composition
def newComp():
fusion = eyeon.scriptapp("Fusion")
comp = fusion.NewComp()
# Création de la fenêtre principale (main window)
root = Tk()
root.geometry("350x110")
root.title('PANEL')
# Création des onglets : CREATE, LOAD, TOOL, HELP
nb = ttk.Notebook(root)
nb.pack(fill='both', expand='yes')
f1 = Frame(borderwidth=10)
f2 = Frame(borderwidth=10)
f3 = Frame(borderwidth=10)
f4 = Frame(borderwidth=10)
nb.add(f1, text='CREATE')
nb.add(f2, text='LOAD')
nb.add(f3, text='TOOL')
nb.add(f4, text='HELP')
# Création des input texte : ep001, sc001, comp, v001
txtEp = StringVar()
txtEp.set("ep001")
txtEpIn = Entry(f1, textvariable=txtEp, width=5)
txtEpIn.grid(column=0, row=0)
txtSc = StringVar()
txtSc.set("sc001")
txtScIn = Entry(f1, textvariable=txtSc, width=5)
txtScIn.grid(column=1, row=0)
txtStep = StringVar()
txtStep.set("comp")
txtStepIn = Entry(f1, textvariable=txtStep, width=10)
txtStepIn.grid(column=2, row=0)
txtVer = StringVar()
txtVer.set("v001")
txtVerIn = Entry(f1, textvariable=txtVer, width=5)
txtVerIn.grid(column=3, row=0)
lblExt = Label(f1, text=".comp")
lblExt.grid(column=4, row=0)
lblAmb = Label(f1, text="Ambiance : ")
lblAmb.grid(column=0, row=2)
# Création des input DropDown et Bouton CREATE
ambVal = StringVar()
boxAmbVal = ttk.Combobox(f1, textvariable=ambVal, width=10)
boxAmbVal['values'] = ("MORNING", "DAY", "SUNSET", "NIGHT")
boxAmbVal.current(0)
boxAmbVal.grid(column=1, row=2)
BtnCreate = Button(f1, text = 'CREATE', height=1, width=10, command=newComp)
BtnCreate.grid(column=2, row=2)
'''
#LAYOUT
txtEpIn.grid(column=0, row=0)
txtScIn.grid(column=1, row=0)
txtStepIn.grid(column=2, row=0)
txtVerIn.grid(column=3, row=0)
lblExt.grid(column=4, row=0)
lblAmb.grid(column=0, row=1, pady=10)
boxAmbVal.grid(column=1, row=1, pady=10)
BtnCreate.grid(column=4, row=1, pady=10)
'''
root.mainloop() |
Partager