From 1e41a09af3eb4f5c6e229c3981779f25f909207a Mon Sep 17 00:00:00 2001 From: "Jeison Yehuda Amihud (Blender Dumbass)" Date: Sun, 3 Jan 2021 13:52:42 +0000 Subject: [PATCH] Multiuser Experience Polish Some stuff for the multiuser experience --- studio/studio_gtk.py | 1 + studio/studio_multiuserLayer.py | 23 +++++++++++++++++++++-- studio/studio_nodes.py | 26 ++++++++++++++++++++++++-- studio/studio_storyLayer.py | 13 +++++++++++-- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/studio/studio_gtk.py b/studio/studio_gtk.py index 7b00514..8271277 100644 --- a/studio/studio_gtk.py +++ b/studio/studio_gtk.py @@ -150,6 +150,7 @@ def run(project, win): win.current["draw_dot"] = "end" win.current["calls"] = {} # Calls. See sutdio/studio_dialogs.py win.current["script_find"] = [0,0] + win.current["camera_arrived"] = False if "pointers" not in win.story: win.story["pointers"] = {} # List of text pointers per scene diff --git a/studio/studio_multiuserLayer.py b/studio/studio_multiuserLayer.py index 1987b5a..fbf51fe 100644 --- a/studio/studio_multiuserLayer.py +++ b/studio/studio_multiuserLayer.py @@ -27,6 +27,7 @@ from UI import UI_color from studio import story from studio import analytics from studio import history +from studio import studio_dialogs # network from network import multiuser_terminal @@ -147,7 +148,8 @@ def layer(win): 40, 10, button=do, - icon="server_close") + icon="server_close", + tip=talk.text("multiuser_server_stop")) else: def do(): @@ -161,7 +163,8 @@ def layer(win): 40, 10, button=do, - icon="server_new") + icon="server_new", + tip=talk.text("multiuser_server_start")) # Server outputs part. I'm creating a layer for it just because it needs # a clipping. @@ -358,6 +361,22 @@ def layer(win): layer.show_text(count) + # Documentation entry + def do(): + def after(win, var): + pass + + studio_dialogs.help(win, "help", after, SEARCH=talk.text("documentation_multiuser")) + + UI_elements.roundrect(layer, win, + win.current["w"]/3*2-160, + win.current["h"]-120, + 40, + 40, + 10, + do, + icon="question") + # CANCEl def do(): diff --git a/studio/studio_nodes.py b/studio/studio_nodes.py index 066c4c5..eed1502 100644 --- a/studio/studio_nodes.py +++ b/studio/studio_nodes.py @@ -1463,7 +1463,7 @@ def marker(outlayer, win, name ,x, y ): outlayer.stroke() -def user(outlayer, win, name ,x, y ): +def user(outlayer, win, name ,x, y, user): # This function will draw users from multiuser to the screen. @@ -1527,5 +1527,27 @@ def user(outlayer, win, name ,x, y ): 40, set_text=name, editable=False) - + + else: + + # Going to the other user with 1 click + + def do(): + + nex = win.multiuser["users"][user]["camera"][0] + ney = win.multiuser["users"][user]["camera"][1] + + UI_elements.animate("cameraX", win, win.story["camera"][0],nex, time=20, force=True) + UI_elements.animate("cameraY", win, win.story["camera"][1],ney, time=20, force=True) + + UI_elements.roundrect(outlayer, win, + x+width-40, + y, + 40, + 40, + 10, + button=do, + tip=name, + fill=False) + outlayer.stroke() diff --git a/studio/studio_storyLayer.py b/studio/studio_storyLayer.py index 28b552f..d124f79 100644 --- a/studio/studio_storyLayer.py +++ b/studio/studio_storyLayer.py @@ -981,7 +981,7 @@ def layer(win): mx = 0-win.multiuser["users"][user]["camera"][0] +cx + win.current["w"]/2 my = 0-win.multiuser["users"][user]["camera"][1] +cy + win.current["h"]/2 - studio_nodes.user(layer, win, win.multiuser["users"][user]["username"], mx, my) + studio_nodes.user(layer, win, win.multiuser["users"][user]["username"], mx, my, user) except Exception as e: print(e, "USER RENDERING") @@ -1142,6 +1142,14 @@ def layer(win): win.settings["Undo_Limit"] = 32 settings.write("Undo_Limit", 32) + if win.animations["cameraX"][1] == cx: + win.current["camera_arrived"] = True + else: + win.current["camera_arrived"] = False + + + + # Save story. I'm going to do it the same way as in the old Blender-Organizer if win.url == "story_editor": savenow = False @@ -1153,7 +1161,8 @@ def layer(win): savenow = True elif win.previous["keys"] and not win.current["keys"]: savenow = True - + elif win.current["camera_arrived"] and not win.previous["camera_arrived"]: + savenow = True if savenow: