59
55
#include "DNA_screen_types.h"
60
56
#include "DNA_space_types.h"
61
57
#include "DNA_view3d_types.h"
58
#include "DNA_userdef_types.h"
63
#include "BKE_utildefines.h"
60
#include "BKE_action.h"
62
#include "BKE_blender.h"
63
#include "BKE_displist.h"
64
64
#include "BKE_global.h"
66
#include "BKE_scene.h"
67
65
#include "BKE_ipo.h"
68
#include "BKE_action.h"
69
66
#include "BKE_ika.h"
70
67
#include "BKE_key.h"
71
#include "BKE_displist.h"
68
#include "BKE_scene.h"
69
#include "BKE_utildefines.h"
71
#include "BIF_butspace.h"
72
#include "BIF_editseq.h"
73
#include "BIF_editsound.h"
74
#include "BIF_editmesh.h"
73
75
#include "BIF_interface.h"
76
#include "BIF_poseobject.h"
77
#include "BIF_renderwin.h"
74
78
#include "BIF_screen.h"
75
79
#include "BIF_space.h"
76
#include "BIF_butspace.h"
77
#include "BIF_renderwin.h"
80
#include "BIF_toets.h"
78
81
#include "BIF_toolbox.h"
79
#include "BIF_toets.h"
80
#include "BIF_editseq.h"
81
#include "BIF_editsound.h"
82
#include "BIF_poseobject.h"
83
82
#include "BIF_usiblender.h"
85
84
#include "BDR_vpaint.h"
104
104
#include "BIF_poseobject.h"
106
/* only used in toets.c */
106
/* only used in toets.c and initrender.c */
107
107
/* this function doesn't really belong here */
108
108
/* ripped from render module */
109
109
void schrijfplaatje(char *name);
112
void write_imag(char *name)
112
static void write_imag(char *name)
114
114
/* from file select */
281
283
G.vd->viewquat[2]= (float)-cos(M_PI/4.0);
282
284
G.vd->viewquat[3]= (float)-cos(M_PI/4.0);
284
if(G.vd->persp>=2) G.vd->persp= perspo;
286
if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 0;
287
else if(G.vd->persp>=2) G.vd->persp= perspo;
286
289
else if(event==PAD3) {
287
290
G.vd->viewquat[0]= 0.5;
289
292
G.vd->viewquat[2]= 0.5;
290
293
G.vd->viewquat[3]= 0.5;
292
if(G.vd->persp>=2) G.vd->persp= perspo;
295
if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 0;
296
else if(G.vd->persp>=2) G.vd->persp= perspo;
294
298
else if(event==PADMINUS) {
295
299
/* this min and max is also in viewmove() */
343
349
G.vd->viewquat[2]= -0.5;
344
350
G.vd->viewquat[3]= -0.5;
346
if(G.vd->persp>=2) G.vd->persp= perspo;
352
if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 0;
353
else if(G.vd->persp>=2) G.vd->persp= perspo;
348
355
else if(event==PADMINUS) {
349
356
/* this min and max is also in viewmove() */
465
472
switch(G.scene->r.imtype) {
467
strcpy(str, "SAVE PNG"); return 1;
474
strcpy(str, "Save PNG"); return 1;
469
strcpy(str, "SAVE BMP"); return 1;
476
strcpy(str, "Save BMP"); return 1;
471
strcpy(str, "SAVE TARGA"); return 1;
478
strcpy(str, "Save Targa"); return 1;
473
strcpy(str, "SAVE RAW TARGA"); return 1;
480
strcpy(str, "Save Raw Targa"); return 1;
475
strcpy(str, "SAVE IRIS"); return 1;
482
strcpy(str, "Save IRIS"); return 1;
477
strcpy(str, "SAVE IRIS"); return 1;
484
strcpy(str, "Save IRIS"); return 1;
479
strcpy(str, "SAVE HAMX"); return 1;
486
strcpy(str, "Save HAMX"); return 1;
481
strcpy(str, "SAVE FTYPE"); return 1;
488
strcpy(str, "Save Ftype"); return 1;
483
strcpy(str, "SAVE JPEG"); return 1;
490
strcpy(str, "Save JPEG"); return 1;
485
strcpy(str, "SAVE IMAGE"); return 0;
492
strcpy(str, "Save Image"); return 0;
540
547
areawinset(sa->win);
543
activate_fileselect(FILE_BLENDER, "LOAD FILE", G.sce, BIF_read_file);
550
activate_fileselect(FILE_BLENDER, "Open File", G.sce, BIF_read_file);
546
553
else if(G.qual==LR_SHIFTKEY) {
547
activate_fileselect(FILE_LOADLIB, "LOAD LIBRARY", G.lib, 0);
554
activate_fileselect(FILE_LOADLIB, "Load Library", G.lib, 0);
553
560
strcpy(dir, G.sce);
555
activate_fileselect(FILE_BLENDER, "SAVE FILE", dir, BIF_write_file);
562
activate_fileselect(FILE_BLENDER, "Save File", dir, BIF_write_file);
558
565
else if(G.qual==LR_CTRLKEY) {
582
589
if(ob) strcpy(str, ob->id.name);
584
activate_fileselect(FILE_MAIN, "DATA SELECT", str, 0);
591
activate_fileselect(FILE_MAIN, "Data Select", str, 0);
587
594
else if(G.qual==0) {
629
636
newspace(curarea, SPACE_OOPS);
639
else if(G.qual==(LR_SHIFTKEY|LR_ALTKEY)) {
640
newspace(curarea, SPACE_OOPS+256);
632
643
else if(G.qual==0) {
633
644
extern_set_butspace(event);
734
753
/* also when Alt-E */
736
755
enter_editmode();
756
if(G.obedit) BIF_undo_push("Original"); // here, because all over code enter_editmode is abused
759
exit_editmode(2); // freedata, and undo
743
764
else if(G.qual==LR_CTRLKEY){
748
allqueue(REDRAWHEADERS, 0);
749
allqueue(REDRAWBUTSALL, 0);
767
if(ob->type==OB_ARMATURE) {
768
if(G.obpose) exit_posemode(1);
769
else enter_posemode();
771
else if(ob->type==OB_MESH) {
772
if(ob==G.obedit) EM_selectmode_menu();
751
776
else if(G.qual==LR_SHIFTKEY) {
778
exit_editmode(2); // freedata, and undo
754
779
if(G.f & G_FACESELECT)
755
780
set_faceselect();
756
781
if(G.f & G_VERTEXPAINT)
783
if(G.f & G_TEXTUREPAINT) {
784
G.f &= ~G_TEXTUREPAINT;
785
allqueue(REDRAWVIEW3D, 0);
786
allqueue(REDRAWBUTSEDIT, 0);
758
788
if(G.f & G_WEIGHTPAINT)
814
846
else if(curarea->spacetype==SPACE_IMAGE); // is new panel, in ipo queue
815
847
else if(curarea->spacetype==SPACE_ACTION); // is own queue
816
848
else if(curarea->spacetype==SPACE_NLA); // is new panel
849
else if(curarea->spacetype==SPACE_SEQ); // is new panel
818
851
clever_numbuts();
844
877
if(G.qual==LR_CTRLKEY) {
845
878
strcpy(dir, G.sce);
846
879
if (untitled(dir)) {
847
activate_fileselect(FILE_BLENDER, "SAVE FILE", dir, BIF_write_file);
880
activate_fileselect(FILE_BLENDER, "Save File", dir, BIF_write_file);
849
882
BIF_write_file(dir);
850
883
free_filesel_spec(dir);
876
909
else if(G.qual==(LR_ALTKEY|LR_CTRLKEY)) {
878
int event= pupmenu("10 Timer%t|draw|draw+swap|displist");
911
int event= pupmenu("10 Timer%t|draw|draw+swap|displist|undo");
880
913
double stime= PIL_check_seconds_timer();
881
914
char tmpstr[128];
901
937
if(event==1) sprintf(tmpstr, "draw %%t|%d ms", time);
902
938
if(event==2) sprintf(tmpstr, "d+sw %%t|%d ms", time);
903
939
if(event==3) sprintf(tmpstr, "displist %%t|%d ms", time);
940
if(event==4) sprintf(tmpstr, "undo %%t|%d ms", time);
926
969
if(G.qual==LR_CTRLKEY) {
927
970
strcpy(dir, G.sce);
928
971
if (untitled(dir)) {
929
activate_fileselect(FILE_BLENDER, "SAVE FILE", dir, BIF_write_file);
972
activate_fileselect(FILE_BLENDER, "Save File", dir, BIF_write_file);
931
974
BIF_write_file(dir);
932
975
free_filesel_spec(dir);
943
986
if(textspace==0) {
944
987
if(G.qual==LR_CTRLKEY) {
945
if(okee("ERASE ALL")) {
988
if(okee("Erase all")) {
989
strcpy(G.sce, BLI_gethome());
990
strcat(G.sce, "/untitled.blend");
946
992
if( BIF_read_homefile()==0) error("No file ~/.B.blend");
998
case YKEY: // redo alternative
1000
if(G.qual==LR_CTRLKEY) {
1008
if(G.qual & (LR_CTRLKEY|LR_COMMANDKEY)) { // all combos with ctrl/commandkey are accepted
1009
if ELEM(G.qual, LR_CTRLKEY, LR_COMMANDKEY) BIF_undo();
1010
else BIF_redo(); // all combos with ctrl is redo