VRM: Vector Rendering Method (SVG, PDF, SWF export)

Hi, here’s an alternative effort to provide Vector Output capabilities to Blender.

VRM is not stable software yet, but maybe it can be useful to someone of you.

See the examples page to see what it can do and guess what it can’t do yet.

Please post here comments and… complaints :slight_smile: about VRM, and do not pollute the thread about SFlender, thanks.

Bye,
Antonio.

Ok, this looks interesting.

Downloading to try it out.

Thanks

Great!
Got it working with an older build (20061213). SVG, PDF and SWF.
Animations too…

Hi Antonio, I am glad to see you continue improving that script! I like it much, even if it doesn’t work completely well now, I think one of these days it will become very useful, especially with all the new things blender has for doing architecture work, exporting things in true and accurate 2D will be a key feature soon… at least for me!

The new version (vrm-0.3.beta-2007-02-24.py) works out of the box with 2.43 (CVS) on Ubuntu Edgy, WinXp (2.43 Release), but not on OS X 10.4 (2.43 Release or CVS).
I get this error:

jupiter:~/Desktop/blender-2.43-OSX-10.3-py2.3-powerpc/blender.app/Contents/MacOS anders$ ./blender -w
 guessing './blender' == '/Users/anders/Desktop/blender-2.43-OSX-10.3-py2.3-powerpc/blender.app/Contents/MacOS/./blender'
 Compiled with Python version 2.3.
 Checking for installed Python... got it!
 vrm-0.3.beta-2007-02-:2986: SyntaxWarning: name 'outputfile' is assigned to before global declaration
 vrm-0.3.beta-2007-02-:0: SyntaxWarning: name 'progress' is assigned to before global declaration
 Outputting to:  /Users/anders/Desktop/4.svg
 Start Rendering of 1 frames

 Frame: 340
 Total Objects: 3
 -------
 Rendering Object: 0
 Only Mesh supported! - Skipping type: Camera
 -------
 Rendering Object: 1
 Only Mesh supported! - Skipping type: Lamp
 -------
 Rendering Object: 2
 Rendering:  RawMesh_Cube.001
 There was an error! Aborting.
 Traceback (most recent call last):
   File "vrm-0.3.beta-2007-02-", line 1941, in doRendering
   File "vrm-0.3.beta-2007-02-", line 2021, in doRenderScene
   File "vrm-0.3.beta-2007-02-", line 2479, in _doViewFrustumClipping
   File "vrm-0.3.beta-2007-02-", line 689, in splitOn
 TypeError: iterable argument required
 None
 

OS X is linked against Python 2.3, could that be the issue?

I use a trick to remove duplicated elements in a list, maybe it is supported only from python-2.4.

Can you run the following code with python-2.3, please?

#!/usr/bin/env python

posVertList = [1,2,3,4,5,6,5,6,7,1,1,1,2,3,4,5,4,6]

# uniq
posVertList = [ u for u in posVertList if u not in locals()['_[1]'] ]

print posVertList

jupiter:~ anders$ ./pos.py
Traceback (most recent call last):
File “./pos.py”, line 6, in ?
posVertList = [ u for u in posVertList if u not in locals()[‘_[1]’] ]
TypeError: iterable argument required

Ok, let’s see if this one works:

#!/usr/bin/env python

# If python version is less than 2.4, try to get set stuff from module
try:
	set
except:
	from sets import Set as set

posVertList = [1,2,3,4,5,6,5,6,7,1,1,1,2,3,4,5,4,6]


# uniq
posVertList_uniq2 = list(set(posVertList))
print posVertList_uniq2

Thanks,
ao2

Very interesting, and the site looks nice too :eyebrowlift: .
I was thinking about something like this for a while, but this is something to check out too.
Too bad I can’t download the script? at least not via the official site, or the projects.blender website.

Ok!
[1, 2, 3, 4, 5, 6, 7]

Cheers!

this is great!

Hi Antonio,

I noticed on the site that VRM can also create SWF files.

"VRM currently offers these features:

Optional SWF output using the ming library."

I’ve gone to the ming site but I’m struggling to get this working. I’m running XP and OS10.4 can anyone point me in the right direction to get SWF option working?

On OS X, I think the easiest way is installing Fink. Then you can grab the fink source package for ming and build the py_ext
Use this code and save as setup.py:


from distutils.core import setup
from distutils.extension import Extension

setup ( name = "ming",
        version = "0.2a",
        description = "A library for creating Shockwave files.",
        py_modules = ["ming"],
        ext_modules = [Extension( name='mingc',
                                  sources=['ming_wrap.c'],
                                  include_dirs=[".."],
                                  library_dirs=["../src"],
                                  libraries=["ming"]
                                  )]
        )

Thanks anders,

I think this is a bit beyond me at he moment. At least the SVG is working.

Excuse me anders_gud, the previous method did not preserve the original order of elements, can you test this on python 2.3?

#!/usr/bin/env python

def uniq(alist):
    set = {}
    return [set.setdefault(e,e) for e in alist if e not in set]

posVertList = [6,6,6,5,7,2,4,6,1,2,3,4,5,6,5,6,7,1,1,1,2,3,4,5,4,6]

print uniq(posVertList)

If it works I will release an update to VRM.

Thanks,
ao2

WOW. Exporting to vector…Really interesting. There’s a load of possibilities in design, games and all. :RocknRoll:

The swf would be quite interesting but imho the good export of svg vector is key for many things(specially if can be opened by Inkscape… :wink: ).

Returns:
[6, 5, 7, 2, 4, 1, 3]

Ok!

Hey you Guys,
Is there any progress in fixing the OSX (Python 2.3) issue?

Keep up the good work,
Beeckie68

just a note that its best not to use ‘set’ as a variable name since its a keyword in Python 2.4+

The next version of blender probably wont work with Python 2.3 so if its too much work just tell people to upgrade sooner then later :wink:

i had tested the script in feb
its good

it will be improved i am sure

high with hopes
i want to contribute but i cant do the developing

i just have exposure to python
not mastered or have intermediate experience in it.:rolleyes: