sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Reply
 
Thread Tools
rocketship's Avatar
rocketship rocketship is offline
Member
 
Join Date: Apr 2006
Posts: 222
Its been an exhausting month - my son was born on October 7, and everything takes longer when you’re trying to bounce a baby with one hand and type with your right hand!
I’m moving to a slightly different system - putting out a pretty stable release and keeping a less-stable bleeding-edge version as well (basically, the version I’m using). YMMV. So, without further ado:


Pantograph 0.5 changeLog
  • the GUI has been thoroughly replaced by a Blender user-interface. Its a little spare, but its growing on me and the experience is much smoother running it from Blender. pyGTK is no longer required.
  • The clipping has been re-written - with the hopes of dealing with the memory hole for larger meshes.
  • There’s now a “raster fill” option - you can use a rendered version of the scene (a PNG file, to be exact) as a clipped fill - you get sharp linework but also soft shading, textures, shadows. You could take this into Inkscape and poTrace your way back to resolution independence.
  • There’s now a proper frustum cull - things outside of the camera view are clipped and not rendered.
  • Things now work with Blender 2.48 (GTK was causing a seg fault).
Known Bugs:
  • The Blender GUI doesn’t yet work properly in Windows - to get changes in buttons to register, you have to raise another window and then go back to Blender. Works fine in Linux. Upstream bug?
  • There’s a mysterious, unrepeatable seg fault that happens every once in a while, though I’ve only noticed it in Linux.
  • SWF output is broken. No, its just not hooked up yet - I’ve been developing on a 64-bit system, and Ming is only 32-bit… if people are clamoring for this, it might happen sooner.
Download here.

Happy Halloween,
RS
............................................
http://severnclaystudio.wordpress.com
#1   Old 29-Oct-08, 14:49   
Reply With Quote


migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 520
hi rocketship, thank you very much, great script!
Setting dependencies was difficult, because blender immediately closed (if not import cairo then sys.exit(1)), no chance to read error messages on the console. Finally successful installation on winXP.

I have started some tests here


no crashes, but slow: 650 polys in 2minut, and some vector errors

I am going to implement similar functionality (2d perspective view with hidden line mode) to the new DXF-Exporter script. Your script seems to be optimal solution for this purpose, unfortunately there were problems to get Pantograph 0.4 working and the non-GPL 'General Polygon Clipping Library' dependency makes it problematic for blender.

Four weeks ago started an alternative "Vector Render" project in python, inclusive 2d polygon clipping module. It is pretty advanced now. If you are interested, look at Blender Projects: Vector Renderer
What a chance you write a (GPL) clipping library in the next future?
migius
#2   Old 30-Oct-08, 02:29   
Reply With Quote
migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 520
rocketship! congratulation to be a father!

hi all,
here a short story about installation on winXP

1. Python 2.5.2 was installed already.

2. Because of cairo.dll we need current GTK Library. I've got Gimp 2.4.6 and added gimp's path "blabla\bin" to systemvariable PATH

3. install pycairo-1.2.6-1.win32-py2.5.exe Without cairo Blender closes immediately.

4. install Polygon-1.17.win32-py2.5.exe

4b. optional for Shockwave Flash Animation (SWF) you need mingc-0.0.3a.win32-py2.5.exe

5. windows restart!

6. copy files from Pantograph0.5-Zip-File in Blender Scripts Folder. (* you can try newer version from here )

7. edit pantographLib.py script and change the line: (* for newer version do it in pantographConfig.py)
Quote:
HOMEDIR = "C:/blabla/Blender/.blender/scripts/"
8. start Blender, get scene with camera, start script from Scriptwindow->Render->Pantograph


hope this helps
make some tests and post results here or here
migius

Last edited by migius; 05-Nov-08 at 07:48. Reason: updated version
#3   Old 30-Oct-08, 10:41   
Reply With Quote
rocketship's Avatar
rocketship rocketship is offline
Member
 
Join Date: Apr 2006
Posts: 222
Migius,

Thanks for the testing!

Yes, its still pretty slow - I think its reaching the limits of Python-speed - the BSP sorting and 2d clipping are computationally pretty intensive, no matter how much you optimize it.

