feat(rcf): cleanup
This commit is contained in:
@ -27,7 +27,7 @@ except:
|
||||
import message
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
CONNECT_TIMEOUT = 2
|
||||
WAITING_TIME = 0.001
|
||||
@ -277,7 +277,7 @@ def rcf_client_agent(ctx, pipe,queue):
|
||||
# logging.info("{}: received from {}:{},{} {}".format(rcfmsg.key,
|
||||
# server.address, rcfmsg.id, server.port, action))
|
||||
else:
|
||||
logger.info("{} nothing to do".format(agent.id))
|
||||
logger.debug("{} nothing to do".format(agent.id))
|
||||
|
||||
logger.info("exit thread")
|
||||
stop = False
|
||||
|
6
draw.py
6
draw.py
@ -133,6 +133,10 @@ class HUD(object):
|
||||
clients = self.client.get("Client")
|
||||
|
||||
for client in clients:
|
||||
name = client[0].split('/')[1]
|
||||
local_username = bpy.context.scene.session_settings.username
|
||||
|
||||
if name != local_username:
|
||||
try:
|
||||
indices = (
|
||||
(1, 3), (2, 1), (3, 0), (2, 0)
|
||||
@ -141,7 +145,7 @@ class HUD(object):
|
||||
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
||||
position = client[1][b'location']
|
||||
color = client[1][b'color']
|
||||
name = client[0].split('/')[1]
|
||||
|
||||
batch = batch_for_shader(
|
||||
shader, 'LINES', {"pos": position}, indices=indices)
|
||||
|
||||
|
20
operators.py
20
operators.py
@ -68,24 +68,12 @@ def upload_client_instance_position():
|
||||
if client_instance:
|
||||
|
||||
key = "Client/{}".format(username)
|
||||
# key = "Object/Cube"
|
||||
print(key)
|
||||
|
||||
try:
|
||||
current_coords = draw.get_client_view_rect()
|
||||
client = client_instance.get(key)
|
||||
# print((client[0][1][b'location']))
|
||||
|
||||
|
||||
# if data is None:
|
||||
# data = {}
|
||||
# data['location'] = current_coords
|
||||
# color = bpy.context.scene.session_settings.client_instance_color
|
||||
# data['color'] = (color.r, color.g, color.b, 1)
|
||||
# client_instance.push_update(key, 'client_instance', data)
|
||||
|
||||
if current_coords != client[0][1][b'location']:
|
||||
print(current_coords)
|
||||
print(client[0][1][b'location'])
|
||||
# client[0][1][b'color'] = [0,1,1,1]
|
||||
client[0][1][b'location'] = current_coords
|
||||
client_instance.set(key, client[0][1])
|
||||
except:
|
||||
@ -153,7 +141,7 @@ def draw_tick():
|
||||
# refresh_window()
|
||||
# Upload
|
||||
upload_client_instance_position()
|
||||
return 1
|
||||
return .2
|
||||
|
||||
|
||||
def register_ticks():
|
||||
@ -384,7 +372,7 @@ class session_snapview(bpy.types.Operator):
|
||||
bl_description = "Description that shows in blender tooltips"
|
||||
bl_options = {"REGISTER"}
|
||||
|
||||
target_client_instance = bpy.props.StringProperty()
|
||||
target_client = bpy.props.StringProperty()
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
Reference in New Issue
Block a user