[tuhopuu-devel] little thing in uv edit

BjornMose tuhopuu-devel@blender.org
Mon, 22 Dec 2003 22:42:43 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C3C8DC.E9DC6000
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

hello all

thanks theeth for comitting
here comes the second part of
http://mitglied.lycos.de/mosebjorn/uvmapping/

it modifies the function void mouse_select_sima(void)=20
which (de)selects uv nodes in the uv image editor.

when a single node is selected with RMB and the shift key is pressed
all uv nodes sharing the vertex in the mesh are selected.
this way the faces in the uv window stay together when the selection is =
moved
and the uv map almost behaves like a mesh.

just a nice little thing to have.
bjornmose (mailto:bjornmose@gnx.net)

Index: source/blender/src/editsima.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/tuhopuu/tuhopuu2/source/blender/src/editsima.c,v
retrieving revision 1.1.1.3
diff -r1.1.1.3 editsima.c
649a650
>  int  vertexhit =3D0;
667a669
>     if(mface->v1) vertexhit =3D mface->v1;
676a679
>     if(mface->v2) vertexhit =3D mface->v2;
685a689
>     if(mface->v3) vertexhit =3D mface->v3;
695a700,701
>      vertexhit =3D mface->v4;
>     =20
708c714,717
<    for(a=3Dme->totface, tface=3D me->tface; a>0; a--, tface++) {
---
>    /* remove all tags from all other faces */
>    mface=3D me->mface;
>    tface=3D me->tface;
>    for(a=3Dme->totface; a>0; a--, tface++, mface++) {
710a720,730
>      if((G.qual & LR_CTRLKEY) && (vertexhit)){
>       /* i'd like to tag all faces sharing this vertex too */
>       if (mface->v1) {
>        if (vertexhit =3D=3D mface->v1) tface->flag |=3DTF_SEL1;}
>       if (mface->v2) {
>        if (vertexhit =3D=3D mface->v2) tface->flag |=3DTF_SEL2;}
>       if (mface->v3) {
>        if (vertexhit =3D=3D mface->v3) tface->flag |=3DTF_SEL3;}
>       if (mface->v4) {
>        if (vertexhit =3D=3D mface->v4) tface->flag |=3DTF_SEL4;}
>      }
711a732
>    =20
713d733
<   =20
717c737
< =20
---
>  =20


=20

------=_NextPart_000_0007_01C3C8DC.E9DC6000
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hello all</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks theeth for comitting<BR>here =
comes the=20
second part of<BR><A=20
href=3D"http://mitglied.lycos.de/mosebjorn/uvmapping/">http://mitglied.ly=
cos.de/mosebjorn/uvmapping/</A></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>it modifies the function void=20
mouse_select_sima(void) <BR>which (de)selects uv nodes in the uv image=20
editor.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>when a single node is selected with RMB =
and the=20
shift key is pressed<BR>all uv nodes sharing the vertex in the mesh are=20
selected.<BR>this way the faces in the uv window stay together when the=20
selection is moved<BR>and the uv map almost behaves like a =
mesh.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>just a nice little thing to =
have.<BR>bjornmose (<A=20
href=3D"mailto:bjornmose@gnx.net">mailto:bjornmose@gnx.net</A>)</FONT></D=
IV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Index:=20
source/blender/src/editsima.c<BR>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D<BR>RCS=20
file: =
/cvsroot/tuhopuu/tuhopuu2/source/blender/src/editsima.c,v<BR>retrieving=20
revision 1.1.1.3<BR>diff -r1.1.1.3 editsima.c<BR>649a650<BR>&gt; =
&nbsp;int&nbsp;=20
vertexhit =3D0;<BR>667a669<BR>&gt; =
&nbsp;&nbsp;&nbsp;&nbsp;if(mface-&gt;v1)=20
vertexhit =3D mface-&gt;v1;<BR>676a679<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;if(mface-&gt;v2) vertexhit =3D=20
mface-&gt;v2;<BR>685a689<BR>&gt; =
&nbsp;&nbsp;&nbsp;&nbsp;if(mface-&gt;v3)=20
vertexhit =3D mface-&gt;v3;<BR>695a700,701<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vertexhit =3D mface-&gt;v4;<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>708c714,717<BR>&lt;=20
&nbsp;&nbsp;&nbsp;for(a=3Dme-&gt;totface, tface=3D me-&gt;tface; a&gt;0; =
a--,=20
tface++) {<BR>---<BR>&gt; &nbsp;&nbsp;&nbsp;/* remove all tags from all =
other=20
faces */<BR>&gt; &nbsp;&nbsp;&nbsp;mface=3D me-&gt;mface;<BR>&gt;=20
&nbsp;&nbsp;&nbsp;tface=3D me-&gt;tface;<BR>&gt;=20
&nbsp;&nbsp;&nbsp;for(a=3Dme-&gt;totface; a&gt;0; a--, tface++, mface++) =

{<BR>710a720,730<BR>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if((G.qual &amp;=20
LR_CTRLKEY) &amp;&amp; (vertexhit)){<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* i'd like to tag all faces sharing =
this=20
vertex too */<BR>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if =
(mface-&gt;v1)=20
{<BR>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (vertexhit =3D=3D =

mface-&gt;v1) tface-&gt;flag |=3DTF_SEL1;}<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (mface-&gt;v2) {<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (vertexhit =3D=3D =
mface-&gt;v2)=20
tface-&gt;flag |=3DTF_SEL2;}<BR>&gt; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if=20
(mface-&gt;v3) {<BR>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if =
(vertexhit=20
=3D=3D mface-&gt;v3) tface-&gt;flag |=3DTF_SEL3;}<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (mface-&gt;v4) {<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (vertexhit =3D=3D =
mface-&gt;v4)=20
tface-&gt;flag |=3DTF_SEL4;}<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>711a732<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;<BR>713d733<BR>&lt;=20
&nbsp;&nbsp;&nbsp;<BR>717c737<BR>&lt;=20
&nbsp;<BR>---<BR>&gt;&nbsp;&nbsp;&nbsp;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR>&nbsp;</FONT></DIV></BODY></HTML>

------=_NextPart_000_0007_01C3C8DC.E9DC6000--