Skip to content

Commit ea6f853

Browse files
committed
🛠️ Fix per-rig objectives being put in global
1 parent 6f22c25 commit ea6f853

File tree

2 files changed

+10
-147
lines changed

2 files changed

+10
-147
lines changed

src/systems/datapackCompiler/animation.mcb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ dir global {
66
scoreboard objectives add <%OBJECTIVES.ID()%> dummy
77
scoreboard objectives add <%OBJECTIVES.IS_RIG_LOADED()%> dummy
88
scoreboard objectives add <%OBJECTIVES.TWEEN_DURATION()%> dummy
9-
<%%
10-
animations.forEach(animation => {
11-
emit(`scoreboard objectives add ${OBJECTIVES.FRAME(animation.name)} dummy`)
12-
})
13-
%%>
149

1510
scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 0
1611

@@ -119,6 +114,12 @@ dir global {
119114

120115
dir <%export_namespace%> {
121116
function on_load {
117+
<%%
118+
animations.forEach(animation => {
119+
emit(`scoreboard objectives add ${OBJECTIVES.FRAME(animation.name)} dummy`)
120+
})
121+
%%>
122+
122123
IF (use_storage_for_animation) {
123124
REPEAT (animations) as animation {
124125
data remove storage aj.<%export_namespace%>:animations <%animation.storageSafeName%>

test_blueprints/armor_stand.ajblueprint

Lines changed: 4 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,88 +1601,6 @@
16011601
}
16021602
]
16031603
},
1604-
"c6696a60-8f7e-63b4-24f8-dd9bad05cf18": {
1605-
"name": "pupil_left",
1606-
"type": "animated_java:vanilla_block_display",
1607-
"keyframes": [
1608-
{
1609-
"channel": "position",
1610-
"data_points": [
1611-
{
1612-
"x": "0.35 + math.cos(q.life_time * 180)",
1613-
"y": "0.7 + math.sin(q.life_time * 180)",
1614-
"z": "0"
1615-
}
1616-
],
1617-
"uuid": "1ed8db81-057d-ac42-3066-e5513808e8b3",
1618-
"time": 0,
1619-
"color": -1,
1620-
"interpolation": "linear",
1621-
"easing": "linear",
1622-
"easingArgs": []
1623-
}
1624-
]
1625-
},
1626-
"27f26301-9ccd-def2-94ef-577950e84e02": {
1627-
"name": "pupil_right",
1628-
"type": "animated_java:vanilla_block_display",
1629-
"keyframes": [
1630-
{
1631-
"channel": "position",
1632-
"data_points": [
1633-
{
1634-
"x": "-0.35 - math.cos(q.life_time * 180)",
1635-
"y": "0.7 - math.sin(q.life_time * 180)",
1636-
"z": "0"
1637-
}
1638-
],
1639-
"uuid": "d7201c93-1fc8-5f10-4e00-9efc9f1445b9",
1640-
"time": 0,
1641-
"color": -1,
1642-
"interpolation": "linear",
1643-
"easing": "linear",
1644-
"easingArgs": []
1645-
}
1646-
]
1647-
},
1648-
"d0076177-a6cf-561c-08d8-efd07677b337": {
1649-
"name": "camera",
1650-
"type": "camera",
1651-
"keyframes": [
1652-
{
1653-
"channel": "position",
1654-
"data_points": [
1655-
{
1656-
"x": "math.cos(q.life_time * 180) * 32",
1657-
"y": "math.sin(q.life_time * 360) * 8",
1658-
"z": "0"
1659-
}
1660-
],
1661-
"uuid": "2eeda6db-5dca-27ba-8d94-6935720845fb",
1662-
"time": 0,
1663-
"color": -1,
1664-
"interpolation": "linear",
1665-
"easing": "linear",
1666-
"easingArgs": []
1667-
},
1668-
{
1669-
"channel": "rotation",
1670-
"data_points": [
1671-
{
1672-
"x": "math.cos(q.life_time * 360) * 16",
1673-
"y": "-math.sin(q.life_time * 180) * 32",
1674-
"z": "0"
1675-
}
1676-
],
1677-
"uuid": "01848b41-27ed-45c5-168f-64a1623fa350",
1678-
"time": 0,
1679-
"color": -1,
1680-
"interpolation": "linear",
1681-
"easing": "linear",
1682-
"easingArgs": []
1683-
}
1684-
]
1685-
},
16861604
"3b35d1a9-befe-066e-60df-e1f3a5ec5a78": {
16871605
"name": "pig",
16881606
"type": "bone",
@@ -2214,50 +2132,6 @@
22142132
"easingArgs": []
22152133
}
22162134
]
2217-
},
2218-
"c6696a60-8f7e-63b4-24f8-dd9bad05cf18": {
2219-
"name": "pupil_left",
2220-
"type": "animated_java:vanilla_block_display",
2221-
"keyframes": [
2222-
{
2223-
"channel": "position",
2224-
"data_points": [
2225-
{
2226-
"x": "1 - easeinoutexpo(\n linear_wave(q.life_time * v.walk_speed + 180)\n) * 1.25\n",
2227-
"y": "0",
2228-
"z": "0"
2229-
}
2230-
],
2231-
"uuid": "a9b1c34b-a0ce-c1a2-73e5-8f11591b6e1a",
2232-
"time": 0,
2233-
"color": -1,
2234-
"interpolation": "linear",
2235-
"easing": "linear",
2236-
"easingArgs": []
2237-
}
2238-
]
2239-
},
2240-
"27f26301-9ccd-def2-94ef-577950e84e02": {
2241-
"name": "pupil_right",
2242-
"type": "animated_java:vanilla_block_display",
2243-
"keyframes": [
2244-
{
2245-
"channel": "position",
2246-
"data_points": [
2247-
{
2248-
"x": "0.5 - easeinoutexpo(\n linear_wave(q.life_time * v.walk_speed + 180)\n) * 1.25\n",
2249-
"y": "0",
2250-
"z": "0"
2251-
}
2252-
],
2253-
"uuid": "595b9015-2eea-85a5-4511-da31a5019413",
2254-
"time": 0,
2255-
"color": -1,
2256-
"interpolation": "linear",
2257-
"easing": "linear",
2258-
"easingArgs": []
2259-
}
2260-
]
22612135
}
22622136
}
22632137
},
@@ -2708,7 +2582,7 @@
27082582
"override": false,
27092583
"length": 4,
27102584
"snapping": 20,
2711-
"selected": true,
2585+
"selected": false,
27122586
"saved": false,
27132587
"path": "",
27142588
"anim_time_update": "",
@@ -3132,7 +3006,7 @@
31323006
"override": false,
31333007
"length": 0.8,
31343008
"snapping": 20,
3135-
"selected": false,
3009+
"selected": true,
31363010
"saved": false,
31373011
"path": "",
31383012
"anim_time_update": "",
@@ -3394,13 +3268,7 @@
33943268
"interpolation": "linear",
33953269
"easing": "linear",
33963270
"easingArgs": []
3397-
}
3398-
]
3399-
},
3400-
"c6696a60-8f7e-63b4-24f8-dd9bad05cf18": {
3401-
"name": "pupil_left",
3402-
"type": "animated_java:vanilla_block_display",
3403-
"keyframes": [
3271+
},
34043272
{
34053273
"channel": "position",
34063274
"data_points": [
@@ -3416,13 +3284,7 @@
34163284
"interpolation": "linear",
34173285
"easing": "linear",
34183286
"easingArgs": []
3419-
}
3420-
]
3421-
},
3422-
"27f26301-9ccd-def2-94ef-577950e84e02": {
3423-
"name": "pupil_right",
3424-
"type": "animated_java:vanilla_block_display",
3425-
"keyframes": [
3287+
},
34263288
{
34273289
"channel": "position",
34283290
"data_points": [

0 commit comments

Comments
 (0)