Bonjour,

Jusqu'ici je me suis débrouillé seul, mais j'arrive à un point de non retour.
J'essaie de "refaire" un panel d'outils en Python qui me permet d'automatiser certaines tâches.

import PeyeonScript as eyeon est un module spécifique pour la communication du logiciel sur lequel je travail.
Jusqu'ici ce n'est que du Layout. Et d'ailleurs c'est bien de cela dont j'ai besoin.

J'avais fait auparavant le même panel en LUA, mais à retranscrir en Python ça devient folklo ^^ car je débute en python.

Donc, avant de me lancer dans les commandes et actions j'aimerai avoir vos lanternes sur la structure du code ?
Car pour moi je le trouve très brouillon, pas rangé. Alors avec 3 onglets supplémentaires je pense que ça va être la cata.
Je pense que par la même occasion cela va m'aider à réorganiser mon layout anarchique.

merci de votre retour,

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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()