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

upgrade watch script and finalize .ajmodel auto-exporter #71

Merged
merged 52 commits into from
Jan 27, 2024

Conversation

TheAfroOfDoom
Copy link
Owner

@TheAfroOfDoom TheAfroOfDoom commented Jan 16, 2024

Summary

closes #2 (23fdbcd)
closes #8 (46fe9b6)
closes #69 (9794a54)
closes #70 (46fe9b6)

This PR's primary purpose is to close #8.

We:

  • finalize the ajexport.js script for auto-exporting of AJ model files
  • delete all AJ export files from the repository
  • add AJ export files to .gitignore
  • add .env file support for dev-specific paths (crucial for these scripts to function smoothly)
  • update the watch script to a much cleaner version
  • add AJ export files to .gitattributes for nicer diffs in GitHub on old PRs with AJ export files

Test plan

Tested the script locally by running yarn start and performing the following actions:

  • empty local AJ export file cache -> correctly reads ajmodel files and runs auto exporter
  • ctrl+s on ajmodel with no real changes (use Save without Formatting) -- exporter doesn't run
  • ctrl+s on ajmodel with real changes (add a newline at bottom of file) -- exporter runs
  • ctrl+s on 2 ajmodels in quick succession (with newline changes) -- exporter runs once on both
  • ctrl+s on 1 ajmodel with changes, exporter starts, ctrl+s on other ajmodel with changes, exporter is queued up to run again after it finishes the 1st model's export
  • add new or change existing datapack mcfunction / resourcepack file -- change is reflected instantly in Minecraft
  • delete datapack mcfunction / resourcepack file -- deletion is reflected instantly in Minecraft
  • delete ajmodel -- export files are deleted accordingly and reflected in Minecraft (e.g. delete bomb model, cant run the bomb summon function function animated_java:bomb/summon

Reproducing

update local dependencies:

yarn

run the watch script:

yarn start

Preview

preview


Supplemental changes

  • change ajmodels to all use white_dye as a rig item: d9b18bb (#71)
  • make vscode's Copy Relative Path use / as separator always: 71be143 (#71)
  • squash Setup in README to multiple collapsible sections: 92aeb88 (#71)

Base automatically changed from 8-aj-cli-export to main January 17, 2024 03:23
- `yarn start` still works for me locally
- `yarn start export` still works and doesn't change any auto-exported files except `load.mcfunction`s
- add errors if any process.env stuff is undefined
… we're not blindly exporting them over and over

- included sample file in this commit, it will be gitignore'd next commit
- this is an incomplete commit, still need to update paths inside each `.ajmodel` file
- shouldn't add any new texture files (it doesn't)
- should add parent commit's models to `white_dye.json` (it does)
- move custom textures from `omega-flowey/textures` to  `omega-flowey/textures/custom`
- point `.ajmodel` custom texture paths to new folder
- see: https://discord.com/channels/154777837382008833/1196591704317370498/1196591704317370498
…xport script

- e.g. `housefly_dev.ajmodel`
- nice to have for debugging etc.
- also re-order `name` field before `hash` field
- how to run scripts and why
- update new model creation steps to reflect ajexport script
@TheAfroOfDoom TheAfroOfDoom force-pushed the 8-aj-cli-export-integration branch from 6a231a7 to 85675c9 Compare January 17, 2024 09:20
…-const` js files while running in blockbench script

- move utils/consts to respective files
- used later for watch script to filter our logs from blockbench's kajillion logs
- clunky, slow
- deleted + copied ENTIRE datapack/resourcepack directory when any single file changed to either
- couldn't do more complex watching re: ajmodels with them
- delete the "temp" mp3 files
- much faster copying on file changes
- smart file deletion
- watches model files and runs auto-exporter when necessary
- recommends closing vanilla blockbench -- won't run auto-exporter if you have it open already when you start the watch script
- log passthrough from auto exporter
…ll files instead of just resourcepack files
- just add `awaitWriteFinish` to datapack watcher
- maybe to resourcepack watcher too? exporting the whole suite of ajmodels works for now though so nbd
@TheAfroOfDoom TheAfroOfDoom marked this pull request as ready for review January 21, 2024 00:01
@TheAfroOfDoom TheAfroOfDoom changed the title 8 aj cli export integration change watch scripts to support ajmodel auto-exporter Jan 21, 2024
@TheAfroOfDoom TheAfroOfDoom changed the title change watch scripts to support ajmodel auto-exporter change watch scripts to support .ajmodel auto-exporter Jan 21, 2024
- its kinda janky
- add script to still watch models as well with `yarn start watch.experimental`
- update readme accordingly
@TheAfroOfDoom
Copy link
Owner Author

@aidant19 i'm going to merge this now because i want to have the much faster watch script (regardless of the auto-exporter stuff)

feel free to still review when you get a chance and i can still answer questions/make a separate PR to address your comments

@TheAfroOfDoom TheAfroOfDoom changed the title change watch scripts to support .ajmodel auto-exporter upgrade watch script and finalize .ajmodel auto-exporter Jan 27, 2024
@TheAfroOfDoom TheAfroOfDoom merged commit 1aa3124 into main Jan 27, 2024
5 checks passed
@TheAfroOfDoom TheAfroOfDoom deleted the 8-aj-cli-export-integration branch January 27, 2024 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant