Add animation button

Improvements to benchbot skin
This commit is contained in:
JannisX11 2020-09-15 17:14:37 +02:00
parent 84255bfde4
commit e671a9787d
5 changed files with 25 additions and 19 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -424,23 +424,24 @@
flex-shrink: 1;
overflow: hidden;
}
.animation .animation_play_toggle {
.in_list_button {
width: 22px;
color: var(--color-text);
}
.animation .animation_play_toggle:hover {
.in_list_button:hover {
color: var(--color-light);
}
.animation .animation_save_button {
.in_list_button {
width: 22px;
color: var(--color-text);
}
.animation .animation_save_button:hover {
.in_list_button:hover {
color: var(--color-light);
}
.animation .animation_save_button:not(.clickable) {
.in_list_button.unclickable {
opacity: 0.5;
color: var(--color-text) !important;
pointer-events: none;
}
.animation_file_head {

View File

@ -1090,12 +1090,6 @@ const Animator = {
selected.empty()
Canvas.updateAllBones()
//if (quad_previews.enabled) {
// quad_previews.enabled_before = true
//}
//main_preview.fullscreen()
//main_preview.setNormalCamera()
$('body').addClass('animation_mode')
if (!Animator.timeline_node) {
Animator.timeline_node = $('#timeline').get(0)
@ -1363,7 +1357,7 @@ BARS.defineActions(function() {
category: 'animation',
condition: {modes: ['animate']},
click: function () {
var animation = new Animation({
new Animation({
name: 'animation.' + (Project.geometry_name||'model') + '.new'
}).add(true).propertiesDialog()

View File

@ -225,7 +225,7 @@ class Keyframe {
}
}
Timeline.selected.safePush(this);
if (Timeline.selected.length == 1 && Timeline.selected[0].Animation.selected == false) {
if (Timeline.selected.length == 1 && Timeline.selected[0].animator.selected == false) {
Timeline.selected[0].animator.select()
}

View File

@ -321,6 +321,14 @@ function setupPanels() {
} else {
}
},
addAnimation(path) {
let other_animation = Animation.all.find(a => a.path == path)
console.log(path, other_animation)
new Animation({
name: other_animation && other_animation.name.replace(/\w+$/, 'new'),
path
}).add(true).propertiesDialog()
}
},
computed: {
@ -347,9 +355,12 @@ function setupPanels() {
<div class="animation_file_head" v-on:click.stop="toggle(key)">
<i v-on:click.stop="toggle(key)" class="icon-open-state fa" :class=\'{"fa-angle-right": files_folded[key], "fa-angle-down": !files_folded[key]}\'></i>
<label>{{ file.name }}</label>
<div class="animation_file_save_button" v-if="!file.saved" v-on:click.stop="saveFile(key, file)">
<div class="in_list_button" v-if="!file.saved" v-on:click.stop="saveFile(key, file)">
<i class="material-icons">save</i>
</div>
<div class="in_list_button" v-on:click.stop="addAnimation(key)">
<i class="material-icons">add</i>
</div>
</div>
<ul v-if="!files_folded[key]">
<li
@ -364,14 +375,14 @@ function setupPanels() {
>
<i class="material-icons">movie</i>
<label>{{ animation.name }}</label>
<div class="animation_play_toggle" v-on:click.stop="animation.togglePlayingState()">
<i v-if="animation.playing" class="fa_big far fa-play-circle"></i>
<i v-else class="fa_big far fa-circle"></i>
</div>
<div class="animation_save_button" v-bind:class="{clickable: !animation.saved}" v-on:click.stop="animation.save()">
<div class="in_list_button" v-bind:class="{unclickable: animation.saved}" v-on:click.stop="animation.save()">
<i v-if="animation.saved" class="material-icons">check_circle</i>
<i v-else class="material-icons">save</i>
</div>
<div class="in_list_button" v-on:click.stop="animation.togglePlayingState()">
<i v-if="animation.playing" class="fa_big far fa-play-circle"></i>
<i v-else class="fa_big far fa-circle"></i>
</div>
</li>
</ul>
</li>