Import .ai, .pdf

@Howardt,
Thanks again for this and the updates to the script. It’s been really nice being able to import AI files without having to convert to SVG first!

Also to satisfy my own curiosity, I’ve been poking through the script to see how you made it. I’ve been trying to learn python for years, but this script for some reason really motivated me to pick back up on learning it. I think since I first wrote on this thread, I now know about 10x as much python as I did when I wrote that. In some way, that’s thanks to you!

Thanks crazycourier. Maybe we’ll see some nice addons from you now that you know python better? :slight_smile:

Version 0.6 now available.
This one:

  • adds a ‘cap back’ option for capping the back side if extruding
  • shows face and vertex counts
  • keeps the object name closer to the file name
  • fixes a couple of bugs

I added SVG support too, because it wasn’t very hard. Here is version 0.7 with .svg support.

These are excellent updates, howardt. Thanks again!

The face-count is VERY helpful for my workflow. Awesome.

Now that this addon is working so smoothly, I’m getting picky – so one minor observation: This addon doesn’t jump to the last directory used. In other words: if I imported a path from //paths/path1.ai, the next time I use the addon (just a few seconds later) it takes me to the default directory. When using append, for instance, I’m taken to the most recently used directory. Is that even possible for an addon?

Thanks again howardt!

After a good hundred path imports or more using the “Even” method, I have found one that has “Even” stumped. Here’s the AI file: tree_city.ai.zip
When importing this, set the Method to “Even” and try various smoothness settings:
http://blender.mostlydocumentary.com/images/vectorImportTree_smooth1.jpg
http://blender.mostlydocumentary.com/images/vectorImportTree_smooth4.jpg
http://blender.mostlydocumentary.com/images/vectorImportTree_smooth16.jpg
I’m using Adaptive for this one, with a smoothness of zero, with decent results.

EDIT: Just tried this with the Curve to Mesh addon. While the process is more cumbersome, the overall result with this particular curve was better.

Thanks for the bug report, benu. I clearly have a bug in my triangulation code. I suppose I could just use Blender’s built-in code, but wasn’t sure how well I could trust it. I will try to fix this bug but it probably won’t be immediately.

OK, I found the bug - not in triangulation, but in my handling of polygons with only two edges (one a curve) - the curved edges need to be subdivided at least once. This is probably not a big enough change for me to post a new version, but the fix will be included in my next version, whenever it comes. Thanks again for the bug report and the test file.

I poked around a bit to see how to make the file selector start at another directory, but couldn’t figure out how to do it, sorry. If anyone else reading this knows how, please tell me.


  filepath = StringProperty(name="File Path",
    description="Filepath used for importing the vector file",
    maxlen=1024, default="", subtype="FILE_PATH")

default=“” - specifies the default filename for the dialog and includes the path. So if you just want to start in a directory, you can set this to something like:

default=“/home/domino/” - it needs the trailing slash to identify that the last element is part of the directory and not a filename.

Bonus tip: bpy.path.display_name_from_filepath :wink:

Thanks, Domino!
Now I just need to figure out the best place to persist the last-used directory, at least in the .blend file. What is the best practice place to store that? A scene property?

Version 0.8 is available now. It can bevel further - even after one side of a bevel hits the other side.

thanks for the add on!

I’m having an issue with the panel appearing grayed out when I attempt to use it. I’ve followed your instructions. Is there an incompatibility with current versions of Blender?

I’m using a current Win 7 version r36600M. It does this in object mode, but when I’m in edit mode it becomes active. Unfortunately even though it’s active it doesn’t import.

any ideas?

p.s. I’ve placed the io_vector folder within the addons folder.

comeinandburn: Have you tried with a fresh .blend file? I’ve had occasional import problems (nothing shows up), which happen with specific blend files, but once I open the default .blend, everything imports without problem.

(Incidentally, howardt, I’m still trying to figure out what causes it, and continue to scratch my head over the matter.)

comeinandburn: that’s strange. I’ve never seen a grayed out panel in Blender. Let me know if what benu says works. The intended use for this is in object mode. When you first pick the menu item, it won’t do anything - you have to click on the folder icon in the panel, and then even after you pick a file, you have to adjust another parameter too before it does something. I will also try with a later build to see if something broke (I’m current on r36147m).

I’ve just tried it on OSX r 36592 and it works perfectly. I’ll have to try this again at home on Win7 to see if I’ve done something wrong.

I’ll let you know

thanks.

p.s. my previous attempts were with clean blends.

It doesn’t work with relative path, I’ve done a patch to solve this issue:
http://edddy.perso.sfr.fr/script/io_vector.patch
not very useful, I wonder if there’s a way simplest?

I’ve updated this script for Blender 2.65.
See http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/AI_PDF_SVG

Hi Howardt,

First of all thanks for this great Addon! I have tried it out and it worked great! :slight_smile:

I ran into a difficulty today though:

I installed the Addon after upgrading to version 2.65a of Blender and the following warning / error appeared when importing an .ai file:


When i tried to import an SVG file a similar warning came up:


Both files where created in Illustrator CS6 running on Mac OSX (10.8.2).

I hope you can help me out with this!

Thanks and keep up the good work,

Jeremy

Hi Howardt,

I reinstalled blender and the addon… and it worked.

Thanks just the same!

Jeremy

Glad it works for you now.