From 2d87c36efa87db033b9393e42df764d68bc1a812 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 3 Dec 2006 19:38:32 +0000 Subject: [PATCH] Copy vcols wasnt working me->mcol[a] needs to be me->mcol[a*4] --- source/blender/src/buttons_editing.c | 2 +- source/blender/src/editface.c | 6 +++--- source/blender/src/editobject.c | 4 ++-- source/blender/src/header_view3d.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 9f6ea8ec2a3..35bdfd84fa4 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -4252,7 +4252,7 @@ void do_fpaintbuts(unsigned short event) else tf->mode &= ~TF_TILES; } else if(event==B_COPY_TF_COL && activemcol) - memcpy(&me->mcol[a], activemcol, sizeof(MCol)*4); + memcpy(&me->mcol[a*4], activemcol, sizeof(MCol)*4); } } diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c index 0d15318b094..fa40d210303 100644 --- a/source/blender/src/editface.c +++ b/source/blender/src/editface.c @@ -584,21 +584,21 @@ MTFace *get_active_tface(MCol **mcol) for(a=0, tf=me->mtface; a < me->totface; a++, tf++) { if(tf->flag & TF_ACTIVE) { - if(mcol) *mcol = (me->mcol)? &me->mcol[a]: NULL; + if(mcol) *mcol = (me->mcol)? &me->mcol[a*4]: NULL; return tf; } } for(a=0, tf=me->mtface; a < me->totface; a++, tf++) { if(tf->flag & TF_SELECT) { - if(mcol) *mcol = (me->mcol)? &me->mcol[a]: NULL; + if(mcol) *mcol = (me->mcol)? &me->mcol[a*4]: NULL; return tf; } } for(a=0, tf=me->mtface; a < me->totface; a++, tf++) { if((tf->flag & TF_HIDE)==0) { - if(mcol) *mcol = (me->mcol)? &me->mcol[a]: NULL; + if(mcol) *mcol = (me->mcol)? &me->mcol[a*4]: NULL; return tf; } } diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index a8810e5178f..eef50449b8a 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -3270,13 +3270,13 @@ void copy_attr_tface(short event) case 1: tface->tpage = activetf->tpage; tface->tile= activetf->tile; - tface->mode = activetf->mode & TF_TEX; + tface->mode |= TF_TEX; break; case 2: memcpy(tface->uv, activetf->uv, sizeof(tface->uv)); break; case 3: if(activemcol) - memcpy(&me->mcol[a], activemcol, sizeof(MCol)*3); break; + memcpy(&me->mcol[a*4], activemcol, sizeof(MCol)*4); break; case 4: tface->mode = activetf->mode; break; case 5: diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 957aaa0a60e..a8c9b9ba662 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -4220,7 +4220,7 @@ static void do_view3d_faceselmenu(void *arg, int event) } else if(event==2 && activemcol) - memcpy(&me->mcol[a], activemcol, sizeof(MCol)*4); + memcpy(&me->mcol[a*4], activemcol, sizeof(MCol)*4); } }