Skip to content

Commit

Permalink
Aborted extra changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev committed May 27, 2024
1 parent 48494ae commit dd33779
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions cvat-core/src/annotations-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3078,7 +3078,7 @@ export class SkeletonTrack extends Track {
rotation: 0,
}));

const result = {
return {
...position,
parentID: null,
attributes: this.getAttributes(frame),
Expand All @@ -3103,14 +3103,6 @@ export class SkeletonTrack extends Track {
hidden: elements.every((el) => el.hidden),
...this.withContext(frame),
};

elements.forEach((el) => {
// illegal to update skeleton element if the first skeleton frame is later
// the skeleton elements will be locked on such frames
el.lock = el.lock || el.frame < this.frame;
});

return result;
}

// finds keyframes considering keyframes of nested elements
Expand Down Expand Up @@ -3251,29 +3243,24 @@ export class SkeletonTrack extends Track {
const updatedHidden = data.elements.filter((el) => el.updateFlags.hidden);
const updatedLock = data.elements.filter((el) => el.updateFlags.lock);

updatedPoints.forEach((el) => { el.updateFlags.points = false; });
updatedOccluded.forEach((el) => { el.updateFlags.occluded = false; });
updatedOutside.forEach((el) => { el.updateFlags.outside = false; });
updatedKeyframe.forEach((el) => { el.updateFlags.keyframe = false; });
updatedHidden.forEach((el) => { el.updateFlags.hidden = false; });
updatedLock.forEach((el) => { el.updateFlags.lock = false; });

if (updatedPoints.length) {
updatedPoints.forEach((el) => { el.updateFlags.points = true; });
updateElements(updatedPoints, HistoryActions.CHANGED_POINTS);
updatedPoints.forEach((el) => { el.updateFlags.points = false; });
}

if (updatedOccluded.length) {
updatedOccluded.forEach((el) => { el.updateFlags.occluded = true; });
updateElements(updatedOccluded, HistoryActions.CHANGED_OCCLUDED);
updatedOccluded.forEach((el) => { el.updateFlags.occluded = false; });
}

if (updatedOutside.length) {
updatedOutside.forEach((el) => { el.updateFlags.outside = true; });
updateElements(updatedOutside, HistoryActions.CHANGED_OUTSIDE);
updatedOutside.forEach((el) => { el.updateFlags.outside = false; });
}

if (updatedKeyframe.length) {
Expand All @@ -3283,19 +3270,16 @@ export class SkeletonTrack extends Track {
this.saveKeyframe(frame, data.keyframe);
data.updateFlags.keyframe = false;
updateElements(updatedKeyframe, HistoryActions.CHANGED_KEYFRAME);
updatedKeyframe.forEach((el) => { el.updateFlags.keyframe = false; });
}

if (updatedHidden.length) {
updatedHidden.forEach((el) => { el.updateFlags.hidden = true; });
updateElements(updatedHidden, HistoryActions.CHANGED_HIDDEN, 'hidden');
updatedHidden.forEach((el) => { el.updateFlags.hidden = false; });
}

if (updatedLock.length) {
updatedLock.forEach((el) => { el.updateFlags.lock = true; });
updateElements(updatedLock, HistoryActions.CHANGED_LOCK, 'lock');
updatedLock.forEach((el) => { el.updateFlags.lock = false; });
}

return Track.prototype.save.call(this, frame, data);
Expand Down

0 comments on commit dd33779

Please sign in to comment.