~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/src/editface.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: editface.c,v 1.25 2004/05/03 13:23:19 blendix Exp $
 
2
 * $Id: editface.c,v 1.40 2005/05/12 19:17:12 ton Exp $
3
3
 *
4
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5
5
 *
38
38
#include <config.h>
39
39
#endif
40
40
 
41
 
#ifdef WIN32
42
 
#include "BLI_winstuff.h"
43
 
#endif
44
41
#include "MEM_guardedalloc.h"
45
42
 
46
43
#include "BLI_blenlib.h"
57
54
#include "DNA_object_types.h"
58
55
#include "DNA_space_types.h"
59
56
#include "DNA_screen_types.h"
 
57
#include "DNA_scene_types.h"
60
58
#include "DNA_view3d_types.h"
 
59
#include "DNA_userdef_types.h"
61
60
 
62
61
#include "BKE_utildefines.h"
63
62
#include "BKE_displist.h"
86
85
 
87
86
#include "mydevice.h"
88
87
#include "blendef.h"
89
 
#include "render.h"
90
88
#include "butspace.h"
91
89
 
92
90
#include "TPT_DependKludge.h"
96
94
#include "BSE_trans_types.h"
97
95
#endif /* NAN_TPT */
98
96
 
99
 
TFace *lasttface=0;
 
97
#include "BDR_unwrapper.h"
 
98
 
 
99
TFace *lasttface=NULL;
100
100
 
101
101
static void uv_calc_center_vector(float *result, Object *ob, Mesh *me)
102
102
{
464
464
                tface= me->tface;
465
465
                mface= me->mface;
466
466
                for(a=0; a<me->totface; a++, mface++, tface++) {
467
 
                        if(!(tface->flag & TF_SELECT && mface->v3)) return;
 
467
                        if(!(tface->flag & TF_SELECT && mface->v3)) continue;
468
468
                                
469
469
                        dx= dy= 0;
470
470
                        if(mface->v4) b= 3; else b= 2;
486
486
                }
487
487
        }
488
488
 
 
489
        BIF_undo_push("UV calculation");
 
490
 
489
491
        allqueue(REDRAWVIEW3D, 0);
490
492
        allqueue(REDRAWIMAGE, 0);
491
493
}
605
607
                tface++;
606
608
        }
607
609
 
 
610
        BIF_undo_push("Reveal UV face");
 
611
 
608
612
        allqueue(REDRAWVIEW3D, 0);
609
613
        allqueue(REDRAWIMAGE, 0);
610
614
}
611
615
 
612
 
 
613
 
 
614
616
void hide_tface()
615
617
{
616
618
        Mesh *me;
641
643
                
642
644
                tface++;
643
645
        }
 
646
        BIF_undo_push("Hide UV face");
644
647
        allqueue(REDRAWVIEW3D, 0);
645
648
        allqueue(REDRAWIMAGE, 0);
646
649
        
647
650
}
648
651
 
649
 
void select_linked_tfaces()
 
652
void select_linked_tfaces(int mode)
650
653
{
 
654
        Object *ob;
651
655
        Mesh *me;
652
 
        TFace *tface;
653
 
        MFace *mface;
654
 
        int a, doit=1;
655
 
        char *cpmain;
656
 
        
657
 
        me= get_mesh(OBACT);
 
656
        TFace *tf;
 
657
        MFace *mf;
 
658
        int a, doit=1, mark=0;
 
659
        char *cpmain, *linkflag;
 
660
        short mval[2];
 
661
        unsigned int index=0;
 
662
 
 
663
        ob = OBACT;
 
664
        me = get_mesh(ob);
658
665
        if(me==0 || me->tface==0 || me->totface==0) return;
659
 
        
 
666
 
 
667
        if (mode==0 || mode==1) {
 
668
                if (!(ob->lay & G.vd->lay))
 
669
                        error("The active object is not in this layer");
 
670
                        
 
671
                getmouseco_areawin(mval);
 
672
                if (!face_pick(me, mval[0], mval[1], &index)) return;
 
673
        }
 
674
 
 
675
        if(me->medge) {
 
676
                select_linked_tfaces_with_seams(mode, me, index);
 
677
                return;
 
678
        }
 
679
 
660
680
        cpmain= MEM_callocN(me->totvert, "cpmain");
 
681
        linkflag= MEM_callocN(sizeof(char)*me->totface, "linkflaguv");
 
682
 
 
683
        if (mode==0 || mode==1) {
 
684
                /* only put face under cursor in array */
 
685
                mf= ((MFace*)me->mface) + index;
 
686
                cpmain[mf->v1]= cpmain[mf->v2]= cpmain[mf->v3]= 1;
 
687
                if (mf->v4) cpmain[mf->v4]= 1;
 
688
                linkflag[index]= 1;
 
689
        }
 
690
        else {
 
691
                /* fill array by selection */
 
692
                tf= me->tface;
 
693
                mf= me->mface;
 
694
                for(a=0; a<me->totface; a++, tf++, mf++) {
 
695
                        if(tf->flag & TF_HIDE);
 
696
                        else if(tf->flag & TF_SELECT) {
 
697
                                if(mf->v3) {
 
698
                                        cpmain[mf->v1]= 1;
 
699
                                        cpmain[mf->v2]= 1;
 
700
                                        cpmain[mf->v3]= 1;
 
701
                                        if(mf->v4) cpmain[mf->v4]= 1;
 
702
                                        linkflag[a]= 1;
 
703
                                }
 
704
                        }
 
705
                }
 
706
        }
661
707
        
662
708
        while(doit) {
663
709
                doit= 0;
664
710
                
665
 
                /* select connected: fill array */
666
 
                tface= me->tface;
667
 
                mface= me->mface;
668
 
                a= me->totface;
669
 
                while(a--) {
670
 
                        if(tface->flag & TF_HIDE);
671
 
                        else if(tface->flag & TF_SELECT) {
672
 
                                if( mface->v3) {
673
 
                                        cpmain[mface->v1]= 1;
674
 
                                        cpmain[mface->v2]= 1;
675
 
                                        cpmain[mface->v3]= 1;
676
 
                                        if(mface->v4) cpmain[mface->v4]= 1;
677
 
                                }
678
 
                        }
679
 
                        tface++; mface++;
680
 
                }
681
 
                
682
 
                /* reverse: using array select the faces */
683
 
 
684
 
                tface= me->tface;
685
 
                mface= me->mface;
686
 
                a= me->totface;
687
 
                while(a--) {
688
 
                        if(tface->flag & TF_HIDE);
689
 
                        else if((tface->flag & TF_SELECT)==0) {
690
 
                                if( mface->v3) {
691
 
                                        if(mface->v4) {
692
 
                                                if(cpmain[mface->v4]) {
693
 
                                                        tface->flag |= TF_SELECT;
694
 
                                                        doit= 1;
695
 
                                                }
696
 
                                        }
697
 
                                        if( cpmain[mface->v1] || cpmain[mface->v2] || cpmain[mface->v3] ) {
698
 
                                                tface->flag |= TF_SELECT;
699
 
                                                doit= 1;
700
 
                                        }
701
 
                                }
702
 
                        }
703
 
                        tface++; mface++;
704
 
                }
705
 
                
706
 
        }
 
711
                /* expand selection */
 
712
                tf= me->tface;
 
713
                mf= me->mface;
 
714
                for(a=0; a<me->totface; a++, tf++, mf++) {
 
715
                        if(tf->flag & TF_HIDE);
 
716
                        else if(mf->v3 && !linkflag[a]) {
 
717
                                mark= 0;
 
718
 
 
719
                                if(cpmain[mf->v1] || cpmain[mf->v2] || cpmain[mf->v3])
 
720
                                        mark= 1;
 
721
                                else if(mf->v4 && cpmain[mf->v4])
 
722
                                        mark= 1;
 
723
 
 
724
                                if(mark) {
 
725
                                        linkflag[a]= 1;
 
726
                                        cpmain[mf->v1]= cpmain[mf->v2]= cpmain[mf->v3]= 1;
 
727
                                        if(mf->v4) cpmain[mf->v4]= 1;
 
728
                                        doit= 1;
 
729
                                }
 
730
                        }
 
731
                }
 
732
                
 
733
        }
 
734
 
 
735
        if(mode==0 || mode==2) {
 
736
                for(a=0, tf=me->tface; a<me->totface; a++, tf++)
 
737
                        if(linkflag[a])
 
738
                                tf->flag |= TF_SELECT;
 
739
                        else
 
740
                                tf->flag &= ~TF_SELECT;
 
741
        }
 
742
        else if(mode==1) {
 
743
                for(a=0, tf=me->tface; a<me->totface; a++, tf++)
 
744
                        if(linkflag[a] && (tf->flag & TF_SELECT))
 
745
                                break;
 
746
 
 
747
                if (a<me->totface) {
 
748
                        for(a=0, tf=me->tface; a<me->totface; a++, tf++)
 
749
                                if(linkflag[a])
 
750
                                        tf->flag &= ~TF_SELECT;
 
751
                }
 
752
                else {
 
753
                        for(a=0, tf=me->tface; a<me->totface; a++, tf++)
 
754
                                if(linkflag[a])
 
755
                                        tf->flag |= TF_SELECT;
 
756
                }
 
757
        }
 
758
        
707
759
        MEM_freeN(cpmain);
 
760
        MEM_freeN(linkflag);
708
761
        
 
762
        BIF_undo_push("Select linked UV face");
709
763
        allqueue(REDRAWVIEW3D, 0);
710
764
        allqueue(REDRAWIMAGE, 0);
711
 
        
712
765
}
713
766
 
714
767
void deselectall_tface()
739
792
                }
740
793
                tface++;
741
794
        }
 
795
 
 
796
        BIF_undo_push("(De)select all UV face");
742
797
        allqueue(REDRAWVIEW3D, 0);
743
798
        allqueue(REDRAWIMAGE, 0);
744
799
}
763
818
                tface++;
764
819
        }
765
820
 
 
821
        BIF_undo_push("Select inverse UV face");
766
822
        allqueue(REDRAWVIEW3D, 0);
767
823
        allqueue(REDRAWIMAGE, 0);
768
824
}
778
834
        me= get_mesh(OBACT);
779
835
        if(me==0 || me->tface==0) return;
780
836
        
781
 
        mode= pupmenu("OK? %t|Rot UV %x1|Rot VertexCol %x2");
 
837
        mode= pupmenu("Rotate %t|UV Co-ordinates %x1|Vertex Colors %x2");
782
838
        
783
839
        if(mode<1) return;
784
840
        
828
884
                mface++;
829
885
        }
830
886
        
 
887
        BIF_undo_push("Rotate UV face");
831
888
        makeDispList(OBACT);
832
889
        allqueue(REDRAWVIEW3D, 0);
833
890
        allqueue(REDRAWIMAGE, 0);
834
891
}
835
892
 
 
893
void minmax_tface(float *min, float *max)
 
894
{
 
895
        Object *ob;
 
896
        Mesh *me;
 
897
        MFace *mf;
 
898
        TFace *tf;
 
899
        MVert *mv;
 
900
        int a;
 
901
        float vec[3], bmat[3][3];
 
902
        
 
903
        ob = OBACT;
 
904
        if (ob==0) return;
 
905
        me= get_mesh(ob);
 
906
        if(me==0 || me->tface==0) return;
 
907
        
 
908
        Mat3CpyMat4(bmat, ob->obmat);
 
909
 
 
910
        mv= me->mvert;
 
911
        mf= me->mface;
 
912
        tf= me->tface;
 
913
        for (a=me->totface; a>0; a--, mf++, tf++) {
 
914
                if (!mf->v3 || tf->flag & TF_HIDE || !(tf->flag & TF_SELECT))
 
915
                        continue;
 
916
 
 
917
                VECCOPY(vec, (mv+mf->v1)->co);
 
918
                Mat3MulVecfl(bmat, vec);
 
919
                VecAddf(vec, vec, ob->obmat[3]);
 
920
                DO_MINMAX(vec, min, max);               
 
921
 
 
922
                VECCOPY(vec, (mv+mf->v2)->co);
 
923
                Mat3MulVecfl(bmat, vec);
 
924
                VecAddf(vec, vec, ob->obmat[3]);
 
925
                DO_MINMAX(vec, min, max);               
 
926
 
 
927
                VECCOPY(vec, (mv+mf->v3)->co);
 
928
                Mat3MulVecfl(bmat, vec);
 
929
                VecAddf(vec, vec, ob->obmat[3]);
 
930
                DO_MINMAX(vec, min, max);               
 
931
 
 
932
                if (mf->v4) {
 
933
                        VECCOPY(vec, (mv+mf->v4)->co);
 
934
                        Mat3MulVecfl(bmat, vec);
 
935
                        VecAddf(vec, vec, ob->obmat[3]);
 
936
                        DO_MINMAX(vec, min, max);
 
937
                }
 
938
        }
 
939
}
 
