Upload files to 'studio'

This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2022-10-28 19:43:49 +00:00
parent 1c2d11549b
commit 98e416296d
3 changed files with 100 additions and 7 deletions

View file

@ -4,6 +4,12 @@
import os
import cairo
try:
from gi.repository import Gtk
from gi.repository import Gdk
except:
pass
#UI modules
from UI import UI_elements
from UI import UI_color
@ -297,6 +303,7 @@ def save(path, data):
writetasks(data["subtasks"])
if path:
# Writting to file
w = open(path, "w")
@ -305,6 +312,12 @@ def save(path, data):
w.close()
ret = ""
for i in lines:
ret = ret+"\n"+i
ret = ret[1:]
return ret
def draw(outlayer, win, path, back="story_editor"):
############################################################################
@ -1116,6 +1129,43 @@ def draw(outlayer, win, path, back="story_editor"):
)
layer.show_text(talk.text("add_new_task"))
cXY[1] = cXY[1] + 100
def do():
raw = save(False, win.checklists[path])
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
clipboard.set_text( raw , -1)
UI_elements.roundrect(layer, win,
cXY[0],
win.scroll["checklist"] + cXY[1],
width - cXY[0],
40,
10,
button=do,
icon="copy_file",
offset=[x,y])
UI_color.set(layer, win, "progress_background")
UI_elements.roundrect(layer, win,
cXY[0],
win.scroll["checklist"] + cXY[1],
width - cXY[0],
40,
10,
fill=False)
layer.stroke()
layer.set_font_size(20)
layer.move_to(
cXY[0]+50,
win.scroll["checklist"] + cXY[1]+25
)
layer.show_text(talk.text("copy_checklist_to_clipboard"))
tileX, current_Y = cXY

View file

@ -576,6 +576,10 @@ def layer(win, call):
def do():
win.current["selecting_render_file_format"] = not win.current["selecting_render_file_format"]
if win.current["selecting_render_file_format"]:
win.scroll["render"] = win.scroll["render"]-50*len(formats)
win.current["LMB"] = False
win.previous["LMB"] = False
UI_elements.roundrect(layer, win,
x+120,

View file

@ -1936,6 +1936,42 @@ def layer(win):
layer.move_to( x+50, y+(50*num)+25)
layer.show_text(talk.text(shot_options[option]))
# Add checklist from clipboard
def do():
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
cliptext = str(clipboard.wait_for_text())
filepath = win.project+"/rnd"+win.cur+"/shot.progress"
s = open(filepath, 'w')
s.write(cliptext)
s.close()
UI_elements.roundrect(layer, win,
x,
y+(50*num+50),
width,
40,
10,
button=do,
icon="checklist_new")
UI_color.set(layer, win, "progress_background")
UI_elements.roundrect(layer, win,
x,
y+(50*num+50),
width,
40,
10,
fill=False)
layer.stroke()
UI_color.set(layer, win, "text_normal")
layer.set_font_size(20)
layer.move_to( x+50, y+(50*num+50)+25)
layer.show_text(talk.text("new_checklist_from_clipboard"))
else:
# Now... If it's not a shot. We can do it in one line.
@ -2532,7 +2568,10 @@ def layer(win):
Pb.paint()
imageurl = win.project+"/rnd"+win.cur+"/"+win.current[shotis+"_active_folder"]+"/0001.png"
try:
os.makedirs(win.project+"/rnd"+win.cur+"/"+win.current[shotis+"_active_folder"])
except:
pass
Pc.write_to_png(imageurl)