From c2d2db78e6cb2aa4529c67f5e8701dd7989ab3c1 Mon Sep 17 00:00:00 2001 From: Swann Date: Tue, 1 Jun 2021 15:47:05 +0200 Subject: [PATCH] refactor: temporary remove name resolution --- multi_user/bl_types/bl_action.py | 5 +---- multi_user/bl_types/bl_camera.py | 7 +------ multi_user/bl_types/bl_collection.py | 7 +------ multi_user/bl_types/bl_curve.py | 7 +------ multi_user/bl_types/bl_font.py | 7 +------ multi_user/bl_types/bl_gpencil.py | 7 +------ multi_user/bl_types/bl_image.py | 7 +------ multi_user/bl_types/bl_lattice.py | 7 +------ multi_user/bl_types/bl_light.py | 7 +------ multi_user/bl_types/bl_lightprobe.py | 7 +------ multi_user/bl_types/bl_material.py | 8 +------- multi_user/bl_types/bl_mesh.py | 7 +------ multi_user/bl_types/bl_metaball.py | 7 +------ multi_user/bl_types/bl_node_group.py | 7 +------ multi_user/bl_types/bl_object.py | 7 +------ multi_user/bl_types/bl_particle.py | 7 +------ multi_user/bl_types/bl_sound.py | 7 +------ multi_user/bl_types/bl_speaker.py | 7 +------ multi_user/bl_types/bl_texture.py | 7 +------ multi_user/bl_types/bl_volume.py | 7 +------ multi_user/bl_types/bl_world.py | 7 +------ 21 files changed, 21 insertions(+), 125 deletions(-) diff --git a/multi_user/bl_types/bl_action.py b/multi_user/bl_types/bl_action.py index d8e7883..30dad1d 100644 --- a/multi_user/bl_types/bl_action.py +++ b/multi_user/bl_types/bl_action.py @@ -317,10 +317,7 @@ class BlAction(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.actions) - if datablock is None: - bpy.data.actions.get(name) + return resolve_datablock_from_uuid(uuid, bpy.data.actions) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_camera.py b/multi_user/bl_types/bl_camera.py index cdc3049..679684f 100644 --- a/multi_user/bl_types/bl_camera.py +++ b/multi_user/bl_types/bl_camera.py @@ -129,12 +129,7 @@ class BlCamera(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.cameras) - if datablock is None: - datablock = bpy.data.cameras.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.cameras) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_collection.py b/multi_user/bl_types/bl_collection.py index e79dfd2..4cdfd79 100644 --- a/multi_user/bl_types/bl_collection.py +++ b/multi_user/bl_types/bl_collection.py @@ -133,12 +133,7 @@ class BlCollection(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.collections) - if datablock is None: - datablock = bpy.data.collections.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.collections) @staticmethod diff --git a/multi_user/bl_types/bl_curve.py b/multi_user/bl_types/bl_curve.py index 8a071f1..09deee6 100644 --- a/multi_user/bl_types/bl_curve.py +++ b/multi_user/bl_types/bl_curve.py @@ -232,12 +232,7 @@ class BlCurve(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.curves) - if datablock is None: - datablock = bpy.data.curves.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.curves) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_font.py b/multi_user/bl_types/bl_font.py index 9ff627f..dd0b1c1 100644 --- a/multi_user/bl_types/bl_font.py +++ b/multi_user/bl_types/bl_font.py @@ -65,12 +65,7 @@ class BlFont(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.fonts) - if datablock is None: - datablock = bpy.data.fonts.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.fonts) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_gpencil.py b/multi_user/bl_types/bl_gpencil.py index c797b32..a2a81d5 100644 --- a/multi_user/bl_types/bl_gpencil.py +++ b/multi_user/bl_types/bl_gpencil.py @@ -307,12 +307,7 @@ class BlGpencil(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.grease_pencils) - if datablock is None: - datablock = bpy.data.grease_pencils.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.grease_pencils) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_image.py b/multi_user/bl_types/bl_image.py index fea93dc..b0885ca 100644 --- a/multi_user/bl_types/bl_image.py +++ b/multi_user/bl_types/bl_image.py @@ -103,12 +103,7 @@ class BlImage(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.images) - if datablock is None: - datablock = bpy.data.images.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.images) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_lattice.py b/multi_user/bl_types/bl_lattice.py index 3c4af0c..47c6d71 100644 --- a/multi_user/bl_types/bl_lattice.py +++ b/multi_user/bl_types/bl_lattice.py @@ -77,12 +77,7 @@ class BlLattice(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.lattices) - if datablock is None: - datablock = bpy.data.lattices.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.lattices) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_light.py b/multi_user/bl_types/bl_light.py index 08cc83d..568eb20 100644 --- a/multi_user/bl_types/bl_light.py +++ b/multi_user/bl_types/bl_light.py @@ -81,12 +81,7 @@ class BlLight(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.lights) - if datablock is None: - datablock = bpy.data.lights.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.lights) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_lightprobe.py b/multi_user/bl_types/bl_lightprobe.py index b21d57a..1d222a7 100644 --- a/multi_user/bl_types/bl_lightprobe.py +++ b/multi_user/bl_types/bl_lightprobe.py @@ -78,12 +78,7 @@ class BlLightprobe(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.lightprobes) - if datablock is None: - datablock = bpy.data.lightprobes.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.lightprobes) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_material.py b/multi_user/bl_types/bl_material.py index 0ee68ab..0301941 100644 --- a/multi_user/bl_types/bl_material.py +++ b/multi_user/bl_types/bl_material.py @@ -501,13 +501,7 @@ class BlMaterial(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.materials) - if datablock is None: - datablock = bpy.data.materials.get(name) - - return datablock - + return resolve_datablock_from_uuid(uuid, bpy.data.materials) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_mesh.py b/multi_user/bl_types/bl_mesh.py index 8e13b03..f241c6e 100644 --- a/multi_user/bl_types/bl_mesh.py +++ b/multi_user/bl_types/bl_mesh.py @@ -189,12 +189,7 @@ class BlMesh(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.meshes) - if datablock is None: - datablock = bpy.data.meshes.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.meshes) @staticmethod def needs_update(datablock: object, data: dict) -> bool: diff --git a/multi_user/bl_types/bl_metaball.py b/multi_user/bl_types/bl_metaball.py index 9e37665..54c6fce 100644 --- a/multi_user/bl_types/bl_metaball.py +++ b/multi_user/bl_types/bl_metaball.py @@ -113,12 +113,7 @@ class BlMetaball(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.metaballs) - if datablock is None: - datablock = bpy.data.metaballs.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.metaballs) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_node_group.py b/multi_user/bl_types/bl_node_group.py index b9247e3..d6e6dd6 100644 --- a/multi_user/bl_types/bl_node_group.py +++ b/multi_user/bl_types/bl_node_group.py @@ -49,12 +49,7 @@ class BlNodeGroup(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.node_groups) - if datablock is None: - datablock = bpy.data.node_groups.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.node_groups) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_object.py b/multi_user/bl_types/bl_object.py index 7a75d09..fccc337 100644 --- a/multi_user/bl_types/bl_object.py +++ b/multi_user/bl_types/bl_object.py @@ -772,12 +772,7 @@ class BlObject(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.objects) - if datablock is None: - datablock = bpy.data.objects.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.objects) _type = bpy.types.Object _class = BlObject \ No newline at end of file diff --git a/multi_user/bl_types/bl_particle.py b/multi_user/bl_types/bl_particle.py index b1ca6c7..e7fdb35 100644 --- a/multi_user/bl_types/bl_particle.py +++ b/multi_user/bl_types/bl_particle.py @@ -92,12 +92,7 @@ class BlParticle(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.particles) - if datablock is None: - datablock = bpy.data.particles.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.particles) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_sound.py b/multi_user/bl_types/bl_sound.py index 576a11f..7550fab 100644 --- a/multi_user/bl_types/bl_sound.py +++ b/multi_user/bl_types/bl_sound.py @@ -71,12 +71,7 @@ class BlSound(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.sounds) - if datablock is None: - datablock = bpy.data.sounds.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.sounds) @staticmethod def needs_update(datablock: object, data:dict)-> bool: diff --git a/multi_user/bl_types/bl_speaker.py b/multi_user/bl_types/bl_speaker.py index afd4f51..81170b3 100644 --- a/multi_user/bl_types/bl_speaker.py +++ b/multi_user/bl_types/bl_speaker.py @@ -68,12 +68,7 @@ class BlSpeaker(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.speakers) - if datablock is None: - datablock = bpy.data.speakers.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.speakers) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_texture.py b/multi_user/bl_types/bl_texture.py index 9eb70e0..0c40b88 100644 --- a/multi_user/bl_types/bl_texture.py +++ b/multi_user/bl_types/bl_texture.py @@ -71,12 +71,7 @@ class BlTexture(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.textures) - if datablock is None: - datablock = bpy.data.textures.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.textures) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_volume.py b/multi_user/bl_types/bl_volume.py index 612cdc0..b96fb1d 100644 --- a/multi_user/bl_types/bl_volume.py +++ b/multi_user/bl_types/bl_volume.py @@ -76,12 +76,7 @@ class BlVolume(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.volumes) - if datablock is None: - datablock = bpy.data.volumes.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.volumes) @staticmethod def resolve_deps(datablock: object) -> [object]: diff --git a/multi_user/bl_types/bl_world.py b/multi_user/bl_types/bl_world.py index c9490e3..89ba01c 100644 --- a/multi_user/bl_types/bl_world.py +++ b/multi_user/bl_types/bl_world.py @@ -71,12 +71,7 @@ class BlWorld(ReplicatedDatablock): @staticmethod def resolve(data: dict) -> object: uuid = data.get('uuid') - name = data.get('name') - datablock = resolve_datablock_from_uuid(uuid, bpy.data.worlds) - if datablock is None: - datablock = bpy.data.worlds.get(name) - - return datablock + return resolve_datablock_from_uuid(uuid, bpy.data.worlds) @staticmethod def resolve_deps(datablock: object) -> [object]: