Skip to content

Attachment usability improvements#189

Open
Kannoma wants to merge 27 commits into
mainfrom
attachment-usability-improvements
Open

Attachment usability improvements#189
Kannoma wants to merge 27 commits into
mainfrom
attachment-usability-improvements

Conversation

@Kannoma

@Kannoma Kannoma commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Attachment usability improvements

Reorganized all attachment code into src/attachments/. Added Create Attachment from Selection, Add Selection to Attachment, and Detach from Attachment actions 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 folders or Set to 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

@Kannoma
Kannoma requested a review from JannisX11 May 28, 2026 15:37
@Kannoma Kannoma self-assigned this May 28, 2026

@JannisX11 JannisX11 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Comment thread bash.exe.stackdump Outdated
Comment thread src/mirror_fix.ts
@@ -0,0 +1,199 @@
//! Copyright (C) 2025 Hypixel Studios Canada inc.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirror modeling fix for imprecise values should not be necessary as this has been fixed in Blockbench already.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the empty group mirroring implemented in Blockbench as well? If so yes we can remove it cleanly.

Comment thread src/attachments/unload.ts Outdated
let originalToggle = Collection.prototype.toggleVisibility;
Collection.prototype.toggleVisibility = function(event: KeyboardEvent | MouseEvent) {
if (isHytaleFormat() && this.export_codec === 'blockymodel') {
toggleCollectionLoaded(this);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/attachments/collection_folder.ts Outdated
Comment thread src/blockymodel.ts Outdated
@Kannoma
Kannoma marked this pull request as ready for review June 12, 2026 09:31
@Kannoma
Kannoma requested a review from JannisX11 June 12, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants