Eklentinin orjinal hali: https://gitlab.com/su-v/inx-exportob...-/tree/master/
Benim üzerinde düzenleme yaptığım hali: http://mapacarta.com/export_objects.zip
Bana gereken tek şey bütün layer'ları ayrı ayrı png olarak kaydetmesi.
Hataları düzelte düzelte, kodun şu kısmına kadar geldim, burada png dosyayı yazıyor ama anlamadığım bir şekilde 0 dosya yazıldı diyor her seferinde, svg kaydettiği kısımda buna benzer bir şey ama niye çalışmıyor anlamadım
def render_to_png(self, template, export_tmp_target):
"""Export SVG and render to PNG, return list with PNG filepaths."""
inkshell_cmd = ""
png_files = []
document = deepcopy(template)
for i, obj in enumerate(self.objects):
if self.options.incremental:
document = self.obj_to_doc(document, i, obj)
else:
document = self.obj_to_doc(deepcopy(template), i, obj)
filepath = write_svg_file(export_tmp_target, document)
pngpath = os.path.splitext(filepath)[0] + '.png'
inkshell_cmd += '--file="{0}" '.format(filepath)
inkshell_cmd += '--export-dpi={0} '.format(self.options.png_resolution)
inkshell_cmd += '--export-png="{0}"\n'.format(pngpath)
png_files.append(pngpath)
inkscape_shell(inkshell_cmd)
return png_files