summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aff3a06)
raw | patch | inline | side by side (parent: aff3a06)
author | acspike <acspike@users.sourceforge.net> | |
Sat, 27 Jan 2007 06:10:39 +0000 (06:10 +0000) | ||
committer | acspike <acspike@users.sourceforge.net> | |
Sat, 27 Jan 2007 06:10:39 +0000 (06:10 +0000) |
share/extensions/gimp_xcf.py | patch | blob | history |
index f295641f3509ba13b02b5a3c99ea5f92d538904b..1da8a260916242e171c7d1a0ef4a5f4af122eb02 100755 (executable)
area = '--export-area-canvas'
pngs = []
+ names = []
path = "/svg/*[name()='g' or @style][@id]"
for node in inkex.xml.xpath.Evaluate(path,self.document):
id = node.attributes.getNamedItem('id').value
f.read()
f.close()
pngs.append(filename)
+ names.append(id)
filelist = '"%s"' % '" "'.join(pngs)
+ namelist = '"%s"' % '" "'.join(names)
xcf = os.path.join(tmp_dir, "%s.xcf" % docname)
script_fu = """
(define
- (png-to-layer img png_filename)
+ (png-to-layer img png_filename layer_name)
(let*
(
(png (car (file-png-load RUN-NONINTERACTIVE png_filename png_filename)))
(xcf_layer (car (gimp-layer-new-from-drawable png_layer img)))
)
(gimp-image-add-layer img xcf_layer -1)
- (gimp-drawable-set-name xcf_layer png_filename)
+ (gimp-drawable-set-name xcf_layer layer_name)
)
)
(let*
(img (car (gimp-image-new 200 200 RGB)))
)
(gimp-image-undo-disable img)
- (let* ((filelist '(%s)))
+ (let* ((filelist '(%s))(namelist '(%s)))
(while filelist
- (let* ((filename (car filelist)))
- (png-to-layer img filename)
+ (let* ((filename (car filelist))(layername (car namelist)))
+ (png-to-layer img filename layername)
)
(set! filelist (cdr filelist))
+ (set! namelist (cdr namelist))
)
)
(gimp-image-resize-to-layers img)
(gimp-image-undo-enable img)
(gimp-file-save RUN-NONINTERACTIVE img (car (gimp-image-get-active-layer img)) "%s" "%s"))
(gimp-quit 0)
- """ % (filelist, xcf, xcf)
+ """ % (filelist, namelist, xcf, xcf)
junk = os.path.join(tmp_dir, 'junk_from_gimp.txt')
f = os.popen('gimp -i -b - > %s' % junk,'w')
x.close()
e = MyEffect()
-e.affect()
\ No newline at end of file
+e.affect()