Skip to content

Version 2026.6.1 - Part 2#380

Merged
Mustard2 merged 8 commits into
mainfrom
extras-subcollections
Jul 6, 2026
Merged

Version 2026.6.1 - Part 2#380
Mustard2 merged 8 commits into
mainfrom
extras-subcollections

Conversation

@Mustard2

@Mustard2 Mustard2 commented Jun 20, 2026

Copy link
Copy Markdown
Owner
  • Feature: Outfit Extras can be shown in different collections which are also grouped in the UI Extras panel.
  • UI: Improved Quick Setup UI.
  • UI: Added links to documentation in additional parts of the UI.
  • Fix: An error might occur when using the Presets UI for Morphs when using generic Morph panels.

@Mustard2 Mustard2 self-assigned this Jun 20, 2026
@Mustard2 Mustard2 added the enhancement New feature or request label Jun 20, 2026
@Mustard2

Copy link
Copy Markdown
Owner Author

@claude review, checking if it's a correct implementation and if something is missing

@claude

claude Bot commented Jun 20, 2026

Copy link
Copy Markdown

Claude finished @Mustard2's task in 4m 23s —— View job


PR Review: Version 2026.6.1 - Part 2

Tasks:

  • Load review tools
  • Gather context (read changed files)
  • Analyze implementation correctness
  • Check for missing pieces
  • Post review findings

Overall Assessment

The implementation is generally correct and well-structured. The core idea — splitting extras_config_subcollections from outfit_config_subcollections and adding a recursive update_extras_visibility helper — is sound, and all previously wrong uses of outfit_config_subcollections for the extras collection have been migrated. Registration order in outfits/__init__.py is correct (reverse for unregister). Found a few issues to address:


Issues

1. Missing poll() on new operator — potential crash

outfits/ops_visibility_extras.py:27

poll, arm = mustardui_active_object(context, config=0)
rig_settings = arm.MustardUI_RigSettings  # crashes if arm is None

MustardUI_ExtrasCollectionVisibility has no @classmethod poll() method. If the operator is called when mustardui_active_object returns (False, None) (e.g. no model selected), arm.MustardUI_RigSettings will crash. Every other operator in this module guards against this. Fix:

@classmethod
def poll(cls, context):
    return active_object_operator_poll(context, config=0)

And add an early exit in execute():

poll, arm = mustardui_active_object(context, config=0)
if not poll or arm is None:
    return {"CANCELLED"}

Fix this →


2. show_viewport_extras_update doesn't propagate to sub-collections

settings/rig.py:602–621

When the global eye-icon toggle for Extras is clicked, show_viewport_extras_update sets only the top-level extras_collection.hide_viewport and its layer collection exclude. Sub-collection hide_viewport/exclude flags are not updated. This is fine when Blender propagates visibility down from the parent, but for consistency with the rest of the feature (which calls update_extras_visibility) it would be cleaner to call that helper instead of (or alongside) the current logic — especially since update_extras_visibility also handles the hide_render and exclude flags for each sub-level.

At minimum, show_viewport_extras_update should also update individual object visibility before deferring to the helper. As-is, it only hides/shows the collection level, not the individual objects (it reads hide_viewport to decide hidden but never writes it back to objects). This was pre-existing behavior, but may interact oddly with the new sub-collection toggle.


3. Physics enable check ignores sub-collection visibility

physics/update_enable.py:274–278

status_int = (
    status
    and not rig_settings.extras_collection.hide_viewport  # only top-level checked
    and not obj.hide_viewport
)

For objects in a sub-collection that is hidden (but the parent extras collection is shown), rig_settings.extras_collection.hide_viewport will be False (visible), so status_int can become True even though the object's own sub-collection is excluded. The per-object obj.hide_viewport flag should already reflect this correctly if MustardUI_ExtrasCollectionVisibility set it properly, but the parent-collection check is misleadingly incomplete.


4. SingleCage rebind still uses c.objects for outfit items

physics/ops_rebind.py:337

for obj in [x for x in c.objects if x.type == "MESH"]:  # outfit_config_subcollections not respected

The MustardUI_PhysicsItem_Rebind_SingleCage operator correctly uses extras_config_subcollections for the extras section (added in this PR), but the outfit collection loop still uses .objects instead of .all_objects if outfit_config_subcollections. The regular MustardUI_PhysicsItem_Rebind was fixed to respect this flag. This inconsistency is pre-existing but this PR is a good opportunity to fix it in SingleCage too.


Minor Notes

Empty sub-collection → auto-excluded (helper_functions.py:27): _update uses all(obj.hide_render for obj in coll.objects)all([]) returns True in Python, so a sub-collection with no direct objects is considered "all hidden" and gets excluded. This could surprise creators who add a placeholder empty sub-collection during configuration. Might be worth an early-out: if not coll.objects and not coll.children: return False (or True, depending on desired behavior).

One-level UI depth vs. recursive hide logic: menu_outfits.py:440 iterates extras.children (direct children only), while update_extras_visibility recurses through all descendants. So only one nesting level gets its own collapse/toggle in the UI; deeper nesting is still handled at the visibility level but won't have separate UI groups. This seems intentional for UI simplicity, but worth documenting.

poll_collection_extras simplification (settings/rig.py:584): The if self.hair_collection is not None guard was removed. The simplified object != self.hair_collection is semantically equivalent (comparing to None always differs from a collection object), so this is correct and cleaner. ✓


Summary

The implementation is correct and complete for the main feature. Issues 1 and 3 are the most actionable (potential crash + physics logic), Issue 2 is a pre-existing behavioral gap made more visible by the new feature, and Issue 4 is a pre-existing inconsistency. The UI drawing logic, property definitions, and registration wiring are all correct.

@Mustard2 Mustard2 linked an issue Jun 20, 2026 that may be closed by this pull request
@Mustard2 Mustard2 merged commit a46db36 into main Jul 6, 2026
7 checks passed
@Mustard2 Mustard2 deleted the extras-subcollections branch July 6, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Extras

1 participant