mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Disallow entity models to be reset to natural dimensions if unknown
This commit is contained in:
parent
6c8a78a9a7
commit
0495833ca6
1 changed files with 12 additions and 3 deletions
|
@ -957,9 +957,18 @@ PropertiesTool = function(opts) {
|
|||
selectionManager.saveProperties();
|
||||
for (var i = 0; i < selectionManager.selections.length; i++) {
|
||||
var properties = selectionManager.savedProperties[selectionManager.selections[i].id];
|
||||
Entities.editEntity(selectionManager.selections[i], {
|
||||
dimensions: properties.naturalDimensions,
|
||||
});
|
||||
var naturalDimensions = properties.naturalDimensions;
|
||||
|
||||
// If any of the natural dimensions are not 0, resize
|
||||
if (properties.type == "Model" && naturalDimensions.x == 0
|
||||
&& naturalDimensions.y == 0 || naturalDimensions.z == 0) {
|
||||
Window.alert("Cannot reset entity to its natural dimensions: Model URL"
|
||||
+ " is invalid or the model has not yet been loaded.");
|
||||
} else {
|
||||
Entities.editEntity(selectionManager.selections[i], {
|
||||
dimensions: properties.naturalDimensions,
|
||||
});
|
||||
}
|
||||
}
|
||||
pushCommandForSelections();
|
||||
selectionManager._update();
|
||||
|
|
Loading…
Reference in a new issue