940
 
836
941
/**
837
942
 * Returns the face under the give position in screen coordinates.
838
943
 * Code extracted from face_select routine.
839
944
 * Question: why is all of the backbuffer drawn?
840
945
 * We're only interested in one pixel!
841
946
 * @author      Maarten Gribnau
842
 
 * @param       me      the mesh with the faces to be picked
843
 
 * @param       x       the x-coordinate to pick at
844
 
 * @param       y       the y-coordinate to pick at
845
 
 * @return the face under the cursor (-1 if there was no face found)
 
947
 * @param       me              the mesh with the faces to be picked
 
948
 * @param       x               the x-coordinate to pick at
 
949
 * @param       y               the y-coordinate to pick at
 
950
 * @param       index   the index of the face
 
951
 * @return 1 if found, 0 if none found
846
952
 */
847
 
int face_pick(Mesh *me, short x, short y)
 
953
int face_pick(Mesh *me, short x, short y, unsigned int *index)
848
954
{
849
955
        unsigned int col;
850
 
        int index;
851
956
 
852
 
        if (me==0 || me->tface==0) {
853
 
                return -1;
854
 
        }
 
957
        if (me==0 || me->tface==0)
 
958
                return 0;
855
959
 
856
960
        /* Have OpenGL draw in the back buffer with color coded face indices */
857
961
        if (curarea->win_swap==WIN_EQUAL) {
874
978
                SWITCH_INT(col);
875
979
        }
876
980
        /* Convert the color back to a face index */
877
 
        index = framebuffer_to_index(col);
878
 
        if (col==0 || index<=0 || index>me->totface) {
879
 
                return -1;
880
 
        }
881
 
        return (index-1);
 
981
        *index = framebuffer_to_index(col);
 
982
        if (col==0 || (*index)<=0 || (*index)>me->totface)
 
983
                return 0;
 
984
 
 
985
        (*index)--;
 
986
        
 
987
        return 1;
882
988
}
883
989
 
884
990
void face_select()
888
994
        TFace *tface, *tsel;
889
995
        MFace *msel;
890
996
        short mval[2];
891
 
        int a, index;
 
997
        unsigned int a, index;
892
998
 
893
999
        /* Get the face under the cursor */
894
1000
        ob = OBACT;
895
1001
        if (!(ob->lay & G.vd->lay)) {
896
 
                error("Active object not in this layer!");
 
1002
                error("The active object is not in this layer");
897
1003
        }
898
1004
        me = get_mesh(ob);
899
1005
        getmouseco_areawin(mval);
900
 
        index = face_pick(me, mval[0], mval[1]);
901
 
        if (index==-1) return;
 
1006
        if (!face_pick(me, mval[0], mval[1], &index)) return;
902
1007
        
903
1008
        tsel= (((TFace*)me->tface)+index);
904
1009
        msel= (((MFace*)me->mface)+index);
929
1034
        lasttface = tsel;
930
1035
        
931
1036
        /* image window redraw */
 
1037
        
 
1038
        BIF_undo_push("Select UV face");
932
1039
        allqueue(REDRAWIMAGE, 0);
933
1040
        allqueue(REDRAWBUTSEDIT, 0);
934
1041
        allqueue(REDRAWVIEW3D, 0);
988
1095
                
989
1096
                MEM_freeN(rectm);
990
1097
                MEM_freeN(selar);
 
1098
 
 
1099
                BIF_undo_push("Border Select UV face");
 
1100
 
991
1101
                allqueue(REDRAWVIEW3D, 0);
992
1102
                allqueue(REDRAWIMAGE, 0);
993
1103
        }
1024
1134
#define UV_STD2_MAPPING 129
1025
1135
#define UV_STD1_MAPPING 128
1026
1136
#define UV_WINDOW_MAPPING 5
 
1137
#define UV_LSCM_MAPPING 6
1027
1138
#define UV_CYL_EX 32
1028
1139
#define UV_SPHERE_EX 34
1029
1140
 
1043
1154
                      MENUSTRING("Cube",          UV_CUBE_MAPPING) "|"
1044
1155
                      MENUSTRING("Cylinder",      UV_CYL_MAPPING) "|"
