Skip to content

Commit 137e831

Browse files
committed
Merge branch 'experimental'
2 parents 9e4a4ac + 0d957df commit 137e831

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/modelDataFixerUpper.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { openUnexpectedErrorDialog } from './ui/popups/unexpectedError'
44
export function process(model: any) {
55
if (model.meta.model_format === 'animatedJava/ajmodel') {
66
model.meta.model_format = 'animated_java/ajmodel'
7-
model.meta.format_version = '0.2.4'
7+
model.meta.format_version = '0.0'
88
}
9+
console.log('Processing model', JSON.parse(JSON.stringify(model)))
910

1011
const needsUpgrade = compareVersions(FORMAT_VERSION, model.meta.format_version)
1112
if (!needsUpgrade) return
@@ -39,16 +40,14 @@ export function process(model: any) {
3940

4041
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars
4142
function updateModelTo0_3_10(model: any) {
42-
console.log('Processing model for AJ 0.3.10')
43+
console.log('Processing model for AJ 0.3.10', JSON.parse(JSON.stringify(model)))
4344
}
4445

4546
// eslint-disable-next-line @typescript-eslint/naming-convention
4647
function updateModelTo1_4(model: any) {
47-
console.log('Processing model format 1.4')
48-
if (
49-
model.animated_java.exporter_settings['animated_java:datapack_exporter']
50-
.outdated_rig_warning !== undefined
51-
) {
48+
console.log('Processing model format 1.4', JSON.parse(JSON.stringify(model)))
49+
const exporter = model.animated_java.exporter_settings['animated_java:datapack_exporter']
50+
if (exporter && exporter.outdated_rig_warning !== undefined) {
5251
model.animated_java.exporter_settings[
5352
'animated_java:datapack_exporter'
5453
].enable_outdated_rig_warning =
@@ -62,7 +61,7 @@ function updateModelTo1_4(model: any) {
6261

6362
// eslint-disable-next-line @typescript-eslint/naming-convention
6463
function updateModelTo1_3(model: any) {
65-
console.log('Processing model format 1.3')
64+
console.log('Processing model format 1.3', JSON.parse(JSON.stringify(model)))
6665
if (model.animated_java.settings.exporter === 'animated_java:animation_exporter') {
6766
model.animated_java.settings.exporter = 'animated_java:datapack_exporter'
6867
}
@@ -75,7 +74,7 @@ function updateModelTo1_3(model: any) {
7574

7675
// eslint-disable-next-line @typescript-eslint/naming-convention
7776
function updateModelTo1_2(model: any) {
78-
console.log('Processing model format 1.2')
77+
console.log('Processing model format 1.2', JSON.parse(JSON.stringify(model)))
7978
for (const variant of model.animated_java.variants) {
8079
for (const [from, to] of Object.entries(variant.textureMap as Record<string, string>)) {
8180
const fromUUID = from.split('::')[0]
@@ -88,19 +87,20 @@ function updateModelTo1_2(model: any) {
8887

8988
// eslint-disable-next-line @typescript-eslint/naming-convention
9089
function updateModelTo1_1(model: any) {
91-
console.log('Processing model format 1.1')
90+
console.log('Processing model format 1.1', JSON.parse(JSON.stringify(model)))
9291
model.animated_java.settings.resource_pack_mcmeta =
9392
model.animated_java.settings.resource_pack_folder
9493
delete model.animated_java.settings.resource_pack_folder
9594
const animationExporterSettings =
9695
model.animated_java.exporter_settings['animated_java:animation_exporter']
96+
if (!animationExporterSettings) return
9797
animationExporterSettings.datapack_mcmeta = animationExporterSettings.datapack_folder
9898
delete animationExporterSettings.datapack_folder
9999
}
100100

101101
// eslint-disable-next-line @typescript-eslint/naming-convention
102102
function updateModelTo1_0(model: any) {
103-
console.log('Processing model format 1.0')
103+
console.log('Processing model format 1.0', JSON.parse(JSON.stringify(model)))
104104
if (model.meta.settings) {
105105
console.log('Upgrading settings...')
106106
const animatedJava: IAnimatedJavaModel['animated_java'] = {

0 commit comments

Comments
 (0)