A greeble Plugin

Hi all, I recently worked on a script to generate greebles on a 3d mesh as the discombobulator did with Blender 2.49.

Currently my script can generate protusions and add doodads on the top, the doodads are modelled by the user but I’m thinking about adding a couple of generic doodads. My script doesn’t handle materials yet and I want also to add the ability to generate steps of protusions on the top of the protusions. Sorry if I’m not really clear, to make it short, there will be several “steps” of protusions. So there is a lot of things to come, here’s what I managed to do so far with it:

And here’s a link to the script: http://www.pasteall.org/25491/python
I hope it will be useful for at least a few people. If you’ve dot any questions, just ask.

Awesome. I worked on my own greeble script ahwhile back, but did not finish due to time constraints. Glad somebody else is making a very worthwhile tool!

great work so far :slight_smile:

Thanks for the comment, I just added the ability to use materials, it wasn’t that hard indeed. Here is the new version: http://www.pasteall.org/25514/python.

My next targets are:

  • dealing with triangle, so far, my script only with quads;
  • enable multiple protusions level as explained before;
  • finally the ability to use the UV of both doodads objects and original object.

Sounds great, but I am not sure what the above means. Does this mean that the user can somehow plug their own greebles into this script and then it will randomly place them around the surface of the mesh?

Yes, you’ve got the script’s utilities in the toolbar, select a mesh in the 3d view, and then click “Pick doodad”, it will add the selected doodad in the list of doodads. Then when you’ll discombobulate the mesh, it will randomly place the doodads on the protusions (sorry if I’m not really clear, I’m not a native english speaker).

Very nice but I did get some errors. I do not know what they were becasue I have yet to figure out how to get 2.5x to kick open a command window. I just saw a blinking popup screen. I am almost certain they were something I was doing though

Very cool! Great script, and your English is just fine.

I did get some errors. I do not know what they were becasue I have yet to figure out how to get 2.5x to kick open a command window. I just saw a blinking popup screen.

That’s weird, if you manage to open a command window, let me know what the problem is, I’ll fix it.
I added some default doodads: 1 box, 2 box, 3 box. The same that were in the original discombobulator script. I have now to implement the S, T, and L doodads.
I also added the ability to work with materials.
Here’s an example of what can be done:

@chichiri: Try out your code on the monkey. It fails. The errors are something to do with materials, it seems. When the object has no material (such as the monkey when you add it) and the code is referencing material slots that do not exists yet, errors occur.

Reproduce Error Like So:

Open default scene.
Delete Cube
Add Monkey
Run Script
Space Bar (type ‘dis’) and choose Discombobulate

Thanks for the bug Atom, it was because I forgot about triangles, I fixed the script, so then, when it encounters a triangle, it will skip it. I’ll add triangle support later, now I’m focusing on the default doodads, here’s the new script : http://blenderpython.svn.sourceforge.net/viewvc/blenderpython/259/scripts/addons_extern/discombobulator.py?view=markup&pathrev=150

@chichiri: That script does work, but has an odd workflow. Maybe I am not doing the step in the correct order. But the script seems to run twice and the second operation tries to discombobulate the result. So I end up with a couple of meshes that I have to delete to get down to the first layer of discombobulating.

Also, I noticed that at the first layer of dicombobulating that the monkey’s eyes ended up getting lost for some reason? This result was the default settings. Oh…maybe that is what you mean by skipping triangles.


Hey Atom!
That actually looks pretty good!

That looks like three very good screenshots to me. Excellend in fact. I do not see where you have and error?

There are no eyes? Basically the plugin drops any face that is a triangle and not a quad. Which could be ok. But I think we need some kind of checkbox for that option. In my case, I still wanted the eye. A nice solution would be to simply relay the triangles in to the new mesh unaltered, but give them a separate material ID.

thanks, looking good so far :slight_smile:

Hi chichiri,

Great work on the script! At one point I was also thinking of porting the script, but never got around to it :wink:

I did write a function for Blender which generates random points on a mesh face (whether tri or quad) which is included in default builds of Blender. The function is found in bpy_extras.mesh_utils.face_random_points and can be used as follows.

import bpy
from bpy_extras.mesh_utils import face_random_points

# Get the active object, it's mesh data and the list of faces
ob = bpy.context.active_object
me = ob.data
fa = me.faces

# How many random points on each face should be generated
num_points = 10

# Get a list of the randomly generated points
random_points = face_random_points(num_points, fa)

There are a couple of other simplifications in the code which might be helpful, let me know if you’re interested. Hope that helps!


Atom, there is a long-standing controversy with the monkey mesh regarding the fact that the eyes are totally separated from the main head mesh. Maybe the script only works on a single continious mesh?

Thanks for the tip TrumanBlending, I didn’t know this function, I will take a look on how to use it. Suzanne’s eyes are not discombobulated because they’re made of triangles, I’m currently working on adding the support of triangles.
@Atom: The second operation is the generation of the doodads, reduce their size in the options to see them better.

I’ll commit version with triangle support next week.

EDIT: I just commited a new version of the script supporting the triangles, it wasn’t so hard to implement, here’s a quick try on Suzanne:
Her eyes are now discombobulated.

Now I’m going to work on making multiple protusions layers.

Hello all, I’m currently working at rewriting the whole script to make easier the implementation of multiple layer of protusion, to make a small break with this activity I coded a small script which align the selected vertices, to use it, you just have to select some vertices, then you hit Ctrl+V->Align. Here’s a link to the script.