Fix #1547 Scale keyframes incorrectly set to uniform

Fix #1549 Image adjusting sliders make translucent pixels opaque
Fix an issue with custom animation channels
Fix colors in Wintersky particles, update tinycolor to 1.4.2
Fix vertex snap not working on cubes
This commit is contained in:
JannisX11 2022-09-02 23:31:32 +02:00
parent b8d907b931
commit 8a3c7bd28b
5 changed files with 357 additions and 259 deletions

View File

@ -1217,6 +1217,7 @@ const Animator = {
ba.addKeyframe({
time: 0,
channel,
uniform: !(b[channel] instanceof Array),
data_points: getKeyframeDataPoints(b[channel]),
})
} else if (typeof b[channel] === 'object' && b[channel].post) {
@ -1224,6 +1225,7 @@ const Animator = {
time: 0,
channel,
interpolation: b[channel].lerp_mode,
uniform: !(b[channel].post instanceof Array),
data_points: getKeyframeDataPoints(b[channel]),
});
} else if (typeof b[channel] === 'object') {
@ -1232,6 +1234,7 @@ const Animator = {
time: parseFloat(timestamp),
channel,
interpolation: b[channel][timestamp].lerp_mode,
uniform: !(b[channel][timestamp] instanceof Array),
data_points: getKeyframeDataPoints(b[channel][timestamp]),
});
}

View File

@ -132,13 +132,18 @@ GeneralAnimator.addChannel = function(channel, options) {
mutable: typeof options.mutable === 'boolean' ? options.mutable : true,
max_data_points: options.max_data_points || 0
}
Timeline.animators.forEach(animator => {
if (animator instanceof this && !animator[channel]) {
Vue.set(animator, channel, []);
if (this.prototype.channels[channel].mutable) {
Vue.set(animator.muted, channel, false);
}
}
ModelProject.all.forEach(project => {
if (!project.animations)
project.animations.forEach(animation => {
animation.animators.forEach(animator => {
if (animator instanceof this && !animator[channel]) {
Vue.set(animator, channel, []);
if (this.prototype.channels[channel].mutable) {
Vue.set(animator.muted, channel, false);
}
}
})
})
})
Timeline.vue.$forceUpdate();
}
@ -148,9 +153,9 @@ class BoneAnimator extends GeneralAnimator {
this.uuid = uuid;
this._name = name;
this.rotation = [];
this.position = [];
this.scale = [];
for (let channel in this.channels) {
this[channel] = [];
}
}
get name() {
var group = this.getGroup();

View File

@ -247,6 +247,7 @@ const Vertexsnap = {
vectors.push([0, 0, 0]);
let points = new THREE.Points(new THREE.BufferGeometry(), new THREE.PointsMaterial().copy(Canvas.meshVertexMaterial));
points.element_uuid = element.uuid;
points.vertices = vectors;
let vector_positions = [];
vectors.forEach(vector => vector_positions.push(...vector));

View File

@ -21,6 +21,7 @@ BARS.defineActions(function() {
texture.edit((canvas) => {
let ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, texture.width, texture.height);
ctx.filter = 'invert(1)';
ctx.drawImage(canvas, 0, 0);
@ -56,6 +57,7 @@ BARS.defineActions(function() {
textures.forEach((texture, i) => {
texture.edit((canvas) => {
let ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, texture.width, texture.height);
ctx.filter = `brightness(${this.brightness / 100}) contrast(${this.contrast / 100})`;
ctx.drawImage(original_imgs[i], 0, 0);
@ -130,6 +132,7 @@ BARS.defineActions(function() {
textures.forEach((texture, i) => {
texture.edit((canvas) => {
let ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, texture.width, texture.height);
ctx.filter = `saturate(${this.saturation / 100}) hue-rotate(${this.hue}deg)`;
ctx.drawImage(original_imgs[i], 0, 0);

File diff suppressed because it is too large Load Diff