Skip to content

Fix upload pipeline for collection-instance (rigged) models; add validator dry-run - #2065

Draft
Tweekazoid wants to merge 3 commits into
mainfrom
feature_better_visibility_upload
Draft

Fix upload pipeline for collection-instance (rigged) models; add validator dry-run#2065
Tweekazoid wants to merge 3 commits into
mainfrom
feature_better_visibility_upload

Conversation

@Tweekazoid

Copy link
Copy Markdown
Contributor

Fix upload pipeline for collection-instance (rigged) models; add validator dry-run

Problem

Models using collection-instance empties (e.g. rigged trams with body segments as instanced collections) were uploaded broken: geometry was missing, duplicated, or invisible because the pipeline only tracked direct parent/child hierarchies and didn't account for Blender's three-tier visibility system.

Changes

utils.py

  • New get_hierarchy_with_instances() walks instance_collection references in addition to object.children, with cycle detection. Used by upload.py and autothumb.py.

upload.py

  • Uses get_hierarchy_with_instances to build instance_collection_names and objects_in_instance_cols; excludes the latter from obnames to prevent double-loading.
  • Added _snapshot_and_project_visibility / _restore_visibility helpers that project per-view-layer eye-hide state onto Object.hide_viewport / Collection.hide_viewport before save_as_mainfile(copy=True), then restore — so eye-hidden objects stay hidden after append into a fresh scene.

upload_bg.py

  • After appending, discovers auto-loaded instance collections by walking the appended empties' instance_collection pointers instead of a second explicit libraries.load (which caused .001 duplicates).
  • Body collections are unlinked from the scene collection so they don't render directly at origin, but remain in bpy.data so instance empties can still reference them for rendering.

upload_dryrun.py (new)

  • Validator-only operator that runs the full upload-bg pipeline locally without a server round-trip.
  • Mirrors prepare_asset_data logic, invokes upload_bg.py in a non-blocking subprocess thread, optionally opens the resulting blend in a new Blender instance.

ui_panels.py

  • Dry-run button added to the upload panel, visible only to validators (profile_is_validator()), model/printable assets only.

@Tweekazoid Tweekazoid self-assigned this Apr 30, 2026
@Tweekazoid
Tweekazoid marked this pull request as draft April 30, 2026 21:36
@vilemduha

Copy link
Copy Markdown
Contributor

This is a big deal if we finally fix it, we should have a call maybe.

@Tweekazoid
Tweekazoid marked this pull request as ready for review May 5, 2026 08:17
@Tweekazoid
Tweekazoid marked this pull request as draft May 21, 2026 21:57
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