fix: animation loading

This commit is contained in:
Swann 2021-05-21 23:02:42 +02:00
parent 9fddfe084c
commit 81c9b5fc06
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB
16 changed files with 16 additions and 16 deletions

View File

@ -122,7 +122,7 @@ class BlArmature(ReplicatedDatablock):
if 'EDIT' in current_mode: if 'EDIT' in current_mode:
bpy.ops.object.mode_set(mode='EDIT') bpy.ops.object.mode_set(mode='EDIT')
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
@staticmethod @staticmethod
def dump(datablock: object) -> dict: def dump(datablock: object) -> dict:

View File

@ -45,7 +45,7 @@ class BlCamera(ReplicatedDatablock):
dof_settings = data.get('dof') dof_settings = data.get('dof')
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
# DOF settings # DOF settings
if dof_settings: if dof_settings:

View File

@ -149,7 +149,7 @@ class BlCurve(ReplicatedDatablock):
@staticmethod @staticmethod
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
loader = Loader() loader = Loader()
loader.load(datablock, data) loader.load(datablock, data)

View File

@ -41,7 +41,7 @@ class BlLattice(ReplicatedDatablock):
@staticmethod @staticmethod
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
if datablock.is_editmode: if datablock.is_editmode:
raise ContextError("lattice is in edit mode") raise ContextError("lattice is in edit mode")

View File

@ -42,7 +42,7 @@ class BlLight(ReplicatedDatablock):
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
loader = Loader() loader = Loader()
loader.load(datablock, data) loader.load(datablock, data)
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
@staticmethod @staticmethod
def dump(datablock: object) -> dict: def dump(datablock: object) -> dict:

View File

@ -409,7 +409,7 @@ class BlMaterial(ReplicatedDatablock):
@staticmethod @staticmethod
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
loader = Loader() loader = Loader()

View File

@ -70,7 +70,7 @@ class BlMesh(ReplicatedDatablock):
if not datablock or datablock.is_editmode: if not datablock or datablock.is_editmode:
raise ContextError raise ContextError
else: else:
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
loader = Loader() loader = Loader()
loader.load(datablock, data) loader.load(datablock, data)

View File

@ -77,7 +77,7 @@ class BlMetaball(ReplicatedDatablock):
@staticmethod @staticmethod
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
loader = Loader() loader = Loader()
loader.load(datablock, data) loader.load(datablock, data)

View File

@ -474,7 +474,7 @@ class BlObject(ReplicatedDatablock):
@staticmethod @staticmethod
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
loader = Loader() loader = Loader()
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
data_uuid = data.get("data_uuid") data_uuid = data.get("data_uuid")
data_id = data.get("data") data_id = data.get("data")

View File

@ -53,7 +53,7 @@ class BlParticle(ReplicatedDatablock):
@staticmethod @staticmethod
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
dump_anything.load(datablock, data) dump_anything.load(datablock, data)
dump_anything.load(datablock.effector_weights, data["effector_weights"]) dump_anything.load(datablock.effector_weights, data["effector_weights"])

View File

@ -386,7 +386,7 @@ class BlScene(ReplicatedDatablock):
@staticmethod @staticmethod
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
# Load other meshes metadata # Load other meshes metadata
loader = Loader() loader = Loader()

View File

@ -35,7 +35,7 @@ class BlSpeaker(ReplicatedDatablock):
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
loader = Loader() loader = Loader()
loader.load(datablock, data) loader.load(datablock, data)
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
@staticmethod @staticmethod
def construct(data: dict) -> object: def construct(data: dict) -> object:

View File

@ -36,7 +36,7 @@ class BlTexture(ReplicatedDatablock):
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
loader = Loader() loader = Loader()
loader.load(datablock, data) loader.load(datablock, data)
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
@staticmethod @staticmethod
def construct(data: dict) -> object: def construct(data: dict) -> object:

View File

@ -63,7 +63,7 @@ class BlVolume(ReplicatedDatablock):
@staticmethod @staticmethod
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
loader = Loader() loader = Loader()
loader.load(datablock, data) loader.load(datablock, data)
loader.load(datablock.display, data['display']) loader.load(datablock.display, data['display'])

View File

@ -42,7 +42,7 @@ class BlWorld(ReplicatedDatablock):
@staticmethod @staticmethod
def load(data: dict, datablock: object): def load(data: dict, datablock: object):
load_animation_data(datablock.get('animation_data'), datablock) load_animation_data(data.get('animation_data'), datablock)
loader = Loader() loader = Loader()
loader.load(datablock, data) loader.load(datablock, data)

View File

@ -554,7 +554,7 @@ class SessionSnapTimeOperator(bpy.types.Operator):
def modal(self, context, event): def modal(self, context, event):
is_running = context.window_manager.session.user_snap_running is_running = context.window_manager.session.user_snap_running
if event.type in {'RIGHTMOUSE', 'ESC'} or not is_running: if not is_running:
self.cancel(context) self.cancel(context)
return {'CANCELLED'} return {'CANCELLED'}