diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-09-21 18:34:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-09-21 18:34:29 +0400 |
commit | 641fc64eb32311b712856d64413191fb16c5972d (patch) | |
tree | 69e9f8400712d5d237a3dc62b073fc0c6245ca28 /source/blender | |
parent | 3b4d74de38d87e6db1e2bb8e7cc2d411209dfa7b (diff) |
unwrapping would crash if there was no space image
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/include/BIF_drawimage.h | 2 | ||||
-rw-r--r-- | source/blender/include/BIF_editsima.h | 18 | ||||
-rw-r--r-- | source/blender/src/drawimage.c | 2 | ||||
-rw-r--r-- | source/blender/src/unwrapper.c | 2 |
4 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/include/BIF_drawimage.h b/source/blender/include/BIF_drawimage.h index 90feb558d99..ca7a25304ab 100644 --- a/source/blender/include/BIF_drawimage.h +++ b/source/blender/include/BIF_drawimage.h @@ -43,8 +43,8 @@ struct uiBlock; void do_imagebuts(unsigned short event); void calc_image_view(struct SpaceImage *sima, char mode); void drawimagespace(struct ScrArea *sa, void *spacedata); -void draw_tfaces(void); void image_changed(struct SpaceImage *sima, struct Image *image); +void draw_uvs_sima(void); void image_set_tile(struct SpaceImage *sima, int dotile); void image_home(void); void image_viewmove(int mode); diff --git a/source/blender/include/BIF_editsima.h b/source/blender/include/BIF_editsima.h index 1df3c85d53e..d7cd5fb29b6 100644 --- a/source/blender/include/BIF_editsima.h +++ b/source/blender/include/BIF_editsima.h @@ -39,26 +39,28 @@ struct SpaceImage; #define TF_SEL_MASK(id) (TF_SEL1 << id) -/* this checks weather a face is drarn without the local image check */ +/* this checks weather a face is drarn without the local image check + * - warning - no check for G.sima->flag, use SIMA_FACEDRAW_CHECK + */ #define SIMA_FACEDRAW_CHECK_NOLOCAL(efa) \ ((G.sima->flag & SI_SYNC_UVSEL) ? (efa->h==0) : (efa->h==0 && efa->f & SELECT)) /* this check includes the local image check - (does the faces image match the space image?) */ #define SIMA_FACEDRAW_CHECK(efa, tf) \ - ((G.sima->flag & SI_LOCAL_UV) ? ((tf->tpage==G.sima->image) ? SIMA_FACEDRAW_CHECK_NOLOCAL(efa):0) : (SIMA_FACEDRAW_CHECK_NOLOCAL(efa))) + ((G.sima && G.sima->flag & SI_LOCAL_UV) ? ((tf->tpage==G.sima->image) ? SIMA_FACEDRAW_CHECK_NOLOCAL(efa):0) : (SIMA_FACEDRAW_CHECK_NOLOCAL(efa))) #define SIMA_FACESEL_CHECK(efa, tf) \ - ((G.sima->flag & SI_SYNC_UVSEL) ? (efa->f & SELECT) : (!(~tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) &&(!efa->v4 || tf->flag & TF_SEL4))) + ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? (efa->f & SELECT) : (!(~tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) &&(!efa->v4 || tf->flag & TF_SEL4))) #define SIMA_FACESEL_SET(efa, tf) \ - ((G.sima->flag & SI_SYNC_UVSEL) ? (EM_select_face(efa, 1)) : (tf->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4))) + ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? (EM_select_face(efa, 1)) : (tf->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4))) #define SIMA_FACESEL_UNSET(efa, tf) \ - ((G.sima->flag & SI_SYNC_UVSEL) ? (EM_select_face(efa, 0)) : (tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4))) + ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? (EM_select_face(efa, 0)) : (tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4))) -#define SIMA_UVSEL_CHECK(efa, tf, i) (G.sima->flag & SI_SYNC_UVSEL ? \ +#define SIMA_UVSEL_CHECK(efa, tf, i) ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? \ (G.scene->selectmode == SCE_SELECT_FACE ? efa->f & SELECT : ((*(&efa->v1 + i))->f & SELECT) ) : (tf->flag & TF_SEL_MASK(i) )) -#define SIMA_UVSEL_SET(efa, tf, i) (G.sima->flag & SI_SYNC_UVSEL ? \ +#define SIMA_UVSEL_SET(efa, tf, i) ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? \ (G.scene->selectmode == SCE_SELECT_FACE ? EM_select_face(efa, 1) : ((*(&efa->v1 + i))->f |= SELECT) ) : (tf->flag |= TF_SEL_MASK(i) )) -#define SIMA_UVSEL_UNSET(efa, tf, i) (G.sima->flag & SI_SYNC_UVSEL ? \ +#define SIMA_UVSEL_UNSET(efa, tf, i) ((G.sima && G.sima->flag & SI_SYNC_UVSEL) ? \ (G.scene->selectmode == SCE_SELECT_FACE ? EM_select_face(efa, 0) : ((*(&efa->v1 + i))->f &= ~SELECT) ) : (tf->flag &= ~TF_SEL_MASK(i) )) struct Object; diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index 8df5b43dc27..d0261ac1ad0 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -453,7 +453,7 @@ void draw_uvs_sima(void) EditMesh *em = G.editMesh; EditFace *efa; - char col1[4], col2[4], efaset = 0; + char col1[4], col2[4]; float pointsize= BIF_GetThemeValuef(TH_VERTEX_SIZE); if (!G.obedit || !CustomData_has_layer(&em->fdata, CD_MTFACE)) diff --git a/source/blender/src/unwrapper.c b/source/blender/src/unwrapper.c index 005119d448d..bca7e44ed72 100644 --- a/source/blender/src/unwrapper.c +++ b/source/blender/src/unwrapper.c @@ -299,7 +299,7 @@ void unwrap_lscm(short seamcut) return; /* select new UV's */ - if ((G.sima->flag & SI_SYNC_UVSEL)==0) { + if ((G.sima==0 || G.sima->flag & SI_SYNC_UVSEL)==0) { EditFace *efa; MTFace *tf; for(efa=em->faces.first; efa; efa=efa->next) { |