[Bf-committers] Expanding the number of layers in Blender

Timothy Baldridge tbaldridge at gmail.com
Tue Dec 18 20:52:17 CET 2007


That's the nice thing about bit fields. You can have object on
multiple layers. I'd recomend doing a bit field array, where each byte
the array represents 8 layers. But still you will have to iterate over
the entire array to see if the object should be drawn, where as now
it's as simple as:

if (objectmask & viewmask) {
     draw_object();
}

You will have to do this with a bitfield array:

for (x = 0; x < bfsize; x++){
     if (objbf[x] & viewmask[x]) {
          draw_object();
          break;
     }
}

Or you could give each object a linked list of layers they are a part
of. That might not be a bad alternative. It would be rather fast. Not
as fast as it currently stands (only one branch) but still not
terrible.

Timothy


-- 
If you put tomfoolery into a computer, nothing comes out but
tomfoolery. But this tomfoolery, having passed through a very
expensive machine, is somehow ennobled and no one dares criticize it.
(Pierre Gallois)


More information about the Bf-committers mailing list