[Bf-committers] Expanding the number of layers in Blender
David Bryant
aceone at bellsouth.net
Fri Dec 21 09:36:46 CET 2007
Whew!
No wonder no one want's to tackle the assignment of expanding the layer
base! There's fragmented code everywhere and very little commenting in the
codebase on the matter.I'm running into a lot of code that I can't wrap my
head around.There's really no place origin to "begin" to see where the bit
field assignments "really start" to define the layers.What I've found is
that the even bit shifted values for layers actually define layers ( 1,2,4,8
for layers 1,2,3,and 4 etc.). The odd values in between are for Shift
selected layers to have two or more layers visible at the same time.
Therefore numrical values in between the bit shifted values are unusable to
expand the layer count.(Bit fields are quick to evaluate but are not good
for this.Too limiting).
Also, layers are either visible or invisible.Shift selecting shouldn't
be.Either layer visible or layer invisible.
I need someone to explain to me what the following things are:
1.v3d->lay
2.vd->lay
3.vd->layact
4.0xFF000000 (I see this value from time to time in the layer code being
evaluated.What is it for)
I'm finding that this system has to be basically rebuilt!
With hardcoded code like this:
while(bit<32) {
if(vd->lay & (1<<bit)) {
vd->layact= 1<<bit;
break;
}
bit++;
}
Expanding Blender's layers (without hacking all over the place) will be very
difficult.
There should (in theory )be a place in Blender's code that
reads:
#define NUMBER_ OF_ LAYERS 400 (or whatever you want)
Changing the number of layers should be easy as changing a value or two in
the codebase.
I'm finding that the layer code has to be rebuilt almost entirely if it's
going to be code that's flexible and expandable.I've been able the expand
the number of layers in Blender (by hacking) but it really needs some solid
reengineering.
It also needs to be more modular.The layer code really needs it's own C
file. As I work, I'll see if I can make that happen.
Maybe you developers can help me.I'm up to the task but to do it right, it
might take me a month or two to complete (with some help).
At present, my Named Layers patch in the patch tracker is fully usable and
bug free ( to my knowledge) but only deals with the 20 present layers.This
further endeavor is just my contribution to make Blender even more powerful.
Digikiller
More information about the Bf-committers
mailing list