mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
[ui] Remove intrinsic if not used by any viewpoint
This commit is contained in:
parent
6791f02f2d
commit
561e9b806c
1 changed files with 18 additions and 0 deletions
|
@ -292,6 +292,24 @@ Panel {
|
||||||
|
|
||||||
function sendRemoveRequest() {
|
function sendRemoveRequest() {
|
||||||
if (!readOnly) {
|
if (!readOnly) {
|
||||||
|
// look if the viewpoint's intrinsic is used by another viewpoint
|
||||||
|
var intrinsicId = object.value.get('intrinsicId').value
|
||||||
|
var intrinsicUsed = false
|
||||||
|
for (var i = 0; i < m.viewpoints.count; ++i) {
|
||||||
|
if (m.viewpoints.at(i) != object && m.viewpoints.at(i).value.get("intrinsicId").value === intrinsicId) {
|
||||||
|
intrinsicUsed = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!intrinsicUsed) {
|
||||||
|
//find the intrinsic and remove it
|
||||||
|
for (var i = 0; i < m.intrinsics.count; ++i) {
|
||||||
|
if (m.intrinsics.at(i).value.get("intrinsicId").value === intrinsicId) {
|
||||||
|
_reconstruction.removeAttribute(m.intrinsics.at(i))
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
removeImageRequest(object)
|
removeImageRequest(object)
|
||||||
// If the last image has been removed, make sure the viewpoints and intrinsics are reset
|
// If the last image has been removed, make sure the viewpoints and intrinsics are reset
|
||||||
if (m.viewpoints.count === 0)
|
if (m.viewpoints.count === 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue