SVG import

   5402   3   2
User Avatar
Member
402 posts
Joined: June 2014
Offline
Hello,

Just been spending the morning getting a rough as guts, python svg import on the go.

Here's the hda.

Reading in the file with xml.dom so should be fairly easy to extend to read colour information etc.

Thought it might be useful to someone somewhere
Edited by friedasparagus - Dec. 8, 2016 09:44:49

Attachments:
SVG_import.hdalc (3.1 KB)

Henry Dean
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
no hda attached
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
402 posts
Joined: June 2014
Offline
Sorry, I suck. Clicked the little checkbox next to the bin!

And I suck again. Forgot to mention you need to install the svg.path module into your one of your scripts folders.

I used:

py -2.7 -m pip install svg.path –target CUsers/$username/Documents/houdini15.5/scripts/python –ignore-installed

The other caveat here is that you seem to need to add an __init__.py file to the generated ‘svg’ folder in order for houdini to find the module inside the sub-folder ‘path’

Oh dear, bit of a faff.
Edited by friedasparagus - Dec. 8, 2016 09:49:39
Henry Dean
User Avatar
Member
402 posts
Joined: June 2014
Offline
Ok, tried looking into tidying this module dependency issue, but with no joy. The confusion came from having python2.7.12 installed locally, which seems happier with the .pth file that pip installs with the svg.path module. So, the adding of the init file still needs doing.

If anyone has any tips for getting around this that'd be great
Henry Dean
  • Quick Links