Fix #1613 Duplicate texture ids when merging projects

Fix locators and null objects not being selectable via area select
This commit is contained in:
JannisX11 2022-11-05 20:32:38 +01:00
parent 91df921b25
commit 9a82da08e2
2 changed files with 6 additions and 1 deletions

View File

@ -450,6 +450,11 @@ var codec = new Codec('project', {
tex.uuid = tex_uuid_map[tex.uuid];
}
var tex_copy = new Texture(tex, tex.uuid).add(false);
let c = 0;
while (Texture.all.find(t => t !== tex_copy && t.id == c)) {
c++;
tex_copy.id = c.toString();
}
if (isApp && tex.path && fs.existsSync(tex.path) && !model.meta.backup) {
tex_copy.fromPath(tex.path)
return tex_copy;

View File

@ -1156,7 +1156,7 @@ class Preview {
isSelected = true
} else if (element.visibility) {
if (element.mesh && element.mesh.geometry) {
if (element.mesh && element.resizable) {
let {mesh} = element;
if (element instanceof Mesh && (selection_mode == 'object' || scope.selection.old_selected.includes(element))) {