Spyder: a framework for parametric objects

DISCLAIMER: Spyder is experimental software and still contains bugs, may be unstable, slow, ugly, and there are a lot more features to be added. It also severely lacks documentation. I kindly ask those who are interested in parametric objects to provide help for the further development of Spyder.

And now for the good stuff…

Parametric objects are very powerful since they allow the user to define very complex objects with just a few parameters (shape, height, number of copies, etc.). Spyder allows creation, validation, editing, converting, saving and loading of custom-designed parametric objects, auto-generating a Blender GUI to do all these things for you.
In Spyder, parametric objects can be defined in terms of basic parameter values but they can also be defined in terms of other parametric objects, such as a city in terms of streets and houses (or, once GameEngine support will be added, a level in terms of walls and monsters, including hitpoints and AI).
The same goes for 3D visualisation. When designing a new type of parametric object in Spyder, you need a Python function to define your object in terms of meshes, or in terms of other parametric objects. So you can define the visualisation of a wall and of a roof in terms of meshes, and then you can define the visualisation of a house in terms of four walls and a roof.

If you just want to use parametric objects inside Blender, you can download a snapshot distribution here:

http://www.spyderware.nl/spyder/Spyder-blenderdistro1.0.zip

Just unzip it in your Blender scripts directory (<Blender directory>/.blender/scripts). This will give you the following menu entries in Blender: in the Object menu, you will have “Create/Edit Spyder object”, under the Misc menu in the script window you will have “Manage Spyder objects”, and you will find Import and Export entries too.
You can play with some different parametric plugins: a house, a tube, a sphere, a parametric grid, a stairway, a molecular orbital, Rubik’s snake, and Sergio Moura’s bolt: http://blenderartists.org/forum/showthread.php?t=101742&highlight=bolt. More of them will be added in the near future, together with manuals.

If you want to develop your own parametric models, you can download the Spyder installer here and install Spyder components:

http://www.spyderware.nl/spyder/Spyderinstall.zip

Just unzip it in an empty directory where you want to install Spyder, then open Spydermaster.py with Python.

There is a very difficult-to-understand document describing the mechanism of Spyder, read it if you dare:

http://www.spyderware.nl/docs/Spyder.doc

This Spyder version contains a lot more functionality, such as support for using Spyder objects within Python scripts, from command line, and a renderer to preview Spyder objects outside Blender. You will probably want to install the components “Tarantula”, “Blender” and “3dmodels”. There is also an experimental component to define Gen3 trees.

I am still writing tutorials, so until then, don’t hesitate to ask me anything by PM.

A few tips:

  • You need Python 2.5 or later installed on your machine, earlier versions will not work with Spyder
  • The first time you run Spyder, it will take ten seconds or so to start up
  • Spyder is experimental software, save your work often.
  • Make sure that you have a text terminal window when you start Blender. The terminal will show errors and other important messages.
  • If you install Psyco on your computer, it will make run Spyder much faster, although it will consume more memory.
  • Exporting your Blender file to Spyder format will only save parametric objects, not anything that you created in the normal way. Spyder files can be edited in a text editor.

hi, Sjoerd,
way cool script.
fully works with 2.46rc1.
a few suggestions,
the interface could do with some work,
it would be good if after creating one object, i could return to the main menu.
to create another, without closing the script first.
a button to return or exit script would be good.
sometimes if the script is not closed properly,
the last settings turn up & theres no way to return to the menu.
minor things.
The models are good, the settings many.
well done!
it only took about 4 seconds to load on my slower computer.
(with Psyco of course)
I will do some docs on the wiki soon.
i think you have been developing this for some time now?
i must apologize, the first time i looked at this, i did not look hard enough.
there are a couple of pages i would like you to look at.
http://wiki.blender.org/index.php/Scripts/Manual/Permissions
http://wiki.blender.org/index.php/Scripts/Manual/Scripts_Bundles
it would be great if you could participate.
m.a.

This would be an awesome script, but …
When I click on “load spyder object into clipboard”, then select the *.spy file, I get these errors in the console:

Traceback (most recent call last):
File “<string>”, line 97, in drawfunc
File “<string>”, line 145, in loadfunc
Exception: Unknown Spyder type # Copyright 2007, Sjoerd de Vries

This file is licensed under the Artistic License 2.0, http://perlfoundation.or

g/artistic_license_2_0

Type Pillar:Cylinder {
“”“3D object class for a simple pillar
The pillar is oriented along the Z axis
A Pillar is constructed in the same way as a Cylinder,
but it is rendered as a cylinder capped at each side
“””
}

Define Object3DArray in C:\Users\Darren\Documents\blender-2.46-RC1-windows.blen
der\scripts\Spyder\3dmodels\pillar.spy

ok very cool program works great but i installed spyder installer too everything installed but some stuff is broken it says apart (it couldnt set environment variables) apart from that its installed but how do i use it is theer some gui to it or do i aceess it from blender?

at dazzler yeah your supposed to open it via the objects menu i dont know why but it works when you open it via objects menu but not if you tr and import

@Meta-Androcto: Thanks for your very positive review! And yes, it ate 1.5 years of my life (I use it for several other things than Blender). I would be happy to contribute in better integration of Spyder with Blender and existing scripts. Also, the interface is indeed far from perfect. Perhaps we can discuss it further via PM or email.

@dazzler: Sorry for my lack of documentation. .spy files are scripts (like .py files). Some of them generate 3d objects but most of them are just modules. Use the object menu to create your own objects in Blender. If you want to open a particular 3d object, you should open a .web file (in the Import menu or in the Spyder object manager). There is a collection of Rubik Snake web files in Spyder/3dmodels/models/Rubik. Also, you can save parametric objects that you make in Blender to a .web file: 1. in the Export menu, 2. by pressing “copy” in the script window, going to the Spyder object manager and saving the clipboard to file.

@blenderrenegade: It’s no problem that Spyder cannot set env vars, it’s only an issue when you want to do “import Spyder” in a Python script (you must add your Spyder dir to sys.path then). The only GUI to create Spyder objects is currently in Blender, but you can also create and edit them by Python script. You can also edit .web files in a text editor. Spyder also contains a simple previewer for 3d objects. On a command line, go to your Spyder dir and type “python Spyder.py 3dmodels/models/Rubik/Ball.spy” (or “c:\python25\python Spyder.py …” on windows) to start it.