diff --git a/SerializePropertyGroup.py b/SerializePropertyGroup.py deleted file mode 100644 index 6269412..0000000 --- a/SerializePropertyGroup.py +++ /dev/null @@ -1,22 +0,0 @@ -import sys -import os - - -thirdPartyDir = "C:\\Users\\slumber\\repos\\phd\src\\2019_rcf\\libs" - - - -if thirdPartyDir not in sys.path: - print('Adding local modules dir to the path') - sys.path.insert(0, thirdPartyDir) - - -import umsgpack -import bpy -import esper -from rna_xml import rna2xml - -try: - umsgpack.packb((getattr(bpy.data,'objects'))) -except: - pass \ No newline at end of file diff --git a/__init__.py b/__init__.py deleted file mode 100644 index 59a19d9..0000000 --- a/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -import bpy -bl_info = { - "name": "Sprite preview", - "author": "Cube Animation", - "version": (1, 0), - "blender": (2, 80, 0), - "location": "Properties > Object > Sprite Components", - "description": "Manage sprite components in blender", - "warning": "", - "wiki_url": "", - "category": "Cube Animation", -} - - -def register(): - pass - - -def unregister(): - pass diff --git a/dump_rna2xml.py b/dump_rna2xml.py deleted file mode 100644 index 0358dde..0000000 --- a/dump_rna2xml.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python3 - -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# Contributor(s): Campbell Barton -# -# ***** END GPL LICENSE BLOCK ***** - -# - -# This script dumps rna into xml. -# useful for finding bugs in RNA api. - -# Example usage -# blender some.blend --background -noaudio --python intern/tools/dump_rna2xml.py - -import os -import bpy -import rna_xml - - -def main(): - filename = os.path.splitext(bpy.data.filepath)[0] + ".xml" - - file = open(filename, 'w') - - if 1: - # blend file - rna_xml.rna2xml(file.write, - root_rna=bpy.data, - root_rna_skip={"window_managers"}) - else: - # theme. just another test - rna_xml.rna2xml(file.write, - root_rna=bpy.context.user_preferences.themes[0], - method='ATTR') - - file.close() - - # read back to ensure this is valid! - from xml.dom.minidom import parse - xml_nodes = parse(filename) - print("Written:", filename) - - # test reading back theme - if 1: - theme = xml_nodes.getElementsByTagName("Theme")[0] - rna_xml.xml2rna(theme, - root_rna=bpy.context.user_preferences.themes[0],) - -if __name__ == "__main__": - main() diff --git a/img/basic.png b/img/basic.png deleted file mode 100644 index 48395ef..0000000 Binary files a/img/basic.png and /dev/null differ diff --git a/main.py b/main.py deleted file mode 100644 index a4a554f..0000000 --- a/main.py +++ /dev/null @@ -1,53 +0,0 @@ -import net_systems -import replication_system -import net_components -from libs.esper import esper -import zmq -import sys -import argparse -import time - -# TODO: Implement a manager class for each aspect (ex: Network_Manager) -# TODO: Is it right to implement server-client as ESC ?... -def main(): - # Argument parsing - parser = argparse.ArgumentParser( - description='Launch an instance of collaboration system') - parser.add_argument('-r', choices=list(net_components.Role), - type=net_components.Role, help='role for the instance ') - - args = parser.parse_args() - - instance_role = args.r - instance_context = zmq.Context() - - print("Starting a {} instance \n".format(instance_role)) - - # Create a World instance to hold everything: - world = esper.World() - - # Instantiate a Processor (or more), and add them to the world: - world.add_processor(net_systems.SessionSystem()) - world.add_processor(replication_system.ReplicationSystem()) - - # Instanciate a session entity - session = world.create_entity() - - world.add_component( - session, net_components.NetworkInterface(context=instance_context)) - world.add_component( - session, net_components.User(role=instance_role)) - - - # A dummy main loop: - try: - while True: - # Call world.process() to run all Processors. - world.process() - time.sleep(1) - except KeyboardInterrupt: - return - - -if __name__ == '__main__': - main() diff --git a/net_components.py b/net_components.py deleted file mode 100644 index a9a9311..0000000 --- a/net_components.py +++ /dev/null @@ -1,43 +0,0 @@ -import zmq -# from zmq.asyncio import Context, ZMQEventLoop -# import asyncio -from enum import Enum, auto - -class Role(Enum): - NONE = 'NONE' - SERVER = 'SERVER' - CLIENT = 'CLIENT' - - def __str__(self): - return self.value - -class Replication(Enum): - NONE = auto() - REPLICATED = auto() - REPNOTIFY = auto() - -class User: - def __init__(self, name="default", ip="localhost",role=Role.NONE): - self.name = name - self.role = role - -class NetworkInterface: - def __init__(self, host="*",context=None, socket_type=zmq.REP,protocol='tcp',port=5555): - self.host = host - self.context = context - self.socket = context.socket(socket_type) - - #TODO: Is this right to it here? - print("{}://{}:{}".format(protocol,host,port)) - self.socket.bind("tcp://*:5555") - -class Property: - def __init__(self, property=None, replication=Replication.NONE): - self.property = property - self.replication = replication - -class Function: - def __init__(self, function=None): - self.function = function - - diff --git a/net_systems.py b/net_systems.py deleted file mode 100644 index 73793c4..0000000 --- a/net_systems.py +++ /dev/null @@ -1,45 +0,0 @@ -import time -import asyncio - -import zmq -import zmq.asyncio - -import net_components -from libs.esper import esper - - -class SessionSystem(esper.Processor): - """ - Handle Client-Server session managment - """ - - def __init__(self): - super().__init__() - # Initialize poll set - - - # TODO: Use zmq_poll.. - def process(self): - # This will iterate over every Entity that has BOTH of these components: - for ent, (net_interface, user) in self.world.get_components(net_components.NetworkInterface,net_components.User): - if user.role is net_components.Role.SERVER: - print("Server loops") - try: - message = net_interface.socket.recv() - print("test") - except KeyboardInterrupt: - break - - print("test") - - if user.role is net_components.Role.CLIENT: - # Send reply back to client - socket.send(b"Hello") - - @asyncio.coroutine - def recv_and_process(): - sock = ctx.socket(zmq.PULL) - sock.bind(url) - msg = yield from sock.recv_multipart() # waits for msg to be ready - reply = yield from async_process(msg) - yield from sock.send_multipart(reply) diff --git a/replication_system.py b/replication_system.py deleted file mode 100644 index 624c994..0000000 --- a/replication_system.py +++ /dev/null @@ -1,18 +0,0 @@ -import zmq - -from libs.esper import esper - -class ReplicationSystem(esper.Processor): - """ - Handle Client-Server session managment - """ - - def __init__(self): - super().__init__() - # Initialize poll set - - - # TODO: Use zmq_poll.. - async def process(self): - # This will iterate over every Entity that has BOTH of these components: - print("test") \ No newline at end of file