Skip to content

Fix import when object exists but is not in view layer - #583

Closed
combwizard wants to merge 2 commits into
JoseConseco:masterfrom
combwizard:fix-import-view-layer
Closed

combwizard wants to merge 2 commits into
JoseConseco:masterfrom
combwizard:fix-import-view-layer

Conversation

@combwizard

Copy link
Copy Markdown

Repro: export mesh via GoB, delete from scene (datablock remains), GoZ back, Manual Import.

Error: select_set fails, object not in View Layer.

make_mesh() only linked new objects to a collection. Updates to existing datablocks skipped re-linking.

Adds _ensure_object_in_view_layer() to link orphan/excluded objects into Scene Collection before select_set.

make_mesh() only linked new objects to a collection. Re-importing
by name updated orphan or excluded objects without re-linking them,
so select_set() crashed.
Map _low2/_low3 names to canonical _low meshes, sync low collections
from matching _high objects, remove stale variants, and guard face-set
assignment when polygroup counts diverge. Document fork setup and fixes.
@Boozebeard

Boozebeard commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Hello, I've included a version of the changes proposed in your initial commit. The changes in your second commit should definitely be a new PR with some details on exactly how it is meant to work. The current implementation seems like it would be quite easy for a user who is not familiar with its function to have their meshes overwritten or deleted unintentionally. It would probably need to be something that can be enabled and configured from the settings.

@Boozebeard Boozebeard closed this Sep 11, 2026
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