Page Menu
Home
Search
Configure Global Search
Log In
Files
F3745
cameraang6.txt
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Juho Vepsalainen (bebraw)
Nov 13 2013, 1:12 PM
Size
4 KB
Subscribers
None
cameraang6.txt
View Options
Index: source/blender/blenkernel/intern/object.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/blenkernel/intern/object.c,v
retrieving revision 1.119
diff -u -p -u -r1.119 object.c
--- source/blender/blenkernel/intern/object.c 30 Nov 2006 15:54:20 -0000 1.119
+++ source/blender/blenkernel/intern/object.c 1 Dec 2006 14:17:27 -0000
@@ -495,6 +495,7 @@ void *add_camera()
cam= alloc_libblock(&G.main->camera, ID_CA, "Camera");
cam->lens= 35.0f;
+ cam->angle= 49.14f;
cam->clipsta= 0.1f;
cam->clipend= 100.0f;
cam->drawsize= 0.5f;
@@ -2051,5 +2052,3 @@ void object_handle_update(Object *ob)
// printf("set proxy pointer for later group stuff %s\n", ob->id.name);
}
}
-
-
Index: source/blender/blenloader/intern/readfile.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/blenloader/intern/readfile.c,v
retrieving revision 1.332
diff -u -p -u -r1.332 readfile.c
--- source/blender/blenloader/intern/readfile.c 30 Nov 2006 21:40:11 -0000 1.332
+++ source/blender/blenloader/intern/readfile.c 1 Dec 2006 14:17:28 -0000
@@ -6253,6 +6253,17 @@ static void do_versions(FileData *fd, Li
}
}
+ if(main->versionfile <= 243) {
+ Camera *cam = main->camera.first;
+
+ while(cam) {
+ if(cam->angle==0.0) {
+ cam->angle= 16 / tan(M_PI*cam->lens/360);
+ }
+ cam= cam->id.next;
+ }
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
Index: source/blender/makesdna/DNA_camera_types.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_camera_types.h,v
retrieving revision 1.14
diff -u -p -u -r1.14 DNA_camera_types.h
--- source/blender/makesdna/DNA_camera_types.h 6 Nov 2006 15:42:37 -0000 1.14
+++ source/blender/makesdna/DNA_camera_types.h 1 Dec 2006 14:17:28 -0000
@@ -46,8 +46,10 @@ struct Ipo;
typedef struct Camera {
ID id;
- short type, flag;
- float passepartalpha, pad1;
+ short type, flag, angletoggle;
+ short pad1;
+ float angle;
+ float passepartalpha, pad2;
float clipsta, clipend;
float lens, ortho_scale, drawsize;
float shiftx, shifty;
@@ -84,4 +86,3 @@ typedef struct Camera {
#endif
#endif
-
Index: source/blender/src/buttons_editing.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/buttons_editing.c,v
retrieving revision 1.305
diff -u -p -u -r1.305 buttons_editing.c
--- source/blender/src/buttons_editing.c 29 Nov 2006 21:59:19 -0000 1.305
+++ source/blender/src/buttons_editing.c 1 Dec 2006 14:17:29 -0000
@@ -2667,12 +2667,26 @@ static void editing_panel_curve_type(Obj
/* *************************** CAMERA ******************************** */
+/* callback to handle angle conversion */
+static void do_angleconversion_cb(void *lens1, void *angle1) {
+ float *lens= (float *)lens1;
+ float *angle= (float *)angle1;
+ float anglevalue= *angle;
+
+ printf("%f \n", anglevalue);
+ if(lens) {
+ *lens= 16 / tan(M_PI*anglevalue/360);
+ }
+
+ allqueue(REDRAWVIEW3D, 0);
+}
static void editing_panel_camera_type(Object *ob, Camera *cam)
{
uiBlock *block;
+ uiBut *but;
float grid=0.0;
-
+
if(G.vd) grid= G.vd->grid;
if(grid<1.0) grid= 1.0;
@@ -2681,16 +2695,28 @@ static void editing_panel_camera_type(Ob
uiDefBut(block, LABEL, 10, "Lens:", 10, 180, 150, 20, 0, 0.0, 0.0, 0, 0, "");
-if(cam->type==CAM_ORTHO) {
+ if(cam->type==CAM_ORTHO) {
uiDefButF(block, NUM,REDRAWVIEW3D, "Scale:",
10, 160, 150, 20, &cam->ortho_scale, 0.01, 1000.0, 50, 0, "Specify the ortho scaling of the used camera");
} else {
- uiDefButF(block, NUM,REDRAWVIEW3D, "Lens:",
- 10, 160, 150, 20, &cam->lens, 1.0, 250.0, 100, 0, "Specify the lens of the camera");
+ if(cam->angletoggle) {
+ allqueue(REDRAWVIEW3D, 0); /* It is possible that the value of button is too high */
+ but= uiDefButF(block, NUM, B_NOP, "Lens:",
+ 10, 160, 150, 20, &cam->angle, 1.0, 179.0, 100, 0, "Specify the lens of the camera in degrees");
+ uiButSetFunc(but,do_angleconversion_cb,&cam->lens,&cam->angle);
+ }
+ else {
+ uiDefButF(block, NUM,REDRAWVIEW3D, "Lens:",
+ 10, 160, 150, 20, &cam->lens, 1.0, 250.0, 100, 0, "Specify the lens of the camera");
+ }
}
- uiDefButS(block, TOG, REDRAWVIEW3D, "Orthographic",
- 10, 135, 150, 20, &cam->type, 0, 0, 0, 0, "Render orthogonally");
+ uiBlockBeginAlign(block);
+ uiDefButS(block, TOG, REDRAWVIEW3D, "Ortho",
+ 10, 135, 75, 20, &cam->type, 0, 0, 0, 0, "Render orthogonally");
+ uiDefButS(block, TOG, REDRAWVIEW3D, "Angle",
+ 85, 135, 75, 20, &cam->angletoggle, 0, 0, 0, 0, "Use angle as normal camera lens value");
+ uiBlockEndAlign(block);
uiDefBut(block, LABEL, 0, "Clipping:", 10, 110, 150, 20, 0, 0.0, 0.0, 0, 0, "");
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d0/8c/ba82a15f0d0a090981cd169017cb
Event Timeline
Log In to Comment