fix: collection
This commit is contained in:
parent
1d041dcbdd
commit
727394de5d
@ -31,7 +31,7 @@ DEPENDENCIES = {
|
|||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
logger.setLevel(logging.ERROR)
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
#TODO: refactor config
|
#TODO: refactor config
|
||||||
# UTILITY FUNCTIONS
|
# UTILITY FUNCTIONS
|
||||||
|
@ -33,9 +33,8 @@ class BlCollection(BlDatablock):
|
|||||||
|
|
||||||
for collection in target.children:
|
for collection in target.children:
|
||||||
if collection.uuid not in data["children"]:
|
if collection.uuid not in data["children"]:
|
||||||
target.collection.children.unlink(collection)
|
target.children.unlink(collection)
|
||||||
|
|
||||||
utils.dump_anything.load(target, data)
|
|
||||||
|
|
||||||
def dump(self, pointer=None):
|
def dump(self, pointer=None):
|
||||||
assert(pointer)
|
assert(pointer)
|
||||||
@ -45,6 +44,7 @@ class BlCollection(BlDatablock):
|
|||||||
# dump objects
|
# dump objects
|
||||||
collection_objects = []
|
collection_objects = []
|
||||||
for object in pointer.objects:
|
for object in pointer.objects:
|
||||||
|
if object not in collection_objects:
|
||||||
collection_objects.append(object.uuid)
|
collection_objects.append(object.uuid)
|
||||||
|
|
||||||
data['objects'] = collection_objects
|
data['objects'] = collection_objects
|
||||||
@ -52,6 +52,7 @@ class BlCollection(BlDatablock):
|
|||||||
# dump children collections
|
# dump children collections
|
||||||
collection_children = []
|
collection_children = []
|
||||||
for child in pointer.children:
|
for child in pointer.children:
|
||||||
|
if child not in collection_children:
|
||||||
collection_children.append(child.uuid)
|
collection_children.append(child.uuid)
|
||||||
|
|
||||||
data['children'] = collection_children
|
data['children'] = collection_children
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import bpy
|
import bpy
|
||||||
import mathutils
|
import mathutils
|
||||||
|
import jsondiff
|
||||||
|
|
||||||
from .. import utils
|
from .. import utils
|
||||||
from .. import presence
|
from .. import presence
|
||||||
@ -18,8 +19,8 @@ class BlUser(BlDatablock):
|
|||||||
|
|
||||||
def apply(self):
|
def apply(self):
|
||||||
# super().apply()
|
# super().apply()
|
||||||
# self.data = jsondiff.patch(self.data, self.modifications, marshal=True)
|
self.data = jsondiff.patch(self.data, self.modifications, marshal=True)
|
||||||
# self.modifications = None
|
self.modifications = None
|
||||||
|
|
||||||
if self.pointer:
|
if self.pointer:
|
||||||
self.load(data=self.data, target=self.pointer)
|
self.load(data=self.data, target=self.pointer)
|
||||||
|
@ -6,7 +6,7 @@ import sys
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
logger.setLevel(logging.ERROR)
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
CONFIG_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "config")
|
CONFIG_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "config")
|
||||||
CONFIG = os.path.join(CONFIG_DIR, "app.yaml")
|
CONFIG = os.path.join(CONFIG_DIR, "app.yaml")
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 5f0beee7b8123aad673326bed83d10106d5346b3
|
Subproject commit 307de6fdcfd501a4004516fd6495eefb3fca9b0f
|
@ -22,7 +22,7 @@ from .libs.replication.replication.exception import NonAuthorizedOperationError
|
|||||||
from .libs.replication.replication.interface import Session
|
from .libs.replication.replication.interface import Session
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
logger.setLevel(logging.ERROR)
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
client = None
|
client = None
|
||||||
delayables = []
|
delayables = []
|
||||||
@ -74,7 +74,7 @@ class SessionStartOperator(bpy.types.Operator):
|
|||||||
bpy_factory.register_type(
|
bpy_factory.register_type(
|
||||||
_type.bl_class,
|
_type.bl_class,
|
||||||
_type.bl_rep_class,
|
_type.bl_rep_class,
|
||||||
timer=type_local_config.bl_delay_refresh,
|
timer=0,#type_local_config.bl_delay_refresh
|
||||||
automatic=type_local_config.auto_push)
|
automatic=type_local_config.auto_push)
|
||||||
|
|
||||||
if type_local_config.bl_delay_apply > 0:
|
if type_local_config.bl_delay_apply > 0:
|
||||||
@ -303,7 +303,7 @@ class SessionCommit(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
global client
|
global client
|
||||||
|
# client.get(uuid=target).diff()
|
||||||
client.commit(uuid=self.target)
|
client.commit(uuid=self.target)
|
||||||
client.push(self.target)
|
client.push(self.target)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
@ -13,7 +13,7 @@ from . import environment, presence
|
|||||||
from .libs import dump_anything
|
from .libs import dump_anything
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
logger.setLevel(logging.ERROR)
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
|
|
||||||
def find_from_attr(attr_name, attr_value, list):
|
def find_from_attr(attr_name, attr_value, list):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user