Export Paper Model

anyway few hours I’m trying to get non-planar quads to planar is there any way how to do it? Some automatic way, scale normal Z axis to zero I know. Thank you very much. I found some link for python script that is not valid. Thanks for help.

I’d like the script to create some hints automatically, but my main aim is the real paper modeling - figures, cars etc. I guess a much more important feature are auto-generated description tags on the sticking tabs telling which parts shall go together. That is another example of ugly load of work when it’s done by hand.

However, these unfolding animations seem reasonable too. I think that the 2.4x Unfold script used vertex hooks for it, but an armature seems as a cleaner solution to me. If such script doesn’t exist yet, I’ll write a (separate) script that just generates an armature of given mesh, allowing you to animate it freely without deforming faces. That should be comfortable enough I hope.

Hmm, I think this is really difficult to do in a general case, and that’s why I didn’t even try to write a function for it. If there are just a few quads to fix, you can do this:

  • Switch editing axis to Normal and selection mode to Faces;
  • Select one of the screwed faces and scale it in normal Z to zero (S Z Z 0 Enter);
  • Do the same for all the other bad quads;
  • Repeat two last steps over and over until all faces seem reasonably flat.

Note that the faces affect each other, so you may have to go on for a very long time and will have flat quads, but the model all destroyed in the end. I do this procedure hardly ever.

Much easier is to split all the quads to triangles. Triangulated meshes are quite uncommon in packaging design, but there’s no other reason against them.

It’s easy to just ignore that fact. My script constructs a plane of (random) three vertices and projects the face on it. I quite hope it will work well for N-gons when they come into Blender.
If the face is planar, this approach is absolutely ok. Otherwise, the output may be more or less deformed; paper is soft, so even that doesn’t make too much trouble.

Today I finally wrote a concept of the unfold animation script. It is really simple in its function: it starts from the active face and spreads to all connected neighbours like flood, creating a bone to control each face.
The bones are in rest pose with no animation, but they should be nice to work with. It might be comfortable to use inverse kinematics, these should work too.

The script is not, however, simple to use: you have to prepare the mesh manually. The mesh must be a tree-like structure, similar to output of the Make Unfoldable operator, but in real cuts (with duplicated vertices and edges). That can be done in several steps, first of which is using Make Unfoldable and last of which is applying an EdgeSplit modifier.
I could describe the process more precisely, but I will rather improve the script to prepare this all without asking.
EDIT: I wrote a brief user manual on blender wiki.

You can get it from Github. It is a standalone add-on, but I will probably incorporate it into Export Paper Model because it has little utility on its own. It works with blender 2.57 r36301.

1 Like

I love the new script, tried it on a few meshes and it works nicely!!!
Did the cuts manually, marking sharp edges for the edge split modifier… not that difficult once you get the hierarchy idea, and you get control over the unfolding.
It would be cool some kind of constraints assistant for long chains of faces, but IK will be great too.

Thanks a lot for both scripts!!!

Hi, I wrote the 2.4x Unfolder (now obsolete) - that’s how it worked too. It grew a tree recursively until all faces had been visited. The animation was done by transforming all the faces recursively, but I did also write a version that used armatures. I didn’t release the armature version because it crashed with big meshes. One really nice advantage to the armature version was you could add IPO curves to control individual faces’ fold rates, rather than uniform over the whole tree.

@emu: thank you very much, I will try to test it throw a weekend
@Celeriac10: thanks for joining us :slight_smile:

Hi Emu,
I used your scrip when doing my school homework which was a paper model of Le Corbusier’s church in Firminy. The script saved me a huge amount of work even that it worked little bit weird sometimes. But I got used to it. I have few tips how to ipmrove the script - it would be nice if the script remembered the parametres of the paper size and resolution and other. The second thing is that those gluing tabs were actualy smaller than the 5 mm set, but I havenť tested this yet.
However, thank you for the cript, it works really great in most cases. If you want to see the result, check this link:http://www.flickr.com/photos/maracz/5679685335/lightbox/

@emu: sorry for delay, was busy with many other things.
THE ARMATURE SCRIPT IS GREAT :slight_smile:
thank you very much works perfectly.


http://blender.howto.cz/blender-links/Bone-Script-Cube.avi


http://blender.howto.cz/blender-links/Bone-Script-Head-05.avi

don’t know how difficult it is to have option (check box) let the script animate into a flat. Specify number of frame for anim, and let the script rotate child bone to the parents direction (not sure if there are possibilities to specify that).

Anyway thanks for that :slight_smile: I will try to test it for some crash deformations of object. Based on artist task :slight_smile: Maybe it will be usefull for more things.

p.s.: A jestli uz mi neni rozumet v te me inglis, co chci rict, dej mi prosim vedet. Diky za vse.

1 Like

i have r36571 and it doesn’t show up in add-on’s list.

Nice to meet you here, Celeriac!
I chose armatures this time because they are easy to work with, the API solved most of the geometry tasks for me.

MaraCZ, that is perhaps the most complicated model made with this script yet. How much actually did you have to draw by hand? It looks great.
The scripts has many issues with user interface, but you’re right it really should remember its settings. I’ll look at it, that is probably just a single switch or so.

