fix: animation loading
This commit is contained in:
parent
9fddfe084c
commit
81c9b5fc06
@ -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:
|
||||||
|
@ -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:
|
||||||
|
@ -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)
|
||||||
|
@ -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")
|
||||||
|
|
||||||
|
@ -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:
|
||||||
|
@ -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()
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
@ -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)
|
||||||
|
@ -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")
|
||||||
|
|
||||||
|
@ -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"])
|
||||||
|
@ -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()
|
||||||
|
@ -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:
|
||||||
|
@ -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:
|
||||||
|
@ -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'])
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
@ -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'}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user