Ejemplo n.º 1
0
def join_room(room_name: str, vrtist_protocol: bool = False, shared_folders=None, ignore_version_check: bool = False):
    prefs = get_mixer_prefs()
    logger.warning(f"join: room: {room_name}, user: {prefs.user}")

    for line in tech_infos():
        logger.warning(line)

    assert share_data.client.current_room is None
    share_data.session_id += 1
    # todo tech debt -> current_room should be set when JOIN_ROOM is received
    # todo _joining_room_name should be set in client timer
    share_data.client.current_room = room_name
    share_data.client._joining_room_name = room_name
    set_client_attributes()
    blender_version = bpy.app.version_string
    mixer_version = mixer.display_version
    share_data.client.join_room(room_name, blender_version, mixer_version, ignore_version_check, not vrtist_protocol)

    if shared_folders is None:
        shared_folders = []
    share_data.init_protocol(vrtist_protocol, shared_folders)
    share_data.pending_test_update = False

    # join a room <==> want to track local changes
    HandlerManager.set_handlers(True)
Ejemplo n.º 2
0
def join_room(room_name: str):
    logger.info("join_room")

    assert share_data.client.current_room is None
    BlendData.instance().reset()
    share_data.session_id += 1
    # todo tech debt -> current_room should be set when JOIN_ROOM is received
    # todo _joining_room_name should be set in client timer
    share_data.client.current_room = room_name
    share_data.client._joining_room_name = room_name
    set_client_attributes()
    share_data.client.join_room(room_name)
    share_data.client.send_set_current_scene(bpy.context.scene.name_full)

    share_data.current_statistics = {
        "session_id": share_data.session_id,
        "blendfile": bpy.data.filepath,
        "statsfile": get_stats_filename(share_data.run_id,
                                        share_data.session_id),
        "user": get_mixer_prefs().user,
        "room": room_name,
        "children": {},
    }
    prefs = get_mixer_prefs()
    share_data.auto_save_statistics = prefs.auto_save_statistics
    share_data.statistics_directory = prefs.statistics_directory
    share_data.set_experimental_sync(prefs.experimental_sync)
    share_data.pending_test_update = False

    # join a room <==> want to track local changes
    HandlerManager.set_handlers(True)
Ejemplo n.º 3
0
def leave_current_room():
    logger.info("leave_current_room")

    if share_data.client and share_data.client.current_room:
        share_data.leave_current_room()
        HandlerManager.set_handlers(False)

    share_data.clear_before_state()
Ejemplo n.º 4
0
def leave_current_room():
    logger.info("leave_current_room")

    if share_data.client and share_data.client.current_room:
        share_data.leave_current_room()
        HandlerManager.set_handlers(False)

    share_data.clear_before_state()

    if share_data.current_statistics is not None and share_data.auto_save_statistics:
        save_statistics(share_data.current_statistics,
                        share_data.statistics_directory)
    share_data.current_statistics = None
    share_data.auto_save_statistics = False
    share_data.statistics_directory = None
Ejemplo n.º 5
0
def join_room(room_name: str, vrtist_protocol: bool = False):
    prefs = get_mixer_prefs()
    logger.warning(f"join: room: {room_name}, user: {prefs.user}")

    for line in tech_infos():
        logger.warning(line)

    assert share_data.client.current_room is None
    share_data.session_id += 1
    # todo tech debt -> current_room should be set when JOIN_ROOM is received
    # todo _joining_room_name should be set in client timer
    share_data.client.current_room = room_name
    share_data.client._joining_room_name = room_name
    set_client_attributes()
    share_data.client.join_room(room_name)
    share_data.client.send_set_current_scene(bpy.context.scene.name_full)

    share_data.set_vrtist_protocol(vrtist_protocol)
    share_data.pending_test_update = False

    # join a room <==> want to track local changes
    HandlerManager.set_handlers(True)