Make keyframes in motion trails right clickable

This commit is contained in:
JannisX11 2020-10-16 19:44:58 +02:00
parent a0c748e198
commit 9ee7c35749
5 changed files with 8 additions and 8 deletions

View File

@ -1304,7 +1304,7 @@ const Animator = {
if (object.isLine) return;
var scaleVector = new THREE.Vector3();
var scale = scaleVector.subVectors(object.position, Preview.selected.camera.position).length() / 500;
scale = (Math.sqrt(scale)/3 + scale/1.4) * 3.8
scale = (Math.sqrt(scale)/3 + scale/1.4) * 4
if (Blockbench.isMobile) scale *= 4;
object.scale.set(scale, scale, scale)
})
@ -1504,7 +1504,6 @@ const Animator = {
let json = autoParseJSON(file.content)
let keys = [];
for (var key in json.animations) {
console.log(key)
// Test if already loaded
if (isApp && file.path) {
let is_already_loaded = false

View File

@ -316,6 +316,7 @@ class Keyframe {
showContextMenu(event) {
if (!this.selected) {
this.select();
updateKeyframeSelection();
}
this.menu.open(event, this);
return this;

View File

@ -668,10 +668,12 @@ class Preview {
Prop.active_panel = 'preview';
if (this.static_rclick && (event.which === 3 || (event.type == 'touchend' && this.rclick_cooldown == true))) {
var data = this.raycast(event)
if (Toolbox.selected.selectCubes && Modes.selected.selectCubes && data && data.cube) {
if (!Modes.animate) {
data.cube.showContextMenu(event)
}
if (Toolbox.selected.selectCubes && Modes.selected.selectCubes && data && data.cube && !Modes.animate) {
data.cube.showContextMenu(event);
} else if (data.type == 'keyframe') {
data.keyframe.showContextMenu(event);
} else {
this.menu.open(event, this)
}

View File

@ -78,7 +78,6 @@ class Texture {
console.log('Successfully loaded '+scope.name+' from default pack')
}
//Width / Animation
if (img.naturalWidth !== img.naturalHeight && Format.id == 'java_block') {
BARS.updateConditions()

View File

@ -90,7 +90,6 @@ function setupMobilePanelSelector() {
for (var id in this.all_panels) {
let panel = this.all_panels[id];
if (Condition(panel.condition)) {
console.log(id)
arr.push(panel)
}
}