Attachment usability improvements#189
Conversation
…port attachment twice
JannisX11
left a comment
There was a problem hiding this comment.
I've left a few comments for initial stuff I found. Still need to spend a bunch more time with it and test the workflow. But lots of fun features for sure!
| @@ -0,0 +1,199 @@ | |||
| //! Copyright (C) 2025 Hypixel Studios Canada inc. | |||
There was a problem hiding this comment.
Mirror modeling fix for imprecise values should not be necessary as this has been fixed in Blockbench already.
There was a problem hiding this comment.
Is the empty group mirroring implemented in Blockbench as well? If so yes we can remove it cleanly.
| let originalToggle = Collection.prototype.toggleVisibility; | ||
| Collection.prototype.toggleVisibility = function(event: KeyboardEvent | MouseEvent) { | ||
| if (isHytaleFormat() && this.export_codec === 'blockymodel') { | ||
| toggleCollectionLoaded(this); |
There was a problem hiding this comment.
Should we make unloading attachments a more explicit action? Just from playing around with it, it felt a bit annoying that it always tried to unload the collection when hiding it and always asked me to save the changes.
Could just be in the context menu instead.
There was a problem hiding this comment.
I'm thorn. On one side it may be annoying if you want to just hide said attachment on the other attachments in blockbench clutter the outliner and when you have 30+ attachments performances degrade fast if you don't actively manage them each one. also You may end up saving unwanted changes from an attachment set to invisible but not unloaded.
I think both ways have their own good and bad, but if we decide going for unloading as separate button I believe it should be next to the visibility toggle and be also on the sets to unload multiple at once.
Attachment usability improvements
Reorganized all attachment code into
src/attachments/. AddedCreate Attachment from Selection,Add Selection to Attachment, andDetach from Attachmentactions to let artists build and edit attachments even when loaded on a character model.A validation system flags invalid attachments to the user to prevent broken export to the game.
Double-clicking a collection opens its source file now instead of the properties. Properties are still accessible with a rightclick.
A file watcher detects external changes to attachment, prompting an optional reload when an attachment was edited in another tab. Note: Undo for reloads is now handled via JSON snapshots since Blockbench's built-in undo doesn't seam to handle full geometry swaps cleanly.
Improvements on attachments management: added
Collection foldersorSetto allow artists organize attachments into groups with bulk visibility. When the visibility of a attachment/set is toggled off the attachment is removed from the scene to save performances. Attachments, their textures and sets are now saved inside.blockymodel. This allow opening a model an having the attachments already loaded instead of reloading them manually.Collections can be colored to make them easily recognizable in the outline.
Other fixes:
This PR also fixes small issues with Mirror modeling. Many attachments exported from Superpowers had rounding error isssues. Blockbench now auto corrects these rounding errors when under a threshold allowing the mirror modelling to work.
Mirror modelling now also mirrors empty bone groups with no children to accommodate attachments groups in Hytale style models