forked from Sollumz/Sollumz
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lods): rework LOD system to prevent 'not single-user' warnings/me…
…sh duplication Many operations in Blender expect the mesh data-block to be single-user (applying all transforms, applying modifiers, etc.). When the mesh isn't single-user (has multiple references), Blender shows a dialog box asking whether you want to proceed and make the mesh single-user (duplicate it). The previous LOD system kept a reference to the current LOD mesh, so it never was single-user and this dialog appeared really often. More annoyingly, this causes the meshes in the LOD list to end up out-of-sync, unless the user remembers to update it. Otherwise, on export it exports the old mesh, not the new one created by Blender. The new LOD system only keeps a mesh reference for non-active LODs. For the active LOD, it always considers `Object.data` as its mesh. When switching to a LOD, its mesh reference is removed, so it only has a single-user in `Object.data`. When switching away, the mesh in `Object.data` is stored back in the mesh reference. New data version 2 to upgrade objects from the old LOD system to the new one. Also renamed `Object.sollumz_lods` to `Object.sz_lods`. Fixes Sollumz#858.
- Loading branch information
1 parent
268e39a
commit f2ca3de
Showing
15 changed files
with
370 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.