live preview of multiple props at the same time

This commit is contained in:
jrkb 2023-10-07 13:18:39 +02:00
parent de5550287c
commit f8984174e0
2 changed files with 16 additions and 3 deletions

View file

@ -629,10 +629,21 @@ const Audio = function(tp, record) {
} }
}; };
} }
let values = {};
propsToSet.forEach((p) => { propsToSet.forEach((p) => {
immediateUpdate(p.layer, { const newValues = {
[p.title]: p.value [p.title]: p.value
}); };
if (!values.hasOwnProperty(p.id)) {
values[p.id] = {};
}
values[p.id] = {
...values[p.id],
...newValues,
};
});
Object.keys(values).forEach((layerID) => {
immediateUpdate(getLayer(layerID), values[layerID]);
}); });
} }
} else { } else {

View file

@ -304,6 +304,7 @@ const Record = function(tp) {
}; };
const startRecording = () => { const startRecording = () => {
console.log('Record::startRecording');
tp.sheet.sequence.pause(); tp.sheet.sequence.pause();
const layerKeys = Object.keys(hot); const layerKeys = Object.keys(hot);
layerKeys.forEach((layerID) => { layerKeys.forEach((layerID) => {
@ -327,7 +328,8 @@ const Record = function(tp) {
[propTitle]: value, [propTitle]: value,
}; };
buffy.addValues(layerID, recording, position, lastPosition); buffy.addValues(layerID, recording, position, lastPosition);
liveUpdater.immediateUpdate(layer, recording); const merged = buffy.getValues(layerID, position);
liveUpdater.immediateUpdate(layer, merged);
lastPosition = position; lastPosition = position;
}); });
} else { } else {