Fix #809 Pivot tool issue

Fix issues in timeline
This commit is contained in:
JannisX11 2021-01-24 19:19:10 +01:00
parent b05b7af9b3
commit 0ba5de8ab8
2 changed files with 21 additions and 18 deletions

View File

@ -555,7 +555,7 @@ const Timeline = {
Timeline.animators.forEach(animator => {
keyframes.push(...animator.keyframes)
})
} else if (Timeline.vue.graph_editor_animator) {
} else if (Timeline.vue.graph_editor_animator && Timeline.vue.graph_editor_animator[Timeline.vue.graph_editor_channel]) {
keyframes.push(...Timeline.vue.graph_editor_animator[Timeline.vue.graph_editor_channel])
}
return keyframes;
@ -949,21 +949,23 @@ onVueSetup(function() {
<path :d="one_line" style="stroke: var(--color-grid); stroke-dasharray: 6;" v-if="graph_editor_channel == 'scale'"></path>
<path :d="graph" :style="{stroke: 'var(--color-axis-' + graph_editor_axis + ')'}"></path>
</svg>
<keyframe
v-for="keyframe in graph_editor_animator[graph_editor_channel]"
v-bind:style="{left: (10 + keyframe.time * size) + 'px', top: (graph_offset - keyframe.display_value * graph_size - 8) + 'px', color: getColor(keyframe.color)}"
class="keyframe graph_keyframe"
v-bind:class="[keyframe.channel, keyframe.selected?'selected':'']"
v-bind:id="keyframe.uuid"
v-on:click.stop="keyframe.select($event)"
v-on:dblclick="keyframe.callPlayhead()"
:title="trimFloatNumber(keyframe.time) + ' ⨉ ' + keyframe.display_value"
@mousedown="dragKeyframes(keyframe, $event)" @touchstart="dragKeyframes(keyframe, $event)"
@contextmenu.prevent="keyframe.showContextMenu($event)"
>
<i class="material-icons keyframe_icon_smaller" v-if="keyframe.interpolation == 'catmullrom'">lens</i>
<i class="material-icons" v-else>stop</i>
</keyframe>
<template v-if="graph_editor_animator">
<keyframe
v-for="keyframe in graph_editor_animator[graph_editor_channel]"
v-bind:style="{left: (10 + keyframe.time * size) + 'px', top: (graph_offset - keyframe.display_value * graph_size - 8) + 'px', color: getColor(keyframe.color)}"
class="keyframe graph_keyframe"
v-bind:class="[keyframe.channel, keyframe.selected?'selected':'']"
v-bind:id="keyframe.uuid"
v-on:click.stop="keyframe.select($event)"
v-on:dblclick="keyframe.callPlayhead()"
:title="trimFloatNumber(keyframe.time) + ' ⨉ ' + keyframe.display_value"
@mousedown="dragKeyframes(keyframe, $event)" @touchstart="dragKeyframes(keyframe, $event)"
@contextmenu.prevent="keyframe.showContextMenu($event)"
>
<i class="material-icons keyframe_icon_smaller" v-if="keyframe.interpolation == 'catmullrom'">lens</i>
<i class="material-icons" v-else>stop</i>
</keyframe>
</template>
</div>
</div>
</div>

View File

@ -1033,12 +1033,12 @@
})
}
_has_groups = Format.bone_rig && Group.selected && Group.selected.matchesSelection() && Toolbox.selected.transformerMode == 'translate';
var rotate_group = Format.bone_rig && Group.selected && (Toolbox.selected.transformerMode == 'rotate' || Toolbox.selected.id == 'pivot_tool');
var rotate_group = Format.bone_rig && Group.selected && (Toolbox.selected.transformerMode == 'rotate');
if (rotate_group) {
Undo.initEdit({group: Group.selected})
} else if (_has_groups) {
Undo.initEdit({elements: selected, outliner: true})
Undo.initEdit({elements: selected, outliner: true, selection: true})
} else {
Undo.initEdit({elements: selected})
}
@ -1292,6 +1292,7 @@
}
displayDistance(point[axis] - originalValue);
Canvas.updatePositions(true);
Canvas.updateAllBones();
if (Modes.animate) {
Animator.preview();
}