Hello
Anybody can help me maybe here, i have a problem with Custom button , iv added it to C:Users/......./script and my button vbeen created in my photoscan menu, but i cant open it when i go to >> Custom>>(myscript)Selectioner desactiver , there is no callback from ... nothing happens, my python skill are low maybe someone will help :
there is my code
import os
import PhotoScan
from tkinter import*
def selec():
doc = PhotoScan.app.document
chunk = doc.chunk
def center_window(width=500, height=400):
# hoteur et largeur notre fenetre
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
# calcule positionement notre fenetre sur ecran
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
root.geometry('%dx%d+%d+%d' % (width, height, x, y))
root = Tk()
center_window(500, 400)
root.title('selection images')
###### premiere boutton - selection les images activer
def callback():
chunk = PhotoScan.app.document.chunk
for camera in chunk.cameras:
if camera.enabled:
camera.selected = True
else:
camera.selected = False
but = Button(root,bg='yellow',width =20, height =2, bd =2, relief =SOLID, text='selection active', command=callback)
but.pack()
######## partie liaison avec photoscan
PhotoScan.app.addMenuItem("Custom/Selection desactiver", selec)
root.mainloop()
iv tried few combination and cant get positive results im stuck with it since friday, if someone of u know why that dsnt work i will glad 4 a answer.
And would like to ask u why this custom window starting together with photoscan, if i will add 10 scripts (custom windows) I will have to closed them all before i will be able to use photoscan