I'd love to get involved in the Vector Renderer project - what language are you working in? What sort of hidden-line removal are you planning to use? What is the basic pipeline you envision?

Are you sure that the GPC license is incompatible with GPL? Because it is a less-restrictive license, it seems like it wouldn't impose any restrictions on the Blender codebase, though I guess the restriction from commercial use could be a problem. Re-writing the clipping module is something I've thought about, especially because the vector renderer wouldn't need all the functionality of GPC, and wouldn't need to be quite as robust. Plus, if the project were closely tied to Blender it could re-use some of the Blender math functions and such.

The 2d clipping is important, and I think the place where a lot of other renderers are lacking (VRM, GL2PS). Without it, your vector file is too large and difficult to work with afterwards (too many triangles!)

Best,
RS
............................................
http://severnclaystudio.wordpress.com
#4   Old 30-Oct-08, 13:44   
Reply With Quote
migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 520
rocketship.
Vector Renderer project started because your Pantograph project seemed to be stopped. :P

Quote:
Are you sure that the GPC license is incompatible with GPL? Because it is a less-restrictive license, it seems like it wouldn't impose any restrictions on the Blender codebase, though I guess the restriction from commercial use could be a problem.
exactly

I have activated SWF support in your script. To get from here.
It works well, but the mingc lib crashes Blender just by writing final file to disk. Strange.
Had it ever worked for you?

migius

edit: mingc lib produces correct swf file with leer scene, so probably my modification is a culprit

Last edited by migius; 30-Oct-08 at 17:50. Reason: more tests
#5   Old 30-Oct-08, 16:14   
Reply With Quote
rocketship's Avatar
rocketship rocketship is offline
Member
 
Join Date: Apr 2006
Posts: 222
Migius,

Swf export was working - I just wasn't sure I had hooked it up in the new GUI. I've been tracking changes into the swf module, so it should be close to working - as I said, I don't have python-ming installed on my main development machine, so I haven't tested it.

Pantograph hadn't stopped, but life got in the way for a while... plus, I dislike writing user-interfaces enough to be able to put it off for a long time ;-)

I'll take a look at your modifications for swf - it may be something quite simple.

RS
............................................
http://severnclaystudio.wordpress.com
#6   Old 30-Oct-08, 18:09   
Reply With Quote
migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 520
SWF animation doesn't work yet, so i have redirect output to serial PNG -> animGIF (thanks gimp)
looks nice:

#7   Old 30-Oct-08, 21:06   
Reply With Quote
migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 520
Quote:
Originally Posted by rocketship View Post
I'd love to get involved in the Vector Renderer project - what language are you working in? What sort of hidden-line removal are you planning to use? What is the basic pipeline you envision?
Entirely in python. Some parts will be eventually rewritten to C later.
Alxarch is working on a polygon clipping module (finished afaik). Look at sorcecode for more details. Now we need better sorting algo, probably your BSPTree could be useful.
I'dnt like to reinvent all this from scratch.
My part so long is connectivity to blender scene: camera/viewpoint frustum, material-linestyle mapping, preparation for DXF format and UI.

Quote:
Re-writing the clipping module is something I've thought about, especially because the vector renderer wouldn't need all the functionality of GPC, and wouldn't need to be quite as robust. Plus, if the project were closely tied to Blender it could re-use some of the Blender math functions and such.
you are absolutely right.
I hope we could use the same core for export in different vector formats: DXF, HPGL, SVG (<- in my favorite)

just will send you PM
migius
#8   Old 30-Oct-08, 21:25   
Reply With Quote
rocketship's Avatar
rocketship rocketship is offline
Member
 
Join Date: Apr 2006
Posts: 222
I updated the "bleeding edge" version. Clipping is slightly improved (but still not perfect.)
............................................
http://severnclaystudio.wordpress.com
#9   Old 31-Oct-08, 12:35   
Reply With Quote
blenderificus's Avatar
blenderificus blenderificus is offline
Member
 