1045
1156
                      MENUSTRING("Sphere",        UV_SPHERE_MAPPING) "|"
 
1157
                      MENUSTRING("LSCM",          UV_LSCM_MAPPING) "|"
1046
1158
                      MENUSTRING("Bounds to 1/8", UV_BOUNDS8_MAPPING) "|"
1047
1159
                      MENUSTRING("Bounds to 1/4", UV_BOUNDS4_MAPPING) "|"
1048
1160
                      MENUSTRING("Bounds to 1/2", UV_BOUNDS2_MAPPING) "|"
1079
1191
                calculate_uv_map(B_UVAUTO_STD1); break;
1080
1192
        case UV_WINDOW_MAPPING:
1081
1193
                calculate_uv_map(B_UVAUTO_WINDOW); break;
 
1194
        case UV_LSCM_MAPPING:
 
1195
                unwrap_lscm(); break;
1082
1196
        }
1083
1197
}
1084
1198
 
1088
1202
        Mesh *me = 0;
1089
1203
        
1090
1204
        scrarea_queue_headredraw(curarea);
1091
 
 
 
1205
        if(ob->id.lib) return;
 
1206
        
1092
1207
        if(G.f & G_FACESELECT) G.f &= ~G_FACESELECT;
1093
1208
        else {
1094
1209
                if (ob && ob->type == OB_MESH) G.f |= G_FACESELECT;
1104
1219
 
1105
1220
        if(G.f & G_FACESELECT) {
1106
1221
                setcursor_space(SPACE_VIEW3D, CURSOR_FACESEL);
1107
 
                if(me) set_lasttface();
 
1222
                if(me) {
 
1223
                        set_lasttface();
 
1224
                        set_seamtface(); /* set TF_SEAM flags in tface */
 
1225
                }
 
1226
                BIF_undo_push("Set UV Faceselect");
1108
1227
        }
1109
1228
        else if((G.f & (G_WEIGHTPAINT|G_VERTEXPAINT|G_TEXTUREPAINT))==0) {
1110
1229
                if(me) reveal_tface();
1111
1230
                setcursor_space(SPACE_VIEW3D, CURSOR_STD);
1112
1231
                makeDispList(ob);
 
1232
                BIF_undo_push("End UV Faceselect");
1113
1233
        }
1114
1234
        countall();
1115
1235
}
1126
1246
 * @param       org             origin of the view ray.
1127
1247
 * @param       dir             direction of the view ray.
1128
1248
 */
1129
 
void get_pick_ray(short x, short y, float org[3], float dir[3])
 
1249
static void get_pick_ray(short x, short y, float org[3], float dir[3])
1130
1250
{
1131
1251
        double mvmatrix[16];
1132
1252
        double projmatrix[16];
1162
1282
}
1163
1283
 
1164
1284
 
1165
 
int triangle_ray_intersect(float tv0[3], float tv1[3], float tv2[3], float org[3], float dir[3], float uv[2])
 
