index f0ba8f26c883f42ed41dfec4b63a1653b3003181..8ca7f6aeb0efee3ab89faa57e56fa5c2bfec1d7b 100755 (executable)
styles = {}
for id in self.options.ids:
node = self.selected[id]
- if node.tagName =='path':
- paths[id] = cubicsuperpath.parsePath(node.attributes.getNamedItem('d').value)
- styles[id] = simplestyle.parseStyle(node.attributes.getNamedItem('style').value)
+ if node.tag ==inkex.addNS('path','svg'):
+ paths[id] = cubicsuperpath.parsePath(node.get('d'))
+ styles[id] = simplestyle.parseStyle(node.get('style'))
else:
self.options.ids.remove(id)
if self.options.dup:
steps = [0] + steps + [1]
#create an interpolated path for each interval
- group = self.document.createElement('svg:g')
- self.current_layer.appendChild(group)
+ group = inkex.etree.SubElement(self.current_layer,inkex.addNS('g','svg'))
for time in steps:
interp = []
#process subpaths
#remove final subpath if empty.
if not interp[-1]:
del interp[-1]
- new = self.document.createElement('svg:path')
#basic style tweening
if self.options.style:
if dofill:
basestyle['fill-opacity'] = tweenstylefloat('fill-opacity',sst,est,time)
basestyle['fill'] = tweenstylecolor('fill',sst,est,time)
- new.setAttribute('style', simplestyle.formatStyle(basestyle))
- new.setAttribute('d', cubicsuperpath.formatPath(interp))
- group.appendChild(new)
+ attribs = {'style':simplestyle.formatStyle(basestyle),'d':cubicsuperpath.formatPath(interp)}
+ new = inkex.etree.SubElement(group,inkex.addNS('path','svg'), attribs)
-e = Interp()
-e.affect()
+if __name__ == '__main__':
+ e = Interp()
+ e.affect()
+
+
+# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99