diff --git a/studio/studio_scriptLayer.py b/studio/studio_scriptLayer.py index 4770444..6750f5f 100644 --- a/studio/studio_scriptLayer.py +++ b/studio/studio_scriptLayer.py @@ -2515,7 +2515,37 @@ def layer(win): button=do, fill=False) layer.stroke() - + + else: + # If there is no image to show we can put one. Using a clipboard. + + def do(): + clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD) + im = clipboard.wait_for_image() + if not im: + return + Px = im.get_width() + Py = im.get_height() + Pc = cairo.ImageSurface(cairo.FORMAT_ARGB32, Px, Py) + Pb = cairo.Context(Pc) + Gdk.cairo_set_source_pixbuf( Pb, im, 0, 0) + Pb.paint() + + imageurl = win.project+"/rnd"+win.cur+"/"+win.current[shotis+"_active_folder"]+"/0001.png" + + Pc.write_to_png(imageurl) + + + + UI_elements.roundrect(layer, win, + x+5+(width/2)-20, + y+win.scroll["script_shots"]+current_Y_shots-7+80, + 40, + 40, + 10, + button=do, + icon="image_new") + current_Y_shots = current_Y_shots + 210 @@ -2993,7 +3023,7 @@ def layer(win): studio_dialogs.file_select(win, shotis+"_blends", after, force=True, IMAGE=False, BLEND=True, VIDEO=False, FILE=False, CHR=False, VEH=False, - LOC=False, OBJ=False, RND=True, FOLDER=False, SEARCH=scene) + LOC=False, OBJ=False, RND=True, FOLDER=False, SEARCH=scene+" ") UI_elements.roundrect(layer, win, x+tileX,