[Bf-python] Blender Plugin Question:

Jeremy Moles jeremy at emperorlinux.com
Thu Jan 26 05:38:25 CET 2006


Good grief.

I just proofread this message and noticed more spelling and grammar
errors than I care to admit to. Sorry about that.

Eeergh.

On Wed, 2006-01-25 at 23:29 -0500, Jeremy Moles wrote:
> I've written a very simple mesh format for a demo I'm working on that
> does two things:
> 
> 	1 - Contains "typical" vertex lists describing a single mesh object;
> very simply, nothing fancy.
> 
> 	2 - Contains another special list of quads that represent "spaces" on
> the mesh upon which any of my "units" can move.
> 
> Here is a VERY oversimplified example (read terrain meshes aren't as
> flat as this, nor are all the quads uniform in size) I whipped up in
> Blender relatively quick:
> 
> 	http://www.cherustone.com/Screenshot.png
> 
> My question is: in the past I've been create the "quad" metadata by
> hand, going into the file and basically inputting the vertices that make
> up each "space" manually. This working find as I was speccing the format
> out using very, very small meshes. Now, however, I'd like to scale it up
> a bit and use Blender's excellent UI to do the picking for me.
> 
> Does anyone have any recommendations on the best way to do this? I'm
> familiarizing myself w/ the Blender Python modules, and have spent the
> last few hours or so playing around with the Blender.Mesh.* namespace.
> My idea was to do something like the following, though I'm not entirely
> sure if all the tools are available and/or the functional is exposed:
> 
> 	1. Designer creates the "board" mesh.
> 	2. Designer uses Blenders builtin face selector to pick
> 1 - n faces.
> 	3. Designer (perhaps) presses a key, adding the quad to a list within
> the script.
> 
> I pretty sure the above is possible but the problem I'm having is
> getting my head around the best way to implement it. I was thinking
> something like the following (using psuedocode):
> 
> -----------
> 
> quads = []
> mesh  = Blender.Mesh.Get()
> 
> def GetFaces():
> 	Blender.Window.EditMode(0)
> 
> 	faces = [f for f in mesh.faces if f.sel]
> 
> 	# Do face2quad calculations or whatever here
> 	# and append to quads
> 
> ------------
> 
> where "GetFaces" is a callback bound to some key/button press. This
> seems like it should work okay, but I figured I'd ask on this list
> before I spent the time doing it, especially if there's an easier
> way--of if it's been done before. I'm certainly not affected by "Not
> Invented Here" syndrome, and would be more than willing to use existing
> solutions. :)
> 
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python




More information about the Bf-python mailing list