Join Date: Jun 2008
Posts: 539
very cool, thank you for sharing your hard work
#10   Old 31-Oct-08, 15:36   
Reply With Quote
migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 520
not a bugfix but hack on script, produces imperfect swf file, but script/blender crashes no more:
http://4d-vectors.de/blend01/org/anim003.swf
#11   Old 31-Oct-08, 21:22   
Reply With Quote
rocketship's Avatar
rocketship rocketship is offline
Member
 
Join Date: Apr 2006
Posts: 222
"Bleeding-edge" is updated again:
-no longer does sys.exit(1) when Cairo is not present
-swf output may be fixed (?) but ming still crashes Ubuntu 64
-config settings are now in pantographConfig.py, to make it easier to update without re-setting your home dir.

RS
............................................
http://severnclaystudio.wordpress.com
#12   Old 01-Nov-08, 13:06   
Reply With Quote
migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 520
another try with the old swf code from 0.4 produces a better looking swf file, but 4x bigger and ignores dashed lines: (why?)
http://4d-vectors.de/blend01/org/anim004.swf

Quote:
Originally Posted by rocketship View Post
"Bleeding-edge" is updated again:
-no longer does sys.exit(1) when Cairo is not present
-swf output may be fixed (?) but ming still crashes Ubuntu 64
-config settings are now in pantographConfig.py, to make it easier to update without re-setting your home dir.
thank you, will try again
#13   Old 01-Nov-08, 15:24   
Reply With Quote
migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 520
your last version still crashes blender
in line 2941 there is an unresolved call "self.shapes", but nowhere initialization for it in drawing class

if no mingc works on your machine it will be difficult to track this function.
look at pantographLib04.py, which generates above "better" swf
in http://projects.blender.org/plugins/...t=vectorrender
#14   Old 01-Nov-08, 15:52   
Reply With Quote
rocketship's Avatar
rocketship rocketship is offline
Member
 
Join Date: Apr 2006
Posts: 222
Migius,

As I said before, ming has no provision for different line types :-(

drawing.shapes gets initialized in pantograph.py - make sure you re-load it before you try it! (its in line 670 of pantgraph.py).

I'm digging out my old laptop, so I should be able to test it today.

RS
............................................
http://severnclaystudio.wordpress.com
#15   Old 01-Nov-08, 17:11   
Reply With Quote
rocketship's Avatar
rocketship rocketship is offline
Member
 
Join Date: Apr 2006
Posts: 222
Hmmm...still seg faulting. Let me look at it some more.

I made some changes to the swf export module since 0.4 - mainly trying to reduce file size, though also some changes in the data structure that holds the line-type data. Unfortunately, directly dropping in the old module is going to be a little hard.

RS
............................................
http://severnclaystudio.wordpress.com
#16   Old 01-Nov-08, 17:44   
Reply With Quote
migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 520
Rocketship, thank you for continuing this project !

after testing: the thing that crashes blender regularly at the moment of writing swf file is the usage of movie.remove(MyShape) command in your 0.5 code.
What a sense of this code? Could you point me to your swf sources/documentation?

migius

Last edited by migius; 01-Nov-08 at 18:48.
#17   Old 01-Nov-08, 18:24   
Reply With Quote
rocketship's Avatar
rocketship rocketship is offline
Member
 
Join Date: Apr 2006
Posts: 222
Ok, it works! Swf export is fixed in bleeding edge - I was trying to do something a bit too fancy.

test

cheers,
RS
............................................
http://severnclaystudio.wordpress.com
#18   Old 01-Nov-08, 18:45   
Reply With Quote
migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 520
\o/, perfect! your last version generate small swf files again, bravo!
as proof: http://4d-vectors.de/blend01/org/anim005.swf
#19   Old 01-Nov-08, 19:02   
Reply With Quote
migius's Avatar
migius migius is offline
Member
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 520
something strange though:
the frame interval increases to the end of video sequence.
I have seen this strange effect in myself hacked 0.5 version too.
It is to see in your http://home.earthlink.net/%7Esevernclay/filename.swf too.
what could it be?
download again my last (replaced) example to see it better
#20   Old 01-Nov-08, 19:13   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 19:00.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists