Skip to content

Commit

Permalink
Fix #1547 Scale keyframes incorrectly set to uniform
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JannisX11 committed Sep 2, 2022
1 parent b8d907b commit 8a3c7bd
Show file tree
Hide file tree
Showing 5 changed files with 357 additions and 259 deletions.
3 changes: 3 additions & 0 deletions js/animations/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1217,13 +1217,15 @@ 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) {
ba.addKeyframe({
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') {
Expand All @@ -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]),
});
}
Expand Down
25 changes: 15 additions & 10 deletions js/animations/timeline_animators.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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();
Expand Down
1 change: 1 addition & 0 deletions js/modeling/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
3 changes: 3 additions & 0 deletions js/texturing/edit_texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
Loading

0 comments on commit 8a3c7bd

Please sign in to comment.