[Bf-committers] Dimensioning for GSOC suggestion

Campbell Barton cbarton at metavr.com
Wed Apr 19 17:31:54 CEST 2006


Hi Hos, dimensions arnt as simple as you hinted :) - Heres my plans for 
implimenting, but would be a fine GSOC project.

Dimensions are not that simple esp if you want imperial (ft/inches)

Heres a list of teh stuff that needs to be added.
Store the Dimension data in the Scene (not prefs)
Add 2 new values to the Scene DNA
 - int unit_type:   0-none, 1-metric, 2-imperial, 3-Japanese 
(http://en.wikipedia.org/wiki/Japanese_units_of_measurement) - 
apparently its worth having.
 - unsigned double unit_scale:   this is the real world size of the 
blender unit, how many blender units to make a meter. so 1.0 means 1 
blender unit is 1 meter.  100.0 means 100 blender units is a metre.

Now we need 2 utility functions, convert a blender distance to a string, 
and a string to a blender unit.
so somebody can type in 2mm, or 4.9km and it will be converted.
Unit conversion will be hard coded here. though there should be defines 
for unit scales and sub divisions.

This can easerly be applied to edge length display and header grab length...

Once this is done numbuts will need to be have an arg for being a 
measurement button.
This well make the numbet display using the num2string utility function 
described above. as well as evaluate user input with the util function.

Now we can talk to blender in units, the 3d view grid needs to follow 
the units.
firstly the grid just needs to change size for the units. this is a no 
brainer.
The more complex area is to have measurements like imperial where there 
is a different grid subdivisions for miles/feet/inches.
So at different zoom levels you will neet to impose different sub 
divisions. (not all that hard,just define an array of sub divisions foir 
each dimension type)
Once the grid is drawn correctly snapping follows. (did some tests with 
modifying grid sub division)

It will be trickier to have transform numeric input work, but probably 
just evaluate the input string on input and update when a valid results 
returned.
This one could be posponed.. theeth probably needs to look into it.

This is just for dimensions, for weight volume etc you could go crazy, 
but I think dimensions alone are fine for blender.
- Cam



More information about the Bf-committers mailing list