Skip to content

Commit

Permalink
retain pivot point when saving annotation view
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed Jun 17, 2024
1 parent 4043f21 commit 482cf14
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions source/client/components/CVAnnotationsTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,15 @@ export default class CVAnnotationsTask extends CVTask
{
const machine = this._machine;
const props = machine.getTargetProperties();
const orbitIdx = props.findIndex((elem) => {return elem.name == "Orbit"});
const offsetIdx = props.findIndex((elem) => {return elem.name == "Offset"});
const retainIdx = [];
for(let i = 0; i < props.length; i++) {
if(["Pivot", "Orbit", "Offset"].includes(props[i].name)) retainIdx.push(i);
}

// set non camera properties to null to skip them
const values = machine.getCurrentValues();
values.forEach((v, idx) => {
if(idx != orbitIdx && idx != offsetIdx) {
if(!retainIdx.includes(idx)) {
values[idx] = null;
}
});
Expand Down

0 comments on commit 482cf14

Please sign in to comment.