Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation Utils 3.2.1 #627

Merged
merged 2 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
"tags": [
"Minecraft: Java Edition"
],
"version": "3.2",
"version": "3.2.1",
"min_version": "4.11.0",
"await_loading": true,
"variant": "both",
Expand Down
3 changes: 3 additions & 0 deletions plugins/animation_utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
🐞 = Bug Fix<br/>
🦎 = Non-user-facing Change

## 3.2.1
- 🐞 Fix some animation exporting issues with specific animation setup cases

## 3.2
- 🚀 Auto-export the particle texture entry in the textures list for block/item display jsons if not defined
- 🚀 Auto-convert bedrock animation jsons to GeckoLib-supported animation jsons when exporting
Expand Down
22 changes: 12 additions & 10 deletions plugins/animation_utils/animation_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8544,21 +8544,23 @@ function animatorBuildFile() {
const animationGroup = bone[animationGroupType];
for (const timestamp in animationGroup) {
const keyframe = animationGroup[timestamp];
if (keyframe["lerp_mode"])
delete keyframe["lerp_mode"];
let bedrockKeyframe = keyframe["pre"];
if (!keyframe)
continue;
let bedrockKeyframe = keyframe.pre;
let bedrockKeyframeData = undefined;
if (bedrockKeyframe) {
if (bedrockKeyframe !== undefined) {
bedrockKeyframeData = bedrockKeyframe;
delete keyframe["pre"];
delete keyframe.pre;
}
bedrockKeyframe = keyframe["post"];
if (bedrockKeyframe) {
bedrockKeyframe = keyframe.post;
if (bedrockKeyframe !== undefined) {
bedrockKeyframeData = bedrockKeyframe;
delete keyframe["post"];
delete keyframe.post;
}
if (bedrockKeyframeData) {
if (bedrockKeyframeData !== undefined) {
Object.assign(keyframe, bedrockKeyframeData);
if (keyframe.lerp_mode)
delete keyframe.lerp_mode;
}
}
}
Expand Down Expand Up @@ -9510,7 +9512,7 @@ module.exports = JSON.parse('{"meta":{"format_version":"3.2","model_format":"ani
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"name":"animation_utils","version":"3.2","private":true,"description":"GeckoLib","main":"index.js","scripts":{"prebuild":"npm run test","build":"npm run build:only","build:only":"webpack && npm run update_manifest","update_manifest":"node scripts/updateManifest.mjs","start":"webpack --watch --mode=development","lint":"eslint .","lint:fix":"eslint --fix .","tsc":"tsc --noEmit","pretest":"npm run lint && npm run tsc","test":"npm run test:only","test:only":"jest"},"author":"Eliot Lash, Gecko, McHorse, AzureDoom","license":"MIT","blockbenchConfig":{"title":"GeckoLib Animation Utils","author":"Eliot Lash, Gecko, McHorse, AzureDoom, Tslat","icon":"icon.png","description":"Create animated blocks, items, entities, and armor using the GeckoLib library and plugin.","min_version":"4.11.0","max_version":"5.0.0","variant":"both"},"sideEffects":["./index.js"],"devDependencies":{"@types/jest":"^29.5.4","@types/lodash":"^4.14.197","@typescript-eslint/eslint-plugin":"^6.5.0","@typescript-eslint/parser":"^6.5.0","blockbench-types":"^4.9.0","eol":"0.9.1","eslint":"^7.7.0","indent-string":"^5.0.0","jest":"^29.6.4","ts-jest":"^29.1.1","ts-loader":"^9.4.4","typescript":"^4.9.5","webpack":"^5.88.2","webpack-cli":"^5.1.4"},"dependencies":{"lodash":"^4.17.21","semver":"7.3.2"}}');
module.exports = JSON.parse('{"name":"animation_utils","version":"3.2.1","private":true,"description":"GeckoLib","main":"index.js","scripts":{"prebuild":"npm run test","build":"npm run build:only","build:only":"webpack && npm run update_manifest","update_manifest":"node scripts/updateManifest.mjs","start":"webpack --watch --mode=development","lint":"eslint .","lint:fix":"eslint --fix .","tsc":"tsc --noEmit","pretest":"npm run lint && npm run tsc","test":"npm run test:only","test:only":"jest"},"author":"Eliot Lash, Gecko, McHorse, AzureDoom","license":"MIT","blockbenchConfig":{"title":"GeckoLib Animation Utils","author":"Eliot Lash, Gecko, McHorse, AzureDoom, Tslat","icon":"icon.png","description":"Create animated blocks, items, entities, and armor using the GeckoLib library and plugin.","min_version":"4.11.0","max_version":"5.0.0","variant":"both"},"sideEffects":["./index.js"],"devDependencies":{"@types/jest":"^29.5.4","@types/lodash":"^4.14.197","@typescript-eslint/eslint-plugin":"^6.5.0","@typescript-eslint/parser":"^6.5.0","blockbench-types":"^4.9.0","eol":"0.9.1","eslint":"^7.7.0","indent-string":"^5.0.0","jest":"^29.6.4","ts-jest":"^29.1.1","ts-loader":"^9.4.4","typescript":"^4.9.5","webpack":"^5.88.2","webpack-cli":"^5.1.4"},"dependencies":{"lodash":"^4.17.21","semver":"7.3.2"}}');

/***/ })

Expand Down
21 changes: 12 additions & 9 deletions plugins/animation_utils/src/codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,29 @@ function animatorBuildFile() {
for (const timestamp in animationGroup) {
const keyframe = animationGroup[timestamp];

if (keyframe["lerp_mode"])
delete keyframe["lerp_mode"];
if (!keyframe)
continue

let bedrockKeyframe : Map<any, any> = keyframe["pre"];
let bedrockKeyframe : Map<any, any> = keyframe.pre;
let bedrockKeyframeData : Map<any, any> = undefined;

if (bedrockKeyframe) {
if (bedrockKeyframe !== undefined) {
bedrockKeyframeData = bedrockKeyframe;
delete keyframe["pre"]
delete keyframe.pre
}

bedrockKeyframe = keyframe["post"];
bedrockKeyframe = keyframe.post;

if (bedrockKeyframe) {
if (bedrockKeyframe !== undefined) {
bedrockKeyframeData = bedrockKeyframe;
delete keyframe["post"]
delete keyframe.post
}

if (bedrockKeyframeData) {
if (bedrockKeyframeData !== undefined) {
Object.assign(keyframe, bedrockKeyframeData)

if (keyframe.lerp_mode)
delete keyframe.lerp_mode;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/animation_utils/src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/animation_utils/src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "animation_utils",
"version": "3.2",
"version": "3.2.1",
"private": true,
"description": "GeckoLib",
"main": "index.js",
Expand Down
Loading