removed doc_browser.py - since it covers ~half the BPY api, not documenting any of blenders data types.

replaced with a help_bpy_api.py, that opens a web browser at the Blender Python API page.
Camera.c - added a veriable .angle to camera, same as .lens but adjusts the camera angle in degrees (like the D button)
export_fbx.py - use the the camera angle property.
object_cookie_cutter.py - use PointInTriangle2D rather then own function.
buttons_shading.c - added OB: and tooltip to object world mapping.
interface_draw.c - (Simple theme) text buttons looked exactly like normal buttons (more confusing when they had no text), made the text and ID buttons render inset so you can tell them apart.
This commit is contained in:
2007-04-28 17:21:00 +00:00
parent 6e27e1b6eb
commit 1d181b9108
8 changed files with 128 additions and 512 deletions

View File

@@ -52,6 +52,7 @@
enum cam_consts {
EXPP_CAM_ATTR_LENS = 0,
EXPP_CAM_ATTR_ANGLE,
EXPP_CAM_ATTR_DOFDIST,
EXPP_CAM_ATTR_CLIPEND,
EXPP_CAM_ATTR_CLIPSTART,
@@ -728,6 +729,9 @@ static PyObject *getFloatAttr( BPy_Camera *self, void *type )
case EXPP_CAM_ATTR_LENS:
param = cam->lens;
break;
case EXPP_CAM_ATTR_ANGLE:
param = 360.0f * atan(16.0f/cam->lens) / M_PI;
break;
case EXPP_CAM_ATTR_DOFDIST:
param = cam->YF_dofdist;
break;
@@ -772,14 +776,19 @@ static int setFloatAttrClamp( BPy_Camera *self, PyObject *value, void *type )
float *param;
struct Camera *cam = self->camera;
float min, max;
int ret;
switch( (int)type ) {
case EXPP_CAM_ATTR_LENS:
min = 1.0;
max = 250.0;
param = &cam->lens;
break;
case EXPP_CAM_ATTR_ANGLE:
min = 7.323871;
max = 172.847331;
param = &cam->lens;
break;
case EXPP_CAM_ATTR_DOFDIST:
min = 0.0;
max = 5000.0;
@@ -826,7 +835,14 @@ static int setFloatAttrClamp( BPy_Camera *self, PyObject *value, void *type )
"undefined type in setFloatAttrClamp" );
}
return EXPP_setFloatClamped( value, param, min, max );
ret = EXPP_setFloatClamped( value, param, min, max );
if (ret==0) {
if ((int)type == EXPP_CAM_ATTR_ANGLE) {
cam->lens = 16.0f / tan(M_PI*cam->lens/360.0f);
}
}
return ret;
}
@@ -879,6 +895,11 @@ static PyGetSetDef BPy_Camera_getseters[] = {
(getter)getFloatAttr, (setter)setFloatAttrClamp,
"lens angle for perspective cameras",
(void *)EXPP_CAM_ATTR_LENS},
{"angle",
(getter)getFloatAttr, (setter)setFloatAttrClamp,
"lens angle for perspective cameras",
(void *)EXPP_CAM_ATTR_ANGLE},
{"scale",
(getter)getFloatAttr, (setter)setFloatAttrClamp,
"scale for ortho cameras",

View File

@@ -50,6 +50,7 @@ class Camera:
@ivar type: The Camera type: 'persp' or 'ortho'
@ivar mode: The mode flags: B{ORed value}: 'showLimits':1, 'showMist':2.
@ivar lens: The lens value in [1.0, 250.0], only relevant to *persp* cameras.
@ivar angle: The lens value in degrees [7.323871, 172.847331], only relevant to *persp* cameras.
@ivar scale: The scale value in [0.01, 1000.00], only relevant to *ortho* cameras.
@ivar clipStart: The clip start value in [0.0, 100.0].
@ivar clipEnd: The clip end value in [1.0, 5000.0].