correct some warnings, also sensor_x was being paassed to object_camera_matrix(...) for x and y args, looks like an accident

This commit is contained in:
Campbell Barton 2011-11-04 15:21:34 +00:00
parent 4ea816837d
commit 209ceb6969
8 changed files with 22 additions and 25 deletions

@ -234,4 +234,3 @@ def project_name_get(path, fallback="Blender", prefix="Blender_"):
if "/branches/" in l:
return prefix + l.rsplit("/branches/", 1)[-1].split("/", 1)[0]
return fallback

@ -121,9 +121,7 @@ except ImportError:
EXCLUDE_MODULES = EXCLUDE_MODULES + ("aud", )
# import rpdb2; rpdb2.start_embedded_debugger('test')
import os
import inspect
import bpy
@ -327,7 +325,7 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
fw(ident + ".. attribute:: %s\n\n" % identifier)
write_indented_lines(ident + " ", fw, doc, False)
fw("\n")
elif type(descr) == MemberDescriptorType: # same as above but use 'data'
elif type(descr) == MemberDescriptorType: # same as above but use 'data'
fw(ident + ".. data:: %s\n\n" % identifier)
write_indented_lines(ident + " ", fw, doc, False)
fw("\n")
@ -443,7 +441,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
# naughty, we also add getset's into PyStructs, this is not typical py but also not incorrect.
# type_name is only used for examples and messages
type_name = str(type(module)).strip("<>").split(" ", 1)[-1][1:-1] # "<class 'bpy.app.handlers'>" --> bpy.app.handlers
type_name = str(type(module)).strip("<>").split(" ", 1)[-1][1:-1] # "<class 'bpy.app.handlers'>" --> bpy.app.handlers
if type(descr) == types.GetSetDescriptorType:
py_descr2sphinx("", fw, descr, module_name, type_name, key)
attribute_set.add(key)
@ -467,7 +465,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
# ack, cant use typical reference because we double up once here
# and one fort he module!
full_name = "%s.%s" % (module_name, type_name)
fw(" :ref:`%s submodule details <%s>`\n\n\n" % (full_name, module_id_as_ref(full_name))) # % (module_name, type_name)
fw(" :ref:`%s submodule details <%s>`\n\n\n" % (full_name, module_id_as_ref(full_name)))
del full_name
attribute_set.add(key)
@ -1306,7 +1304,7 @@ def rna2sphinx(BASEPATH):
from bpy import app as module
pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data")
if "bpy.app.handlers" not in EXCLUDE_MODULES:
if "bpy.app.handlers" not in EXCLUDE_MODULES:
from bpy.app import handlers as module
pymodule2sphinx(BASEPATH, "bpy.app.handlers", module, "Application Handlers")

@ -142,7 +142,7 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
col = split.column(align=True)
col.prop(cam, "sensor_fit", text="")
layout.label(text="Clipping:")
row = layout.row(align=True)
row.prop(cam, "clip_start", text="Start")

@ -1133,7 +1133,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
sub.prop(ipaint, "normal_angle", text="")
split = layout.split()
split.active = (use_projection)
split.prop(ipaint, "use_stencil_layer", text="Stencil")
@ -1148,10 +1148,10 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
row.menu("VIEW3D_MT_tools_projectpaint_clone", text=mesh.uv_texture_clone.name)
layout.prop(ipaint, "seam_bleed")
col = layout.column()
col.label(text="External Editing:")
row = col.split(align=True, percentage=0.55)
row.operator("image.project_edit", text="Quick Edit")
row.operator("image.project_apply", text="Apply")

@ -3045,7 +3045,7 @@ void object_camera_matrix(
else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) {
viewfac= winx;
}
else {
else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */
viewfac= (*ycor) * winy;
}
@ -3060,7 +3060,7 @@ void object_camera_matrix(
else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) {
viewfac= ((*lens) * winx) / (*sensor_x);
}
else if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) {
else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */
viewfac= ((*lens) * winy) / (*sensor_y);
}

@ -3408,20 +3408,20 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND
{
float *hsv= ui_block_hsv_get(but->block);
float rgb[3];
float phi, r, sqr, v[2];
float sensitivity = (shift?0.15:0.3) * ndof->dt;
float phi, r /*, sqr */ /* UNUSED */, v[2];
float sensitivity = (shift ? 0.15f : 0.3f) * ndof->dt;
ui_get_but_vectorf(but, rgb);
rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
/* Convert current colour on hue/sat disc to circular coordinates phi, r */
phi = fmodf(hsv[0]+0.25, 1.0f) * -2.0f*M_PI;
phi = fmodf(hsv[0]+0.25f, 1.0f) * -2.0f*M_PI;
r = hsv[1];
sqr = r>0.f?sqrtf(r):1;
/* sqr= r>0.f?sqrtf(r):1; */ /* UNUSED */
/* Convert to 2d vectors */
v[0] = r * cos(phi);
v[1] = r * sin(phi);
v[0] = r * cosf(phi);
v[1] = r * sinf(phi);
/* Use ndof device y and x rotation to move the vector in 2d space */
v[0] += ndof->ry * sensitivity;
@ -3431,19 +3431,19 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND
phi = atan2(v[0], v[1])/(2.0f*(float)M_PI) + 0.5f;
/* use ndof z rotation to additionally rotate hue */
phi -= ndof->rz * sensitivity * 0.5;
phi -= ndof->rz * sensitivity * 0.5f;
r = len_v2(v);
CLAMP(r, 0.0f, 1.0f);
/* convert back to hsv values, in range [0,1] */
hsv[0] = fmodf(phi, 1.0);
hsv[0] = fmodf(phi, 1.0f);
hsv[1] = r;
/* exception, when using color wheel in 'locked' value state:
* allow choosing a hue for black values, by giving a tiny increment */
if (but->flag & UI_BUT_COLOR_LOCK) { // lock
if (hsv[2] == 0.f) hsv[2] = 0.0001f;
if (hsv[2] == 0.0f) hsv[2] = 0.0001f;
}
hsv_to_rgb(hsv[0], hsv[1], hsv[2], data->vec, data->vec+1, data->vec+2);

@ -3014,7 +3014,7 @@ static void project_paint_begin(ProjPaintState *ps)
object_camera_mode(&ps->scene->r, camera);
object_camera_matrix(&ps->scene->r, camera, ps->winx, ps->winy, 0,
winmat, &_viewplane, &ps->clipsta, &ps->clipend,
&_lens, &_sensor_x, &_sensor_x, &_sensor_fit, &_ycor, &_viewdx, &_viewdy);
&_lens, &_sensor_x, &_sensor_y, &_sensor_fit, &_ycor, &_viewdx, &_viewdy);
ps->is_ortho= (ps->scene->r.mode & R_ORTHO) ? 1 : 0;
}

@ -1228,7 +1228,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
if (ca && (ca->flag & CAM_SHOWSENSOR)) {
/* assume fixed sensor width for now */
float sensor_aspect = ca->sensor_x / ca->sensor_y;
/* float sensor_aspect = ca->sensor_x / ca->sensor_y; */ /* UNUSED */
float sensor_scale = (x2i-x1i) / ca->sensor_x;
float sensor_height = sensor_scale * ca->sensor_y;
@ -1238,7 +1238,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
UI_ThemeColorShade(TH_WIRE, 100);
uiDrawBox(GL_LINE_LOOP, x1i, sy1, x2i, sy2, 2.0);
uiDrawBox(GL_LINE_LOOP, x1i, sy1, x2i, sy2, 2.0f);
}
}