Hehe, of course I understand your English :slight_smile:
I was thinking of just rotating the bones to a flat pose, so that you could make any blending animation between it and the rest pose (original shape of the model). That seems easy to code, I’ll look at it during this weekend.

That is something weird. I’ve just tested the script with r36757 and it worked correctly. If I remember, the last revision I tested earlier was 35312.
If you wish to track this down, look in the console if there are any errors (might show up when you install the add-on) and paste them here, I hope I can fix this.

thanks for fast answer :slight_smile:

here, just one real, for some feedback
my son (5 years old) is interested in Gormits (because of older friends) and ask me for helmet . . . so thanks to you :slight_smile:



BTW it’s only my problem that uploaded attachments have no preview here? most of them.

here is some side-effect test of tearing (or crashing) or how to call . . . (has nothing to do with paper models)
http://blender.howto.cz/blender-links/crash-bone/

First, thanks for all the work. I’m pretty much a newbie at blender and started using your script with version 2.54(OSX). I used your code to generate some simple stuff which worked nicely (made a blog posting at http://constantvariation.blogspot.com/2011/02/mod-mon-eventuallyhow-i-worked-with.html). On the other hand the biggest problem though is that I’m not sure what the problem is. Often the call to export fails to generate anything (no file browser with paper-model features opens) & I don’t know why it didn’t. Could it be possible to generate some general failure message somewhere to see if it’s the model or the script that’s acting up? I have suspected it’s a problem with non-flat quads, but often this problem persists even when quads are made into triangles. I’m not a python person, but is there a way to run it from the python console (how?), presuming stdio mesgs go to the console.

Also as something of a secondary thing, I just downloaded blender 2.57 (April2011r) to see if it worked better with your new script and while it claims that the script is added it fails to show it on the add-on panel for enabling (meaning I can’t enable it). This could be just a blender thing, or a change on the api since last posting (there seems to be problems with add on scripts with this release, but detail info is lacking). It could also be a Mac thing. It’s an older Mac and it’s not going to go beyond OSX10.5.8 (and whatever version of python it has).

Again thanks for this script. When it has worked it has done great stuff (even fixed a part for an Aries 1b I was working on, so it does work on tough shapes)

zubie

No, it’s not possible to run the export operator from python console. But if you run blender itself from OS console, all error messages should be dumped there.

Sorry, I’ve forgotten to update the file that is hosted on Google code - I guess you downloaded the script from there? If so, download it again, please - it should be compatible now.

Thanks for the detailed information and for your patience.

Hi, I haven’t posted on this forum for a while, but I’d also like to show you stuff I’ve made using your awesome script. It’s a trapper from the game Tremulous. Two photos of the results:

http://fc07.deviantart.net/fs71/f/2011/147/4/b/papercraft_trapper_photo_2_by_tumtidum-d3hd62x.jpg

http://fc05.deviantart.net/fs70/f/2011/147/e/b/papercraft_trapper_photo_1_by_tumtidum-d3hd5ot.jpg

I’ve also written a manual how to build a trapper yourself. You can download the parts & manual here:

Trapper-MANUAL.pdf
Trapper-PARTS.pdf

I’ll read through this thread more thoroughly soon and your todo list as well so I might be able to give you some feedback and maybe add stuff to your todo list.
Either way, thanks for your work on this script, I love it! :smiley:

gREEtZ,
tumtidum (a.k.a. HJP)

1 Like

@emu / hi man, any success with flatening bone three? thanks for informations

That is good… Im’ inspired to try out the script :slight_smile:

@emu
Your TODO list seems to already be quite complete in my view. I’ll just give you my wish-list of the things I miss most:

  • ID fields for the parts, knowing what belongs where would be very nice indeed.
  • Text fields on the glueing tabs for numbering.
  • Folding lines for the glueing tabs.
  • Control of the opacity for both the black and white folding lines (maybe for the cutting lines as well). I know it’s quite easy to do in Inkscape, but when you have many parts this could be a timesaver.
  • An option to have cropped texture images for each separate part to make rearranging in Inkscape (if needed) a bit easier.

*note: As stated before I’m a newbie when it comes to papercraft, I’m also not a very experienced Inkscape user so you might want to take my suggestions with a grain of salt.

Keep up the good work!

I finally had some time to spend on the armature script, now the bones are rotated to a flat pose. You can get it from Github
As usually, it doesn’t work well with quads. If you find any other bugs, post them with an example .blend, please.

1 Like

Tumtidum, thanks for your feedback. I’m sorry it takes me so long to respond.

What exactly do you mean by “Folding lines for the glueing tabs”?

It should be possible to create an image per UV island, and it is definitely a good idea. The only problem is that this will produce a load of image files, but these can be put into a directory. Or perhaps I could find out how to pack them directly into the SVG.

By the way, you can edit opacity of the folding lines much easier in a text editor. Just after exporting it, open the SVG file. The first several lines are a cascade stylesheet. It should be quite readable: just add a “stroke-opacity: 0.5” tag where you wish, separated by a semicolon. It is a pity, but Inkscape can’t handle stylesheets yet.
The reason there is no slider in the export script to set this is that I couldn’t decide which of these settings are important and which not. I wanted the script to work just out-of-the-box, without any settings needed and even available. But now I see it was a wrong approach, so I will redesign the interface.