1285
static int triangle_ray_intersect(float tv0[3], float tv1[3], float tv2[3], float org[3], float dir[3], float uv[2])
1166
1286
{
1167
1287
        float v1v0[3];
1168
1288
        float v2v0[3];
1255
1375
 * @param       v4              vertex 4 coordinates.
1256
1376
 * @return      number of vertices of this face
1257
1377
 */
1258
 
int face_get_vertex_coordinates(Mesh* mesh, TFace* face, float v1[3], float v2[3], float v3[3], float v4[3])
 
1378
static int face_get_vertex_coordinates(Mesh* mesh, TFace* face, float v1[3], float v2[3], float v3[3], float v4[3])
1259
1379
{
1260
1380
        int num_vertices;
1261
1381
        MVert *mv;
1288
1408
 * @param       u               (u,v) coordinate.
1289
1409
 * @param       v               (u,v) coordinate.
1290
1410
 */
1291
 
void face_get_uv(TFace* face, int v1, int v2, int v3, float a, float b, float* u, float* v)
 
1411
static void face_get_uv(TFace* face, int v1, int v2, int v3, float a, float b, float* u, float* v)
1292
1412
{
1293
1413
        float uv01[2], uv21[2];
1294
1414
 
1331
1451
 *                      0 == no intersection, (u,v) invalid
1332
1452
 *                      1 == intersection, (u,v) valid
1333
1453
 */
1334
 
int face_pick_uv(Object* object, Mesh* mesh, TFace* face, short x, short y, float* u, float* v)
 
1454
static int face_pick_uv(Object* object, Mesh* mesh, TFace* face, short x, short y, float* u, float* v)
1335
1455
{
1336
1456
        float org[3], dir[3];
1337
1457
        float ab[2];
1384
1504
        Image *img=NULL, *img_old = NULL;
1385
1505
        IMG_BrushPtr brush;
1386
1506
        IMG_CanvasPtr canvas = 0;
1387
 
        int rowBytes, face_index;
 
1507
        unsigned int rowBytes, face_index;
1388
1508
        char *warn_packed_file = 0;
1389
1509
        float uv[2], uv_old[2];
1390
1510
        extern VPaint Gvp;
 
1511
        short mousebut;
1391
1512
 
1392
1513
        ob = OBACT;
1393
1514
        if (!ob) {
1394
1515
                error("No active object"); return;
1395
1516
        }
1396
1517
        if (!(ob->lay & G.vd->lay)) {
1397
 
                error("Active object not in this layer"); return;
 
1518
                error("The active object is not in this layer"); return;
1398
1519
        }
1399
1520
        me = get_mesh(ob);
1400
1521
        if (!me) {
1401
 
                error("Active object does not have a mesh"); return;
 
1522
                error("The active object does not have a mesh obData"); return;
1402
1523
        }
1403
1524
 
1404
1525
        brush = IMG_BrushCreate(Gvp.size, Gvp.size, Gvp.r, Gvp.g, Gvp.b, Gvp.a);
1405
1526
        if (!brush) {
1406
 
                error("Can not create brush"); return;
 
1527
                error("Can't create brush"); return;
1407
1528
        }
1408
1529
 
 
1530
        if (U.flag & USER_LMOUSESELECT) mousebut = R_MOUSE;
 
1531
        else mousebut = L_MOUSE;
 
1532
 
1409
1533
        persp(PERSP_VIEW);
1410
1534
 
1411
1535
        getmouseco_areawin(xy_old);
1412
 
        while (get_mbut() & L_MOUSE) {
 
1536
        while (get_mbut() & mousebut) {
1413
1537
                getmouseco_areawin(xy);
1414
1538
                /* Check if cursor has moved */
1415
1539
                if ((xy[0] != xy_old[0]) || (xy[1] != xy_old[1])) {
1416
1540
 
1417
1541
                        /* Get face to draw on */
1418
 
                        face_index = face_pick(me, xy[0], xy[1]);
1419
 
                        if (face_index == -1) face = NULL;
 
1542
                        if (!face_pick(me, xy[0], xy[1], &face_index)) face = NULL;
1420
1543
                        else face = (((TFace*)me->tface)+face_index);
1421
1544
 
1422
1545
                        /* Check if this is another face. */
1516
1639
        }
1517
1640
 
1518
1641
        if (warn_packed_file) {
1519
 
                error("Painting in packed images not supported: %s", warn_packed_file);
 
1642
                error("Painting in packed images is not supported: %s", warn_packed_file);
1520
1643
        }
1521
1644
 
1522
1645
        persp(PERSP_WIN);
1523
1646
 
 
1647
        BIF_undo_push("UV face draw");
1524
1648
        allqueue(REDRAWVIEW3D, 0);
1525
1649
        allqueue(REDRAWIMAGE, 0);
1526
1650
        allqueue(REDRAWHEADERS, 0);
1543
1667
        
1544
1668
        ob = OBACT;
1545
1669
        if (!(ob->lay & G.vd->lay)) {
1546
 
                error("Active object not in this layer!");
 
1670
                error("The active object is not in this layer");
1547
1671
                return;
1548
1672
        }
1549
1673
        me = get_mesh(ob);
1565
1689
        }               
1566
1690
        
1567
1691
        if(!foundtex) {
1568
 
                error("No active face or active face has no UV-texture");
 
1692
                error("No active face, or active face has no UV texture");
1569
1693
                return;
1570
1694
        }
1571
1695
 
1584
1708
                tface++;
1585
1709
        }
1586
1710
        
1587
 
 
1588
 
        
1589
1711
        /* image window redraw */
 
1712
        BIF_undo_push("Get same UV");
1590
1713
        allqueue(REDRAWIMAGE, 0);
1591
1714
        allqueue(REDRAWVIEW3D, 0);
1592
1715
}