Of course like half the internet-enabled planet I am thinking about writing a game :-) specifically a 3d game using Blender, what a surprise. My initial concept requires a lot (several hundred) of bricks (cubes) to be deployed in the scene, setting up the "game board". I have actually managed to write my very first Python script today which generates the basic cubes in the correct locations. (Well actually it's a hack of someone else's script, but it's running and I'm chuffed...) now I face the next decision. Each cube will have a glyph on the bottom face -- think Mah-Jongg tiles -- so I need to know (a) how to distinguish the "bottom" from other faces of the cube and (b) the best way to decorate the cubes with glyphs -- letters, numbers, rebus symbols, etc.

I can imagine generating a glyph collection (flat mesh shapes) and on demand, copying one and parenting it to the target cube (but how to get it properly aligned with a certain face?). I can imagine generating a png library (glyph images), with all the cubes sharing a standard uv map, and painting the glyphs onto the cubes right after creating them. There are probably other ways, for example if I wanted my glyphs to look incised (haven't tried "engraving" yet). My experience of Blender so far is that there are always several ways to do X, but some are better than others :-)

How would a smart Blenderista approach the problem of placing selected 2d glyphs onto just one face of say 400 cubes, via python scripting? and making them pretty? I'd rather not tackle this six stupid ways before stumbling on (or never stumbling on) the smart one.

  • $\begingroup$ Oh... trying the six stupid ways is the fun part lol! $\endgroup$
    – 10 Replies
    Jan 1, 2017 at 0:45
  • $\begingroup$ OK here is my thinking, correct me someone if I am dumb. It seems more efficient to create a library of labelled cubes in advance, fully textured and finished, one cube per glyph shape, using a Python script; import these stock cubes into a non-visible layer; make copies of them as required by the game logic during scene construction, placing the copies on the playing area in the visible layer. is that how a pro would do it? $\endgroup$
    – Tazling
    Jan 3, 2017 at 20:29


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.