Skip to content

Version 2026.2.0#72

Open
Mustard2 wants to merge 13 commits into
mainfrom
2026.2.0
Open

Version 2026.2.0#72
Mustard2 wants to merge 13 commits into
mainfrom
2026.2.0

Conversation

@Mustard2

@Mustard2 Mustard2 commented Jun 26, 2026

Copy link
Copy Markdown
Owner

@Mustard2 Mustard2 self-assigned this Jun 26, 2026
@Mustard2 Mustard2 added bug Something isn't working enhancement New feature or request labels Jun 26, 2026
@Mustard2 Mustard2 linked an issue Jun 26, 2026 that may be closed by this pull request
@Mustard2 Mustard2 linked an issue Jun 26, 2026 that may be closed by this pull request
Include library override objects (override_library is not None) in
simplification, as they are locally editable even though they originate
from a linked library. Previously, the filter used override_library is None
which had the opposite effect: it excluded overridden (editable) objects
and would have included purely linked (read-only) ones.

Also fix the exception collection branch so it filters on top of the
corrected object list rather than rebuilding from scene.objects without
any library check.

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Mustard <Mustard2@users.noreply.github.com>
@Mustard2 Mustard2 linked an issue Jun 26, 2026 that may be closed by this pull request
@Mustard2

Copy link
Copy Markdown
Owner Author

@claude Review

@claude

claude Bot commented Jun 26, 2026

Copy link
Copy Markdown

Claude finished @Mustard2's task in 3m 9s —— View job


Code Review — Version 2026.2.0

Tasks:

  • Gather context and read changed files
  • Review new Scene Complexity Analyzer (tools/ops_complexity_analyzer.py, menu/menu_complexity_analyzer.py)
  • Review Presets feature (simplify/ops_settings_presets.py, settings/settings_main.py)
  • Review bug fix for linked/overridden objects (simplify/ops_settings_objects.py, simplify/ops_simplify.py)
  • Review deprecation of Normals Auto Smooth and other changes
  • Post final review

Scene Complexity Analyzer

Overall well-structured, with clear separation of concerns (backup/restore, color mapping, overlay drawing, operators). A few things to check:

State inconsistency when no meshes are found

In tools/ops_complexity_analyzer.py:211-216:

def apply_heatmap(context):
    ...
    if not data:
        settings.complexity_analyzer_active = True   # sets active …
        return 0                                     # … but never calls _enable_overlay()

When there are no visible mesh objects, complexity_analyzer_active becomes True but _draw_handle is never registered. The UI will then show "Disable" (since the flag is True) even though nothing visual happened. Clicking "Disable" calls _disable_overlay() which handles None gracefully, so it won't crash — but the state is misleading. Consider either not setting active = True when data is empty, or calling _enable_overlay() before returning. Fix this →

collect_objects only gathers MESH objects in all modes

tools/ops_complexity_analyzer.py:135-151 filters to obj.type != "MESH" for every mode, including MODIFIERS. MODIFIER_SUPPORTED_TYPES is defined at the top but is only used by object_modifier_count. In MODIFIERS mode, curves, fonts, lattices, etc. — which can carry many modifiers — will be excluded from the heatmap. This may be intentional, but it is worth a comment if so, or a fix to use MODIFIER_SUPPORTED_TYPES as the filter when the mode is "MODIFIERS". Fix this →

Silent exception swallowing in live timer

tools/ops_complexity_analyzer.py:53-56:

    try:
        apply_heatmap(bpy.context)
    except Exception:
        pass

A bare pass means any error in apply_heatmap during live update silently disappears and is invisible to the user. At minimum, a print would allow debugging. Consider logging to the console or disabling the live update on error.

_live_timer_active flag vs. actual timer registration

unregister_live_handler only flips the flag; the actual timer unregisters itself on its next tick (up to 1 second later). After unregister() is called, the timer may fire once more. _live_timer handles this gracefully via the try/except, but if bpy.context is accessible in that window, apply_heatmap will run one extra time after the addon is disabled. Low risk, but worth being aware of.


Presets (simplify/ops_settings_presets.py)

Good use of AddPresetBase. The extension pattern for serializing CollectionProperty data to the preset file is creative and appropriate, since Blender's built-in preset system can't handle collection properties.

No error handling in _append_collections

simplify/ops_settings_presets.py:63-89: if the file open or either _write_collection call raises (e.g., permissions, disk full), execute will propagate an exception and the preset file will be left partially written. Wrapping the write block in a try/except and reporting a warning to the user would be safer.

Unused loop variable

simplify/ops_settings_presets.py:60-61: _write_collection is called twice in a loop-free fashion. Minor, but _append_collections could be slightly cleaner.

PRESET_VALUES does not include objects setting

simplify/ops_settings_presets.py:8-19: the objects: BoolProperty ("Hide objects") is missing from PRESET_VALUES, so saving a preset won't capture whether the "Objects" toggle was on. Since the objects selection (which types to hide) is included via _append_collections, omitting the toggle itself may lead to a confusing restore. Fix this →


Bug Fix: Linked / Library-Override Objects (simplify/ops_simplify.py)

The fix is sound: using a scene-level CollectionProperty as a fallback status store for library-override objects (whose per-object custom property collections are read-only) is the right approach, and get_obj_status cleanly abstracts the two paths.

Confusing variable reuse (objects_ignore / modifiers_ignore)

simplify/ops_simplify.py:150-169: both objects_ignore and modifiers_ignore are first assigned a bool (settings.modifiers) and then, inside the if settings.modifiers: block, overwritten with a list. While this is safe due to the guard conditions, using the same name for two different types is fragile — if either value is consumed outside its guard, you get a TypeError ('bool' object is not iterable). Initializing both to [] and only populating them inside the if block would be clearer. Fix this →


Deprecation: Normals Auto Smooth

The removal of the icon draw call in simplify/ui_exceptions.py (the item.normals_auto_smooth reference) is a clean cleanup. The property was already absent from MustardSimplify_Exception, so this removes an implicit attribute error in the draw function. Good.


Other Changes

Custom openlink operator replaced with wm.url_open (settings/settings_addon.py, menu/menu_tools.py): clean and correct — Blender's built-in is more reliable. The utils/ops_link.py deletion follows naturally.

Settings updates (settings/settings_main.py): the new Complexity Analyzer properties are well-defined, the update callbacks use lambdas that forward to proper functions with clear names, and complexity_analyzer_active is correctly kept as an internal flag (no name/description needed).

Register/unregister ordering is correct throughout: the new panel and operators register/unregister in the right order relative to their parent classes.


Summary

The PR is well-implemented. The main items worth addressing before merge:

Severity Issue
Medium apply_heatmap sets active=True without enabling overlay when scene has no visible meshes
Medium collect_objects excludes non-MESH objects in MODIFIERS mode despite MODIFIER_SUPPORTED_TYPES
Medium settings.objects missing from PRESET_VALUES
Low Silent except: pass in live timer hides errors
Low objects_ignore/modifiers_ignore reused as bool then list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scene complexity analyzer Presets for settings Linked Objects & Librarry Override Issue

1 participant