【发布时间】:2022-10-15 17:53:03
【问题描述】:
我正在开发一个使用 inkscape 来操作 SVG 的 SVG 动画工具,我需要更新 inkscape 以显示动画 SVG 的选定状态,以便让用户进行更改(它是一个外部工具而不是插件)。
例如:一个矩形从 x:100 变为 x:300,当矩形在 x:200 时用户暂停动画,然后工具将 SVG 状态保存为 x:200,唯一的问题是inkscape 没有刷新,所以我需要关闭并打开inkscape,或者手动转到文件>恢复。
我一直在调查,发现有一个称为 FileRevert 的动词(在 1.2 中删除动词之前),我尝试使用 1.1 版并使用 inkscape GUI 打开此命令:
inkscape --verb FileRevert test.svg
这是命令的完整输出:(最后的完整日志)
user@user:~/Desktop$ ./ink2.AppImage --verb FileRevert test.svg
WARNING: ignoring verb FileRevert - GUI required for this verb.
** (org.inkscape.Inkscape:6946): CRITICAL **: 08:40:38.988: static void Inkscape::FileVerb::perform(SPAction*, void*): assertion 'ensure_desktop_valid(action)' failed
所以错误似乎是没有检测到 GUI,idk 如果我必须告诉 cli GUI 在哪里或从 GUI 打开 inkscape,但我尝试了这个并且终端被阻止,直到你关闭 inkscape。
然后我尝试了 inkscape 1.2 动作,因为文档说所有动词都可以作为动作使用:
但在 --action-list 中没有 FileRevert 操作,而且在 1.2 发行说明中也没有关于 FileRevert 任何弃用的信息,因此很难猜测发生了什么。
这是使用操作尝试 FileRevert 的输出:(最后的完整日志)
user@user:~/Desktop$ ./ink.AppImage --actions="FileRevert" test.svg
InkscapeApplication::parse_actions: could not find action for: FileRevert
所以它似乎无法找到 FileRevert 操作,这可能意味着它不受支持或不推荐使用。
我正在使用 linux mint 以防万一。
欢迎任何帮助,或者我的问题的任何替代解决方案...... atm 我正在考虑如此糟糕的替代方案,比如每次你想刷新它时自动关闭和重新打开inkscape,或者选择inkscape窗口并触发一个热键来恢复文件。
谢谢!
完整日志 1.1 动词尝试:
user@user:~/Desktop$ ./ink2.AppImage --verb FileRevert test.svg
Setting _INKSCAPE_GC=disable as a workaround for broken libgc
Gtk-Message: 08:40:38.030: Failed to load module "xapp-gtk3-module"
** (org.inkscape.Inkscape:6946): WARNING **: 08:40:38.964: <svg:rect id="">: CSS Style property: "stroke-width" with default value (1) not needed.
** (org.inkscape.Inkscape:6946): WARNING **: 08:40:38.964: <svg:rect id="rect786">: CSS Style property: "stroke-width" with default value (1) not needed.
** (org.inkscape.Inkscape:6946): WARNING **: 08:40:38.964: <svg:rect id="rect786">: CSS Style property: "stroke-width" with default value (1) not needed.
WARNING: ignoring verb FileRevert - GUI required for this verb.
** (org.inkscape.Inkscape:6946): CRITICAL **: 08:40:38.988: static void Inkscape::FileVerb::perform(SPAction*, void*): assertion 'ensure_desktop_valid(action)' failed
完整日志 1.2 操作尝试:
user@user:~/Desktop$ ./ink.AppImage --actions="FileRevert" test.svg
Setting _INKSCAPE_GC=disable as a workaround for broken libgc
Gtk-Message: 08:49:36.363: Failed to load module "xapp-gtk3-module"
InkscapeApplication::parse_actions: could not find action for: FileRevert
** (org.inkscape.Inkscape:7139): WARNING **: 08:49:37.377: <svg:rect id="">: CSS Style property: "stroke-width" with default value (1) not needed.
** (org.inkscape.Inkscape:7139): WARNING **: 08:49:37.377: <svg:rect id="rect786">: CSS Style property: "stroke-width" with default value (1) not needed.
** (org.inkscape.Inkscape:7139): WARNING **: 08:49:37.378: <svg:rect id="rect786">: CSS Style property: "stroke-width" with default value (1) not needed.
编辑:在 Inkscape 中工作和更新的工具演示: https://www.youtube.com/watch?v=fDAIVKd19YU
【问题讨论】:
-
FileRevert 是一个动词。动词在 1.2.x 中被完全删除并替换为动作
-
@s.ouchene 我知道,这就是为什么我尝试将 1.1 版作为动词,也作为 1.2 中的动作,因为假设所有动词都转换为动作:wiki.inkscape.org/wiki/Release_notes/1.2#Behind_the_curtains“命令行'动词'已被删除. 所有动词都可以作为“动作”使用”
-
动词需要 GUI。对于 1.1.x 使用
--with-gui选项。 -
我认为发行说明中有错误。查看我在这里打开的问题:gitlab.com/inkscape/inbox/-/issues/7704
-
winodws不是指操作系统,而是指 GUI。