Skip to content

Commit e22ab17

Browse files
committed
Fixed face_tint not working on AJ models
1 parent 059d79c commit e22ab17

File tree

8 files changed

+353
-64
lines changed

8 files changed

+353
-64
lines changed

debug_resourcepack/armor_stand.ajmodel

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
22
"meta": {
33
"format_version": "0.0",
4-
"creation_time": 1641638350,
4+
"creation_time": 1641650938,
55
"model_format": "animated_java/ajmodel",
66
"box_uv": false,
77
"settings": {
88
"animatedJava": {
99
"projectName": "armor_stand",
1010
"exporter": "animationExporter",
11-
"rigItem": "minecraft:white_dye",
11+
"verbose": false,
12+
"rigItem": "minecraft:leather_horse_armor",
1213
"rigModelsExportFolder": "C:\\Users\\Snave\\AppData\\Roaming\\.minecraft\\resourcepacks\\Animated Java Testing\\assets\\animated_java\\models\\rigs\\armor_stand",
13-
"predicateFilePath": "C:\\Users\\Snave\\AppData\\Roaming\\.minecraft\\resourcepacks\\Animated Java Testing\\assets\\minecraft\\models\\item\\white_dye.json",
14+
"predicateFilePath": "C:\\Users\\Snave\\AppData\\Roaming\\.minecraft\\resourcepacks\\Animated Java Testing\\assets\\minecraft\\models\\item\\leather_horse_armor.json",
1415
"transparentTexturePath": "C:\\Users\\Snave\\AppData\\Roaming\\.minecraft\\resourcepacks\\Animated Java Testing\\assets\\minecraft\\textures\\transparent.png"
1516
},
1617
"animatedJava_exporter_statueExporter": {
@@ -29,8 +30,8 @@
2930
"dataPackPath": ""
3031
},
3132
"animatedJava_exporter_animationExporter": {
32-
"rootEntityType": "minecraft:husk",
33-
"rootEntityNbt": "{Silent:true,ActiveEffects:[{Id:14b,Amplifier:0b,Duration:11111111,ShowParticles:0b}]}",
33+
"rootEntityType": "minecraft:marker",
34+
"rootEntityNbt": "{}",
3435
"markerArmorStands": false,
3536
"autoDistance": true,
3637
"autoDistanceMovementThreshold": 1,
@@ -200,6 +201,7 @@
200201
15,
201202
32
202203
],
204+
"tint": 0,
203205
"texture": 0
204206
},
205207
"east": {
@@ -209,6 +211,7 @@
209211
3,
210212
32
211213
],
214+
"tint": 0,
212215
"texture": 0
213216
},
214217
"south": {
@@ -218,6 +221,7 @@
218221
30,
219222
32
220223
],
224+
"tint": 0,
221225
"texture": 0
222226
},
223227
"west": {
@@ -227,6 +231,7 @@
227231
18,
228232
32
229233
],
234+
"tint": 0,
230235
"texture": 0
231236
},
232237
"up": {
@@ -236,6 +241,7 @@
236241
3,
237242
26
238243
],
244+
"tint": 0,
239245
"texture": 0
240246
},
241247
"down": {
@@ -245,6 +251,7 @@
245251
15,
246252
29
247253
],
254+
"tint": 0,
248255
"texture": 0
249256
}
250257
},
@@ -617,6 +624,7 @@
617624
52,
618625
25
619626
],
627+
"tint": 0,
620628
"texture": 0
621629
},
622630
"east": {
@@ -626,6 +634,7 @@
626634
50,
627635
25
628636
],
637+
"tint": 0,
629638
"texture": 0
630639
},
631640
"south": {
@@ -635,6 +644,7 @@
635644
56,
636645
25
637646
],
647+
"tint": 0,
638648
"texture": 0
639649
},
640650
"west": {
@@ -644,6 +654,7 @@
644654
54,
645655
25
646656
],
657+
"tint": 0,
647658
"texture": 0
648659
},
649660
"up": {
@@ -653,6 +664,7 @@
653664
50,
654665
16
655666
],
667+
"tint": 0,
656668
"texture": 0
657669
},
658670
"down": {
@@ -662,6 +674,7 @@
662674
52,
663675
18
664676
],
677+
"tint": 0,
665678
"texture": 0
666679
}
667680
},
@@ -700,6 +713,7 @@
700713
20,
701714
9
702715
],
716+
"tint": 0,
703717
"texture": 0
704718
},
705719
"east": {
@@ -709,6 +723,7 @@
709723
18,
710724
9
711725
],
726+
"tint": 0,
712727
"texture": 0
713728
},
714729
"south": {
@@ -718,6 +733,7 @@
718733
24,
719734
9
720735
],
736+
"tint": 0,
721737
"texture": 0
722738
},
723739
"west": {
@@ -727,6 +743,7 @@
727743
22,
728744
9
729745
],
746+
"tint": 0,
730747
"texture": 0
731748
},
732749
"up": {
@@ -736,6 +753,7 @@
736753
18,
737754
0
738755
],
756+
"tint": 0,
739757
"texture": 0
740758
},
741759
"down": {
@@ -745,6 +763,7 @@
745763
20,
746764
2
747765
],
766+
"tint": 0,
748767
"texture": 0
749768
}
750769
},
@@ -950,6 +969,7 @@
950969
13,
951970
32
952971
],
972+
"tint": 0,
953973
"texture": 0
954974
},
955975
"east": {
@@ -959,6 +979,7 @@
959979
3,
960980
32
961981
],
982+
"tint": 0,
962983
"texture": 0
963984
},
964985
"south": {
@@ -968,6 +989,7 @@
968989
28,
969990
32
970991
],
992+
"tint": 0,
971993
"texture": 0
972994
},
973995
"west": {
@@ -977,6 +999,7 @@
977999
18,
9781000
32
9791001
],
1002+
"tint": 0,
9801003
"texture": 0
9811004
},
9821005
"up": {
@@ -986,6 +1009,7 @@
9861009
5,
9871010
26
9881011
],
1012+
"tint": 0,
9891013
"texture": 0
9901014
},
9911015
"down": {
@@ -995,6 +1019,7 @@
9951019
17,
9961020
29
9971021
],
1022+
"tint": 0,
9981023
"texture": 0
9991024
}
10001025
},
@@ -1170,7 +1195,7 @@
11701195
0
11711196
],
11721197
"color": 0,
1173-
"nbt": "{}",
1198+
"nbt": "{ArmorItems:[{},{},{},{tag:{display:{color:16711680}}}]}",
11741199
"armAnimationEnabled": false,
11751200
"uuid": "fdba905d-125a-46b9-bada-bbc88aedd04a",
11761201
"export": true,

