From 1920944a5dd19d243129b2f5495843cb29730598 Mon Sep 17 00:00:00 2001 From: "Jeison Yehuda Amihud (Blender Dumbass)" Date: Sun, 19 Dec 2021 18:14:53 +0000 Subject: [PATCH] Upload files to 'studio' --- studio/checklist.py | 6 +++ studio/studio_analyticsLayer.py | 87 ++++++++++++++++++++++++++------- studio/studio_gtk.py | 56 ++++++++++++++++++--- studio/studio_settingsLayer.py | 28 +++++++++++ 4 files changed, 154 insertions(+), 23 deletions(-) diff --git a/studio/checklist.py b/studio/checklist.py index a3215a8..ba69a42 100644 --- a/studio/checklist.py +++ b/studio/checklist.py @@ -753,9 +753,15 @@ def draw(outlayer, win, path, back="story_editor"): if task["fraction"]: task["fraction"] = 0.0 history.record(win, path, "[Un-Checked]", schedulepath) + win.textactive = "" + try: del win.text["editing_task"] + except: pass else: task["fraction"] = 1.0 history.record(win, path, "[Checked]", schedulepath) + win.textactive = "" + try: del win.text["editing_task"] + except: pass # Saving save(path, win.checklists[path]) diff --git a/studio/studio_analyticsLayer.py b/studio/studio_analyticsLayer.py index 1694b42..2e79580 100644 --- a/studio/studio_analyticsLayer.py +++ b/studio/studio_analyticsLayer.py @@ -1,7 +1,20 @@ -# THIS FILE IS A PART OF VCStudio -# PYTHON 3 - -# This a console project manager. +#################################### +# # +# COPYRIGHT NOTICE # +# # +# This file is a part of Victori- # +# ous Children Studio Organizer. # +# Or simply VCStudio. Copyright # +# of J.Y.Amihud. But don't be sad # +# because I released the entire # +# project under a GNU GPL license. # +# You may use Version 3 or later. # +# See www.gnu.org/licenses if your # +# copy has no License file. Please # +# note. Ones I used the GPL v2 for # +# it. It's no longer the case. # +# # +#################################### import os import datetime @@ -449,7 +462,7 @@ def layer(win): x = win.current["w"]/4 y = 280 width = win.current["w"] / 2 - height = (win.current["h"]-300)/2 + height = 100 # Now let's make a layer. @@ -570,6 +583,7 @@ def layer(win): # how much stuff is done and how much stuff is not yet done. A kind of second # graph, so to speak. But representing differnt kind of data. + # OKAY. SETTINGS. @@ -647,7 +661,7 @@ def layer(win): y = y + height + 60 - height = height - 100 + height = win.current["h"]-500 # Making the layer graphsurface = cairo.ImageSurface(cairo.FORMAT_ARGB32, int(width), int(height)) @@ -743,14 +757,15 @@ def layer(win): node.show_text(theday.split("/")[2]) UI_color.set(node, win, "dark_overdrop") - if theday == today: - UI_color.set(node, win, "button_clicked") - UI_elements.roundrect(node, win, - 5+current_X+win.scroll["days"], - 67, - 40, - height-67, - 10) + if theday >= today: + if theday == today: + UI_color.set(node, win, "button_clicked") + UI_elements.roundrect(node, win, + 5+current_X+win.scroll["days"], + 67, + 40, + height-67, + 10) if win.current["date"] == theday: UI_color.set(node, win, "progress_background") @@ -845,10 +860,48 @@ def layer(win): offset=[x,y], fill=False) node.stroke() - + + ##################### BOTTOM GRAPH ####################### + + # Blender-Organizer legacy had two graphs. One smaller + # that shows all the project from start to finish + # ( Implemented above ) and one bigger. That shows a + # Zoomed in version of the graph. Back then I made it + # executing the same code twice. Which was fine. Since + # I had to make a change only ones. Now it's a bit of a + # problem to do so. Since the graph above is baked. And + # need to be able to navigate with in the bottom graph. + + # So instead I'm going to redo the graph, but since we + # are re-doing it. I gonna make a slightly different design. + # It will show the same exact data. But drawn with a bit more + # beauty, compared to the top graph. + + for num, thing in enumerate(reversed(cat)): + if cat[thing][0]: + UI_color.set(node, win, cat[thing][2]) + try: + fracs = win.analytics["dates"][theday]["fractions"] + gfraction = fracs[thing] + # For now I will implement only Linear mode + # other modes will come later + graphY = ((height-80) - (height-80) * gfraction)+60 + + UI_elements.roundrect(node, win, + 8+current_X+win.scroll["days"], + graphY, + 35, + 8, + 5) + except: + pass + + + + # Now here I want to draw the representations of scheduled - # tasks that are insife + # tasks that are inside sch = [] if theday in win.analytics["dates"]: @@ -887,7 +940,7 @@ def layer(win): current_X = current_X + 50 - + UI_color.set(node, win, "dark_overdrop") UI_elements.roundrect(node, win, 5+prevyear[1]+2, diff --git a/studio/studio_gtk.py b/studio/studio_gtk.py index e427926..65d4fc5 100644 --- a/studio/studio_gtk.py +++ b/studio/studio_gtk.py @@ -61,7 +61,34 @@ def run(project, win): except: pass + # Sometimes the projects could be corrupted. So we need to + # insure that they are alright. + + fn = project + try: os.mkdir(fn) + except: pass + try: os.mkdir(fn+"/rnd") + except: pass + try: os.mkdir(fn+"/dev") + except: pass + try: os.mkdir(fn+"/ast") + except: pass + try: os.mkdir(fn+"/pln") + except: pass + try: os.mkdir(fn+"/mus") + except: pass + try: os.mkdir(fn+"/set") + except: pass + + for f in ["chr","loc","veh","obj"]: + try: os.mkdir(fn+"/ast/"+f) + except: pass + try: os.mkdir(fn+"/dev/"+f) + except: pass + + + # Setting up the window win = Gtk.Window() @@ -241,12 +268,25 @@ def pmdrawing(pmdrawing, main_layer, win): # Current frame (for animations and things like this) win.current["frame"] += 1 + if not "scale" in win.settings: + settings.write("scale", 1) # Writing to file + win.settings = settings.load_all() + # Getting data about the frame - win.current['mx'] = win.get_pointer()[0] - win.current['my'] = win.get_pointer()[1] - win.current['w'] = win.get_size()[0] - win.current['h'] = win.get_size()[1] + win.current['mx'] = int(round(win.get_pointer()[0] / win.settings["scale"])) + win.current['my'] = int(round(win.get_pointer()[1] / win.settings["scale"])) + win.current['w'] = int(round(win.get_size()[0] / win.settings["scale"] )) + win.current['h'] = int(round(win.get_size()[1] / win.settings["scale"] )) + if 65451 in win.current["keys"]: + settings.write("scale", win.settings["scale"]+0.2) + win.settings = settings.load_all() + win.current["keys"] = [] + + elif 65453 in win.current["keys"]: + settings.write("scale", win.settings["scale"]-0.2) + win.settings = settings.load_all() + win.current["keys"] = [] win.cursors = { "arrow":Gdk.Cursor.new(Gdk.CursorType.ARROW), @@ -283,8 +323,8 @@ def pmdrawing(pmdrawing, main_layer, win): main_layer.rectangle( 0, 0, - win.current['w'], - win.current['h']) + win.current['w']*win.settings["scale"], + win.current['h']*win.settings["scale"]) main_layer.fill() # Tooltips and other junk has to be defined here. And then drawn later to @@ -355,6 +395,10 @@ def pmdrawing(pmdrawing, main_layer, win): Layers.append([UI_testing.layer(win)]) Layers.append([win.tooltip_surface]) + if win.settings["scale"] != 1: + main_layer.scale(win.settings["scale"], + win.settings["scale"]) + # Combining layers for layer in Layers: if len(layer) > 1: diff --git a/studio/studio_settingsLayer.py b/studio/studio_settingsLayer.py index ffb9087..cf2bbcb 100644 --- a/studio/studio_settingsLayer.py +++ b/studio/studio_settingsLayer.py @@ -564,6 +564,34 @@ def layer(win): layer.move_to(win.current["w"]/2-180, current_Y + win.scroll["studio_settings"] + 135) layer.show_text(talk.text("Auto_De-Blur")) + + current_Y += 50 + + # Pixelated Blur + + ablur_ok = "unchecked" + if win.settings["PixelBlur"]: + ablur_ok = "checked" + + def do(): + win.settings["PixelBlur"] = not win.settings["PixelBlur"] + settings.write("PixelBlur", win.settings["PixelBlur"]) + + UI_elements.roundrect(layer, win, + win.current["w"]/2-240, + 110 + current_Y + win.scroll["studio_settings"], + 450, + 40, + 10, + button=do, + icon=ablur_ok, + tip=talk.text("PixelBlur")) + + UI_color.set(layer, win, "text_normal") + layer.set_font_size(20) + layer.move_to(win.current["w"]/2-180, + current_Y + win.scroll["studio_settings"] + 135) + layer.show_text(talk.text("PixelBlur")) current_Y += 50