Use new frame api to enable/disable motion and shape tween menu items
This commit is contained in:
parent
277e67ca9e
commit
fe2b1cce57
30
src/main.js
30
src/main.js
|
|
@ -7448,22 +7448,18 @@ async function renderMenu() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
activeKeyframe = false;
|
const frameInfo = context.activeObject.activeLayer.getFrameValue(
|
||||||
if (
|
context.activeObject.currentFrameNum
|
||||||
context.activeObject.activeLayer.frames[
|
)
|
||||||
context.activeObject.currentFrameNum
|
if (frameInfo.valueAtN) {
|
||||||
]
|
|
||||||
) {
|
|
||||||
activeFrame = true;
|
activeFrame = true;
|
||||||
if (
|
activeKeyframe = true;
|
||||||
context.activeObject.activeLayer.frames[
|
} else if (frameInfo.prev && frameInfo.next) {
|
||||||
context.activeObject.currentFrameNum
|
activeFrame = true;
|
||||||
].frameType == "keyframe"
|
activeKeyframe = false;
|
||||||
) {
|
|
||||||
activeKeyframe = true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
activeFrame = false;
|
activeFrame = false;
|
||||||
|
activeKeyframe = false;
|
||||||
}
|
}
|
||||||
const appSubmenu = await Submenu.new({
|
const appSubmenu = await Submenu.new({
|
||||||
text: "Lightningbeam",
|
text: "Lightningbeam",
|
||||||
|
|
@ -7683,20 +7679,18 @@ async function renderMenu() {
|
||||||
const timelineSubmenu = await Submenu.new({
|
const timelineSubmenu = await Submenu.new({
|
||||||
text: "Timeline",
|
text: "Timeline",
|
||||||
items: [
|
items: [
|
||||||
newFrameMenuItem,
|
// newFrameMenuItem,
|
||||||
newKeyframeMenuItem,
|
newKeyframeMenuItem,
|
||||||
deleteFrameMenuItem,
|
deleteFrameMenuItem,
|
||||||
duplicateKeyframeMenuItem,
|
duplicateKeyframeMenuItem,
|
||||||
{
|
{
|
||||||
text: "Add Motion Tween",
|
text: "Add Motion Tween",
|
||||||
enabled: true,
|
enabled: activeFrame,
|
||||||
// enabled: activeFrame && !activeKeyframe,
|
|
||||||
action: actions.addMotionTween.create,
|
action: actions.addMotionTween.create,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "Add Shape Tween",
|
text: "Add Shape Tween",
|
||||||
enabled: true,
|
enabled: activeFrame,
|
||||||
// enabled: activeFrame && !activeKeyframe,
|
|
||||||
action: actions.addShapeTween.create,
|
action: actions.addShapeTween.create,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue