Fix meshes being visible in animation mode

This commit is contained in:
JannisX11 2021-12-01 11:49:35 +01:00
parent 75f084dffe
commit 35d56d7057
2 changed files with 5 additions and 4 deletions

View File

@ -1317,8 +1317,7 @@ const Animator = {
if (BoneAnimator.prototype.channels[channel].transform) Animator._last_values[channel] = [0, 0, 0];
}
},
join() {
join() {
if (isApp && (Format.id == 'bedrock' || Format.id == 'bedrock_old') && !Project.BedrockEntityManager.initialized_animations) {
Project.BedrockEntityManager.initAnimations();
}
@ -1326,7 +1325,6 @@ const Animator = {
Animator.open = true;
Canvas.updateAllBones()
Outliner.vue.options.hidden_types.push('cube');
scene.add(WinterskyScene.space);
WinterskyScene.global_options.tick_rate = settings.particle_tick_rate.value;
if (settings.motion_trails.value) scene.add(Animator.motion_trail);
@ -1357,7 +1355,6 @@ const Animator = {
leave() {
Timeline.pause()
Animator.open = false;
Outliner.vue.options.hidden_types.remove('cube');
scene.remove(WinterskyScene.space);
scene.remove(Animator.motion_trail);

View File

@ -11,6 +11,7 @@ class Mode extends KeybindItem {
this.default_tool = data.default_tool;
this.selectElements = data.selectElements !== false
this.hidden_node_types = data.hidden_node_types instanceof Array ? data.hidden_node_types.slice() : [];
this.center_windows = data.center_windows||[];
this.hide_toolbars = data.hide_toolbars
@ -66,6 +67,8 @@ class Mode extends KeybindItem {
$('#main_toolbar .toolbar_wrapper').css('visibility', this.hide_toolbars ? 'hidden' : 'visible');
$('#status_bar').css('display', this.hide_status_bar ? 'none' : 'flex');
Outliner.vue.options.hidden_types.replace(this.hidden_node_types);
if (typeof this.onSelect === 'function') {
this.onSelect()
}
@ -169,6 +172,7 @@ BARS.defineActions(function() {
default_tool: 'move_tool',
category: 'navigate',
center_windows: ['preview', 'timeline'],
hidden_node_types: ['cube', 'mesh', 'texture_mesh'],
condition: () => Format.animation_mode,
onSelect: () => {
Animator.join()