Page Menu
Home
Search
Configure Global Search
Log In
Files
F3097
vcselector2.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Onur Yalazı (onuryalazi)
Nov 13 2013, 1:08 PM
Size
10 KB
Subscribers
None
vcselector2.patch
View Options
Index: config/linux2-config.py
===================================================================
RCS file: /cvsroot/bf-blender/blender/config/linux2-config.py,v
retrieving revision 1.23
Index: release/scripts/hotkeys.py
===================================================================
RCS file: /cvsroot/bf-blender/blender/release/scripts/hotkeys.py,v
retrieving revision 1.12
diff -u -r1.12 hotkeys.py
--- release/scripts/hotkeys.py 29 Jul 2006 17:22:56 -0000 1.12
+++ release/scripts/hotkeys.py 20 Oct 2006 21:43:47 -0000
@@ -427,6 +427,7 @@
"N":[
['N', 'Transform Properties panel'] ,
['N', 'OOPS window: Rename object/linked objects'] ,
+['Alt-N', 'View/Camera Selector panel'],
['Alt-N', 'Text Editor : New text '],
['Ctrl-N', 'Armature: Recalculate bone roll angles'] ,
['Ctrl-N', 'Edit Mode: Recalculate normals to outside'] ,
@@ -867,4 +868,4 @@
Blender.Window.Redraw()
-Register(draw, event, bevent)
\ No newline at end of file
+Register(draw, event, bevent)
Index: source/blender/include/BIF_space.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/include/BIF_space.h,v
retrieving revision 1.39
diff -u -r1.39 BIF_space.h
--- source/blender/include/BIF_space.h 27 Jun 2006 12:54:16 -0000 1.39
+++ source/blender/include/BIF_space.h 20 Oct 2006 21:43:54 -0000
@@ -54,6 +54,7 @@
#define VIEW3D_HANDLER_PROPERTIES 2
#define VIEW3D_HANDLER_OBJECT 3
#define VIEW3D_HANDLER_PREVIEW 4
+#define VIEW3D_HANDLER_VCSELECTOR 5
/* ipo handler codes */
#define IPO_HANDLER_PROPERTIES 20
Index: source/blender/include/BSE_drawview.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/include/BSE_drawview.h,v
retrieving revision 1.17
diff -u -r1.17 BSE_drawview.h
--- source/blender/include/BSE_drawview.h 12 Aug 2006 11:26:59 -0000 1.17
+++ source/blender/include/BSE_drawview.h 20 Oct 2006 21:43:54 -0000
@@ -78,5 +78,6 @@
void make_axis_color(char *col, char *col2, char axis);
+static int objascam = 0;
#endif /* BSE_DRAWVIEW_H */
Index: source/blender/src/drawview.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/drawview.c,v
retrieving revision 1.222
diff -u -r1.222 drawview.c
--- source/blender/src/drawview.c 16 Sep 2006 04:26:22 -0000 1.222
+++ source/blender/src/drawview.c 20 Oct 2006 21:44:11 -0000
@@ -112,6 +112,7 @@
#include "BIF_resources.h"
#include "BIF_screen.h"
#include "BIF_space.h"
+#include "BIF_toets.h" /* persptoetsen */
#ifdef WITH_VERSE
#include "BIF_verse.h"
@@ -2496,6 +2497,140 @@
}
}
+static void view_select_cb(void *pn, void *nil)
+{
+ int *padno = pn;
+ persptoetsen((int) padno);
+}
+
+static void view_select_next_camera(void *a, void *b)
+{
+ Scene *sc = G.scene;
+ Base *base;
+ Object *camera = G.scene->camera;
+ int c=0;
+
+ for (base = sc->base.first; base; base=base->next) {
+ if (!c) {
+ if (base->object == camera ) {
+ c = 1;
+ }
+ } else {
+ if (objascam || (base->object->type == OB_CAMERA)) {
+ G.vd->camera= base->object;
+ handle_view3d_lock();
+ return;
+ }
+ }
+ }
+}
+
+static void check_camera_type(void *a, void *b)
+{
+ if (!objascam && (G.scene->camera->type != OB_CAMERA)) {
+ view_select_next_camera(NULL, NULL);
+ }
+}
+
+static void view_select_prev_camera(void *a, void *b)
+{
+ Scene *sc = G.scene;
+ Base *base;
+ Object *camera = G.scene->camera;
+ int c = 0;
+
+ for (base = sc->base.last; base; base=base->prev) {
+ if (!c) {
+ if (base->object == camera ) {
+ c = 1;
+ }
+ } else {
+ if (objascam || (base->object->type == OB_CAMERA)) {
+ G.vd->camera= base->object;
+ handle_view3d_lock();
+ return;
+ }
+ }
+ }
+}
+
+static void test_obcampoin_but(char *name, ID **idpp)
+{
+ ID *id;
+ Base *base;
+
+ for (base = G.scene->base.first; base; base= base->next) {
+ id= (ID *)(base->object);
+ if( strcmp(name, id->name+2)==0 ) {
+ *idpp= id;
+ id_lib_extern(id); /* checks lib data, sets correct flag for saving then */
+ handle_view3d_lock();
+ return;
+ }
+ }
+ *idpp= (void *)G.scene->camera;
+}
+
+
+
+
+static void view3d_panel_vcselector(ScrArea *sa, short cntrl) // VIEW3D_HANDLER_VCSELECTOR
+{
+ uiBlock *block;
+ View3D *v3d= sa->spacedata.first;
+ uiBut *b;
+ int ofsx, ofsy;
+ char *ptext = (G.vd->persp==1) ? "Persp" : "Ortho";
+
+ block= uiNewBlock(&sa->uiblocks, "view3d_panel_vcselector", UI_EMBOSS, UI_HELV, sa->win);
+ uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl);
+ uiSetPanelHandler(VIEW3D_HANDLER_VCSELECTOR); // for close and esc
+
+ ofsx= -150+(sa->winx/2)/v3d->blockscale;
+ ofsy= -100+(sa->winy/2)/v3d->blockscale;
+
+ if(uiNewPanel(sa, block, "View/Camera Selector", "View3d", ofsx, ofsy, 300, 200)==0) return;
+
+ if(G.f & (G_VERTEXPAINT|G_FACESELECT|G_TEXTUREPAINT|G_WEIGHTPAINT)) {
+ uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw
+ }
+
+
+
+ b = uiDefBut(block, BUT, 1, "Front", 0, 133, 80, 20, NULL, 0.0, 0.0, 0, 0, "Selects Front View");
+ uiButSetFunc(b, view_select_cb, (void *)PAD1, NULL);
+ b = uiDefBut(block, BUT, 1, "^", 81, 133, 80, 20, NULL, 0.0, 0.0, 0, 0, "Simulates keypad 2");
+ uiButSetFunc(b, view_select_cb, (void *)PAD2, NULL);
+ b = uiDefBut(block, BUT, 1, "Side", 162, 133, 80, 20, NULL, 0.0, 0.0, 0, 0, "Selects Side View");
+ uiButSetFunc(b, view_select_cb, (void *)PAD3, NULL);
+
+ b = uiDefBut(block, BUT, 1, "<", 0, 112, 80, 20, NULL, 0.0, 0.0, 0, 0, "Simulates keypad 4");
+ uiButSetFunc(b, view_select_cb, (void *)PAD4, NULL);
+ b = uiDefBut(block, BUT, 1, ptext, 81, 112, 80, 20, NULL, 0.0, 0.0, 0, 0, "Toggles Ortographic/Perspective View");
+ uiButSetFunc(b, view_select_cb, (void *)PAD5, NULL);
+ b = uiDefBut(block, BUT, 1, ">", 162, 112, 80, 20, NULL, 0.0, 0.0, 0, 0, "Simulates keypad 6");
+ uiButSetFunc(b, view_select_cb, (void *)PAD6, NULL);
+
+ b = uiDefBut(block, BUT, 1, "Top", 0, 91, 80, 20, NULL, 0.0, 0.0, 0, 0, "Selects Top View");
+ uiButSetFunc(b, view_select_cb, (void *)PAD7, NULL);
+ b = uiDefBut(block, BUT, 1, "v", 81, 91, 80, 20, NULL, 0.0, 0.0, 0, 0, "Simulates keypad 8");
+ uiButSetFunc(b, view_select_cb, (void *)PAD8, NULL);
+ b = uiDefBut(block, BUT, 1, "", 162, 91, 80, 20, NULL, 0.0, 0.0, 0, 0, "Selects Rear View");
+ uiButSetFunc(b, view_select_cb, (void *)PAD9, NULL);
+
+ b = uiDefBut(block, BUT, 1, "Next Camera >", 121, 40, 120, 20, NULL, 0.0, 0.0, 0, 0, "Next Camera");
+ uiButSetFunc(b, view_select_next_camera, NULL, NULL);
+ b = uiDefBut(block, BUT, 1, "< Prev Camera", 0, 40, 120, 20, NULL, 0.0, 0.0, 0, 0, "Next Camera");
+ uiButSetFunc(b, view_select_prev_camera, NULL, NULL);
+
+ b = uiDefBut(block, BUT, 1, "Camera", 0, 60, 240, 20, NULL, 0.0, 0.0, 0, 0, "Selects Camera View");
+ uiButSetFunc(b, view_select_cb, (void *)PAD0, NULL);
+ b = uiDefIDPoinBut(block, test_obcampoin_but, 1, ID_OB, "OB:", 0, 20, 240, 20, &G.vd->camera, "Name of the selected Camera");
+ uiButSetFunc(b, view_select_cb, (void *) G.vd->camera, NULL);
+ b = uiDefButBitS(block, TOG, 1, 1, "All Objects", 0, 0, 240, 20, &objascam, 0, 0, 0, 0, "Toggles for using any object as camera");
+ uiButSetFunc(b, check_camera_type, NULL, NULL);
+
+}
static void view3d_blockhandlers(ScrArea *sa)
{
@@ -2525,7 +2660,9 @@
case VIEW3D_HANDLER_PREVIEW:
view3d_panel_preview(sa, v3d->blockhandler[a+1]);
break;
-
+ case VIEW3D_HANDLER_VCSELECTOR:
+ view3d_panel_vcselector(sa, v3d->blockhandler[a+1]);
+ break;
}
/* clear action value for event */
v3d->blockhandler[a+1]= 0;
Index: source/blender/src/header_view3d.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/header_view3d.c,v
retrieving revision 1.189
diff -u -r1.189 header_view3d.c
--- source/blender/src/header_view3d.c 12 Oct 2006 14:26:14 -0000 1.189
+++ source/blender/src/header_view3d.c 20 Oct 2006 21:44:38 -0000
@@ -500,6 +500,9 @@
case 18: /* render preview */
toggle_blockhandler(curarea, VIEW3D_HANDLER_PREVIEW, 0);
break;
+ case 19: /* camera properties */
+ toggle_blockhandler(curarea, VIEW3D_HANDLER_VCSELECTOR, 0);
+ break;
}
allqueue(REDRAWVIEW3D, 1);
}
@@ -516,7 +519,7 @@
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Render Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 18, "");
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 16, "");
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Background Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, "");
-
+ uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View/Camera Selector...|Alt N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
if ((G.vd->viewbut == 0) && !(G.vd->persp == 2)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
Index: source/blender/src/space.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/space.c,v
retrieving revision 1.385
diff -u -r1.385 space.c
--- source/blender/src/space.c 19 Oct 2006 05:06:41 -0000 1.385
+++ source/blender/src/space.c 20 Oct 2006 21:45:01 -0000
@@ -1625,7 +1625,11 @@
}
break;
case NKEY:
- if((G.qual==0)) {
+ if((G.qual==LR_ALTKEY)) {
+ toggle_blockhandler(curarea, VIEW3D_HANDLER_VCSELECTOR, UI_PNL_TO_MOUSE);
+ allqueue(REDRAWVIEW3D, 0);
+ }
+ else if((G.qual==0)) {
toggle_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_TO_MOUSE);
allqueue(REDRAWVIEW3D, 0);
}
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d1/7d/3afc03ef5233dcd5227f8dd60168
Event Timeline
Log In to Comment