Extension to export objects to separate files for animation

Bug #1530380 reported by su_v
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Wishlist
Unassigned

Bug Description

Based on a request posted earlier this year on the mailing list [1] to export paths created with the 'Interpolate' extension to individual SVG files, I started to work on such an extension - out of curiosity, mostly, to better understand limitations of the current extension system.

Main features:
==============
The extension allows to export
- a selection of multiple objects, or
- the members of a single selected group, or
- all layers, or
- all sublayers of the current layer (or of all layers)
to separate files into a user-defined export directory. The exported files can be saved as individual files, as TAR or as ZIP archive.

Supported file formats for export are:
- Inkscape SVG (the default)
- Plain SVG
- PNG
- GIF
- JPEG
- PDF

Additionally, if the chosen export format is a bitmap format, an animated GIF can be created automatically (available options for the animation are delay, loop and dispose).

Basic usage:
============
Select a group of paths (e.g. created with 'Extensions > Generate from Path > Interpolate'), open 'Extensions > Export > Objects to Files', adjust the export directory as needed and click on 'Apply'.

Known issues:
=============
1) Defs: The extension does not automatically copy just the required shared resources into the exported SVG file. The user can decide - depending on the content of the current document - whether or not to include a full copy of the original <defs> section in each of the exported SVG files, e.g. for path effects or gradient definitions (the defs can be cleaned up later on if needed).

2) Clones: Object references across different layers, or among different selected objects, are not resolved. This will cause orphaned clones (not rendered visibly) in exported files (any format), if the original of a clone is on a different layer, or not among the "other" content (unselected, or 'Common layers') which can optionally be included in each exported files.

3) Dependencies: Export to GIF/JPEG and the creation of the animated GIF depend on external tools ('convert' from ImageMagick). Inkscape's binary packages for Windows and OS X do not include a full installation of ImageMagick, which will make these specific features unavailable in out-of-the-box installations.

4) Popen() on Windows:
- Communicating with externally spawned processes (e.g. to test the availability of 'convert') needs testing on Windows (likely this fails).

TODO:
=====
- Win32: fix support for non-ASCII filenames in inkscape shell mode
  (affects all export formats except SVG if basename uses non-ASCII)
- Optionally use layer names for export filename (useful?)
- i18n (dialog as well as error messages)
- Documentation and basic tutorial
- ...

Ideas:
======
- Per-frame (layer) options for animation (similar to GIMP)
- Requested but not implemented: Integration with existing 'Interpolate' extension (this part of the original spec was dropped to be able to support more use cases than just the output of 'Interpolate')
- ...

Files:
======
Attached to this report is a recent snapshot of the extension, the changelog can be followed in this repository:
https://code.launchpad.net/~suv-lp/+junk/inx-export_objects

References:
===========
[1] Specs as posted in Nov 2015 on the inkscape-devel mailing list:
http://sourceforge.net/p/inkscape/mailman/message/34592259/

su_v (suv-lp)
description: updated
su_v (suv-lp)
Changed in inkscape:
assignee: nobody → ~suv (suv-lp)
status: New → In Progress
su_v (suv-lp)
description: updated
su_v (suv-lp)
description: updated
su_v (suv-lp)
description: updated
description: updated
su_v (suv-lp)
description: updated
Revision history for this message
su_v (suv-lp) wrote :

On 2015-12-31 18:38 (+0100), ~suv wrote:
> Known issues:
> =============
> 4) Popen() on Windows:
> - Using Popen() with 'shell=False' (...)

Based on a quick test on Windows 7, this seems to work ok with Inkscape 0.91 (64bit).

> TODO:
> =====
> - Checks for unicode input in basename, export directory, layer names

Encoding issues when using special characters in basename or (common) layer labels on the other hand need more attention (failed in all quick tests I repeated on Windows 7).

su_v (suv-lp)
description: updated
Revision history for this message
su_v (suv-lp) wrote :

On 2015-12-31 18:38 (+0100), ~suv wrote:
> 4) Popen() on Windows:
(...)
> - Using Popen() with 'shell=False' (the arguments are passed as list,
> not as string) needs testing on Windows (the extensions currently
> shipping with Inkscape use the (unsafe) 'shell=True' when running
> external commands).

Seems that I removed this issue from the bug description prematurely - while 'shell=False' works ok with commands which spawn e.g. 'inkscape', it fails with commands which use ImageMagick's 'convert' [1] (the external command fails because Microsoft's system tool 'convert.exe' is always first in the default search path). Not sure yet how to solve this (I'd rather avoid falling back to 'shell=True'; specifying the full path to a default ImageMagick installation is not a viable solution either (the default installation includes the version number in the top-level directory), and I'm running kind of out of time having direct access to a Windows computer for testing...

[1] http://stackoverflow.com/questions/24789749/popen-with-conflicting-executable-path

Revision history for this message
su_v (suv-lp) wrote :

Decided to use a simple workaround for commands spawning ImageMagick's convert for now, to allow further testing on Windows. Needs a better solution though.

Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Closing (stopping active development) - alternatives might be e.g.
http://www.inkscapeforum.com/viewtopic.php?t=20984&p=77989

Changed in inkscape:
status: In Progress → Invalid
Revision history for this message
su_v (suv-lp) wrote :

Finally, attaching a tiny teaser animation created with the extension - any further news about the extension's state will be tracked in my personal launchpad repo (see link in bug description). I have no more plans to promote the extension for inclusion in Inkscape itself.

su_v (suv-lp)
description: updated
su_v (suv-lp)
Changed in inkscape:
assignee: ~suv (suv-lp) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.