Skip to content

Commit a2fd2ad

Browse files
committed
fix bugs loading older models (no type) and models without animation
1 parent 3e7db03 commit a2fd2ad

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

scripts/dmodels_animating.dsc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ dmodels_catmullrom_proc:
162162
# FVector C = ( t2-t )/( t2-t1 )*B1 + ( t-t1 )/( t2-t1 )*B2;
163163
- determine <[b1].mul[<[t2].sub[<[t]>].div[<[t2].sub[<[t1]>]>]>].add[<[b2].mul[<[t].sub[<[t1]>].div[<[t2].sub[<[t1]>]>]>]>]>
164164

165-
dmodels_animator:
165+
dmodels_animator_world:
166166
type: world
167167
debug: false
168168
events:

scripts/dmodels_loader.dsc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ dmodels_load_bbmodel:
6161
- define tex_id:++
6262
# =============== Elements loading ===============
6363
- foreach <[data.elements]> as:element:
64-
- if <[element.type]> != cube:
64+
- if <[element.type]||cube> != cube:
6565
- foreach next
6666
- define element.origin <[element.origin].separated_by[,]||0,0,0>
6767
- define element.rotation <[element.rotation].separated_by[,]||0,0,0>
@@ -107,7 +107,8 @@ dmodels_load_bbmodel:
107107
- define animation_list.<[animation.name]>.animators.<[o_uuid]>.frames:->:<[anim_map]>
108108
# Sort frames by time (why is this not done by default? BlockBench is weird)
109109
- define animation_list.<[animation.name]>.animators.<[o_uuid]>.frames <[animation_list.<[animation.name]>.animators.<[o_uuid]>.frames].sort_by_value[get[time]]>
110-
- flag server dmodels_data.animations_<[model_name]>:<[animation_list]>
110+
- if <[animation_list].any||false>:
111+
- flag server dmodels_data.animations_<[model_name]>:<[animation_list]>
111112
# =============== Item model file generation ===============
112113
- if <util.has_file[<[override_item_filepath]>]>:
113114
- ~fileread path:<[override_item_filepath]> save:override_item

scripts/dmodels_main.dsc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# @author mcmonkey
99
# @contributors Max^
1010
# @date 2022/06/01
11-
# @updated 2022/07/06
12-
# @denizen-build REL-1772
11+
# @updated 2022/07/07
12+
# @denizen-build REL-1773
1313
# @script-version 1.4
1414
#
1515
# This takes BlockBench "BBModel" files, converts them to a client-ready resource pack and Denizen internal data,

0 commit comments

Comments
 (0)