src/animatedJava.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import './compileLangMC'
1212
import './exporters/statueExporter'
1313
import './exporters/animationExporter'
1414
import './bbmods/modelFormatMod'
15+
import './bbmods/faceTint'
1516
import { intl } from './util/intl'
1617
import { CustomError } from './util/customError'
1718
import { format } from './util/replace'
@@ -113,6 +114,7 @@ export interface Settings {
113114
rigModelsExportFolder: string
114115
transparentTexturePath: string
115116
boundingBoxRenderMode: 'single' | 'multiple' | 'disabled'
117+
verbose: boolean
116118
}
117119
[index: string]: any
118120
}

src/bbmods/faceTint.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { format as modelFormat } from '../modelFormat'
2+
import { bus } from '../util/bus'
3+
import * as EVENTS from '../constants/events'
4+
5+
const originalFaceTintCondition = BarItems.face_tint.condition
6+
const originalFaceTintSliderCondition = BarItems.slider_face_tint.condition
7+
BarItems.face_tint.condition = () =>
8+
!Project.box_uv &&
9+
(Format.id === 'java_block' || Format.id === modelFormat.id) &&
10+
Cube.selected.length &&
11+
UVEditor.selected_faces[0] &&
12+
Cube.selected[0].faces[UVEditor.selected_faces[0]]
13+
14+
BarItems.slider_face_tint.condition = () =>
15+
!Project.box_uv &&
16+
(Format.id === 'java_block' || Format.id === modelFormat.id) &&
17+
Cube.selected.length &&
18+
UVEditor.selected_faces[0] &&
19+
Cube.selected[0].faces[UVEditor.selected_faces[0]]
20+
21+
bus.on(EVENTS.LIFECYCLE.CLEANUP, () => {
22+
BarItem.face_tint.condition = originalFaceTintCondition
23+
BarItem.slider_face_tint.condition = originalFaceTintSliderCondition
24+
})

0 commit comments

Comments
 (0)