-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* enabled LED keyframe loading, bugs fixed * update animation data when applying changes to position map and control map * bug fixes * clear viewport before importing models, fetch uncompressed glb files instead of draco.glb files * fixed type init in load * display fade in timeline as ld_control_frame keyframes * added models to asset as collections to enable lazy import * add rev keyframe * separate init_control_map from load * change alpha display, minor fixes * enabled lazy loading, revision management (untested) * fixed iteration bug * add ld_model_name bpy prop
- Loading branch information
1 parent
68809aa
commit 5b3e443
Showing
15 changed files
with
962 additions
and
754 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
from typing import List | ||
|
||
import bpy | ||
|
||
from ....properties.revision import KeyframeRevisionItem | ||
from ...models import ControlMap, MapID, PosMap | ||
from .animation_data import ( | ||
add_single_ctrl_keyframe, | ||
add_single_pos_keyframe, | ||
delete_single_ctrl_keyframe, | ||
delete_single_pos_keyframe, | ||
edit_single_ctrl_keyframe, | ||
edit_single_pos_keyframe, | ||
) | ||
|
||
|
||
def update_rev_changes(incoming_pos_map: PosMap, incoming_control_map: ControlMap): | ||
# position | ||
local_rev: List[KeyframeRevisionItem] = getattr(bpy.context.scene, "ld_pos_rev") | ||
incoming_rev = {id: element.rev for id, element in incoming_pos_map.items()} | ||
for rev in local_rev: | ||
local_id: MapID = rev.frame_id | ||
if local_id not in incoming_rev.keys(): # delete | ||
delete_single_pos_keyframe(local_id, rev.frame_start) | ||
del incoming_rev[local_id] | ||
else: | ||
incoming_rev_item = incoming_rev[local_id] | ||
if incoming_rev_item: | ||
if ( | ||
incoming_rev_item.data == rev.data | ||
and incoming_rev_item.meta == rev.meta | ||
and rev.data > 0 | ||
and rev.meta > 0 | ||
): # local animation data matches incoming | ||
continue | ||
else: | ||
edit_single_pos_keyframe(local_id, incoming_pos_map[rev.frame_id]) | ||
del incoming_rev[local_id] | ||
for id in incoming_rev.keys(): | ||
add_single_pos_keyframe(id, incoming_pos_map[id]) | ||
# control | ||
local_rev: List[KeyframeRevisionItem] = getattr(bpy.context.scene, "ld_ctrl_rev") | ||
incoming_rev = {id: element.rev for id, element in incoming_pos_map.items()} | ||
for rev in local_rev: | ||
local_id: MapID = rev.frame_id | ||
if local_id not in incoming_rev.keys(): # delete | ||
delete_single_ctrl_keyframe(local_id, rev.frame_start) | ||
del incoming_rev[local_id] | ||
else: | ||
incoming_rev_item = incoming_rev[local_id] | ||
if incoming_rev_item: | ||
if ( | ||
incoming_rev_item.data == rev.data | ||
and incoming_rev_item.meta == rev.meta | ||
and rev.data > 0 | ||
and rev.meta > 0 | ||
): # local animation data matches incoming | ||
continue | ||
else: | ||
edit_single_ctrl_keyframe( | ||
local_id, incoming_control_map[rev.frame_id] | ||
) | ||
del incoming_rev[local_id] | ||
for id in incoming_rev.keys(): | ||
add_single_ctrl_keyframe(id, incoming_control_map[id]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.