add delete/backspace to remove model. front view. no auto-select on add
This commit is contained in:
parent
d73cf48d90
commit
b4e9a8a87a
3 changed files with 24 additions and 7 deletions
|
|
@ -183,7 +183,6 @@ let group = {
|
|||
groups.addOnce(group);
|
||||
space.world.add(group.group);
|
||||
space.update();
|
||||
selection.set([group]);
|
||||
return group;
|
||||
},
|
||||
|
||||
|
|
@ -234,6 +233,7 @@ let api = mesh.api = {
|
|||
},
|
||||
|
||||
objects: () => {
|
||||
// return models, not groups
|
||||
return group.list().map(o => o.models).flat().map(o => o.object());
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -42,6 +42,13 @@ mesh.group = class MeshGroup extends mesh.object {
|
|||
|
||||
// @param model {MeshModel}
|
||||
remove(model) {
|
||||
// remove all models
|
||||
if (arguments.length === 0) {
|
||||
for (let m of this.models.slice()) {
|
||||
this.remove(m);
|
||||
}
|
||||
return;
|
||||
}
|
||||
model.group = undefined;
|
||||
this.models.remove(model);
|
||||
this.group.remove(model.mesh);
|
||||
|
|
|
|||
Loading…
Reference in a new issue