Skip to content

Commit 3ed4098

Browse files
committed
🚧 Add edge-case redundancy to getAnimationNodes
1 parent 699eede commit 3ed4098

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
- [x] Figure out how cameras will work.
106106
- [x] See how much swapping to a static list of UUIDs for selecting bones effects performance.
107107
- [x] Split up animation storage data command to avoid command length limit.
108-
- [ ] Check for references to non-existant functions in merged function tags, and remove them.
108+
- [x] Check for references to non-existant functions in merged function tags, and remove them.
109109
- [ ] When applying variants, remove / replace any bones that have / had no elements with textured faces.
110110

111111
# Resource Pack

src/systems/animationRenderer.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,14 @@ export function getAnimationNodes(
117117
keyframeCache = new Map()
118118
for (const [uuid, node] of Object.entries(nodeMap)) {
119119
const animator = animation.getBoneAnimator(node.node)
120-
const keyframeMap = new Map(animator.keyframes.map(kf => [kf.time, kf]))
120+
const keyframeMap = animator.keyframes
121+
? new Map(animator.keyframes.map(kf => [kf.time, kf]))
122+
: new Map<number, _Keyframe>()
121123
keyframeCache.set(uuid, keyframeMap)
122124
}
123-
excludedNodesCache = new Set(animation.excluded_nodes.map(b => b.value))
125+
excludedNodesCache = new Set(
126+
animation.excluded_nodes ? animation.excluded_nodes.map(b => b.value) : []
127+
)
124128
}
125129
const nodes: IAnimationNode[] = []
126130

test_blueprints/armor_stand.ajblueprint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"show_bounding_box": false,
1212
"auto_bounding_box": true,
1313
"bounding_box": [95, 32],
14-
"enable_plugin_mode": true,
14+
"enable_plugin_mode": false,
1515
"resource_pack_export_mode": "raw",
1616
"data_pack_export_mode": "raw",
1717
"display_item": "minecraft:white_dye",

0 commit comments

Comments
 (0)