shlomif / Bezier-Envelope-for-Inkscape

The Bezier Envelope Extension for Inkscape
GNU General Public License v2.0
30 stars 7 forks source link

raise Exception / SyntaxError #6

Closed torwei closed 2 years ago

torwei commented 4 years ago

HY, nice Work. The changes you'll do work for some combinations of OS and Inkscape Version on other not. I'll work on a Linux Mint 19.3 Maschine with Inkscape Version 1.0 (4035a4fb49, 2020-05-01) and Python 2.7.17 and I got the Error you see below. I reproduce it several times always the same.

File "bezierenvelope.py", line 91
    raise Exception, "Both letter and envelope must be SVG paths."
                   ^
SyntaxError: invalid syntax

This is the second if Block the first I comment out for Troubleshooting. In the SVG File, there are 2 Paths as needed

Bildschirmfoto zu 2020-07-24 14-48-36

`

shlomif commented 4 years ago

@torwei : please do a "git pull" and make sure you copy over the new files to ~/.config. They seem out of date with the latest master branch of this repo.

torwei commented 4 years ago

@shlomif : Ok. Done! :+1:

But now I got a bunch of DeprecationWarnings. :-1:

bezierenvelope.py:377: DeprecationWarning: Effect.affect is now `Effect.run()`. The `output` argument has changed.
  e.affect()
bezierenvelope.py:80: DeprecationWarning: Effect.selected is now a dict in the svg. Use `self.svg.selected`.
  letterElement = self.selected[self.options.ids[0]]
bezierenvelope.py:81: DeprecationWarning: Effect.selected is now a dict in the svg. Use `self.svg.selected`.
  envelopeElement = self.selected[self.options.ids[1]]
bezierenvelope.py:87: DeprecationWarning: simplepath.parsePath -> element.path.to_arrays()
  axes = extractMorphAxes( simplepath.parsePath( envelopeElement.get('d') ) )
bezierenvelope.py:101: DeprecationWarning: simplepath.parsePath -> element.path.to_arrays()
  path = simplepath.parsePath( letterElement.get('d') )
bezierenvelope.py:108: DeprecationWarning: cubicsuperpath.CubicSuperPath -> None
  bounds = simpletransform.roughBBox( cubicsuperpath.CubicSuperPath(path) )
bezierenvelope.py:108: DeprecationWarning: simpletransform.roughBBox -> list(Path(path)).bounding_box())
  bounds = simpletransform.roughBBox( cubicsuperpath.CubicSuperPath(path) )
bezierenvelope.py:351: DeprecationWarning: simpletransform.parseTransform -> Transform(str).matrix
  t1 = simpletransform.parseTransform( "translate(%f,%f)"%(-p1[x],-p1[y]) )
bezierenvelope.py:358: DeprecationWarning: simpletransform.parseTransform -> Transform(str).matrix
  t5 = simpletransform.parseTransform( "translate(%f,%f)"%(a1[x],a1[y]) )
bezierenvelope.py:361: DeprecationWarning: simpletransform.composeTransform -> Transform(M1) * Transform(M2)
  t = simpletransform.composeTransform( t, t4 )
bezierenvelope.py:362: DeprecationWarning: simpletransform.composeTransform -> Transform(M1) * Transform(M2)
  t = simpletransform.composeTransform( t, t3 )
bezierenvelope.py:363: DeprecationWarning: simpletransform.composeTransform -> Transform(M1) * Transform(M2)
  t = simpletransform.composeTransform( t, t2 )
bezierenvelope.py:364: DeprecationWarning: simpletransform.composeTransform -> Transform(M1) * Transform(M2)
  t = simpletransform.composeTransform( t, t1 )
bezierenvelope.py:301: DeprecationWarning: simpletransform.applyTransformToPoint -> Transform(mat).apply_to_point(pt)
  simpletransform.applyTransformToPoint( xTransform, pointOnY )
unsupported segment type: H
unsupported segment type: V
unsupported segment type: H
unsupported segment type: V
unsupported segment type: H
unsupported segment type: V
unsupported segment type: H
unsupported segment type: H
unsupported segment type: V
unsupported segment type: H
unsupported segment type: H
unsupported segment type: H
unsupported segment type: H
unsupported segment type: H
unsupported segment type: H
unsupported segment type: V
unsupported segment type: H
unsupported segment type: V
unsupported segment type: H
unsupported segment type: V
unsupported segment type: H
unsupported segment type: V
unsupported segment type: V
unsupported segment type: H
unsupported segment type: V
unsupported segment type: H
unsupported segment type: V
unsupported segment type: H
unsupported segment type: H
unsupported segment type: H
unsupported segment type: H
unsupported segment type: H
unsupported segment type: V
unsupported segment type: H
unsupported segment type: H
unsupported segment type: V
bezierenvelope.py:103: DeprecationWarning: simplepath.formatPath -> str(element.path) or str(Path(array))
  letterElement.set("d", simplepath.formatPath(morphedPath))

Line 80 and 81 (2 & 3 DeprecatedWarning) are really easy to fix I think.

        letterElement = self.selected[self.options.ids[0]]
        envelopeElement = self.selected[self.options.ids[1]]

change to

        letterElement = self.svg.selected[self.options.ids[0]]
        envelopeElement = self.svg.selected[self.options.ids[1]]

Sorry I'm not really familiar with python and the Inkscape extension development(@ the moment)

shlomif commented 4 years ago

@torwei : thanks! I applied your change, and tried fixing the "H" and "V" segment types in git master. I was able to get https://github.com/shlomif/Shlomi-Fish-Back-to-my-Homepage-Logo to kinda render but it ends up rotated.

shlomif commented 4 years ago

@torwei: hi! Please try again with the latest git master HEAD.

shlomif commented 3 years ago

@torwei : ping!

shlomif commented 3 years ago

@torwei : thanks! I applied your change, and tried fixing the "H" and "V" segment types in git master. I was able to get https://github.com/shlomif/Shlomi-Fish-Back-to-my-Homepage-Logo to kinda render but it ends up rotated.

Update: now, on inkscape 1.1 on Fedora 34 x86-64, the rendered logo is rotated correctly.

shlomif commented 2 years ago

Closing due to lack of reply.