﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3AKoilz%2F2.56_mess_about_uv_editor_mesh_draw_code</id>
	<title>利用者:Koilz/2.56 mess about uv editor mesh draw code - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3AKoilz%2F2.56_mess_about_uv_editor_mesh_draw_code"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Koilz/2.56_mess_about_uv_editor_mesh_draw_code&amp;action=history"/>
	<updated>2026-07-04T21:25:30Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Koilz/2.56_mess_about_uv_editor_mesh_draw_code&amp;diff=140549&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Koilz/2.56_mess_about_uv_editor_mesh_draw_code&amp;diff=140549&amp;oldid=prev"/>
		<updated>2018-06-28T20:53:20Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 20:53時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Koilz/2.56_mess_about_uv_editor_mesh_draw_code&amp;diff=140548&amp;oldid=prev</id>
		<title>wiki&gt;Koilz: Created page with &quot; These are just notes, some examples of how things work. I want to mess about with the GUI, ive picked the UV/Image Editor because its basic, kinda.  &quot;UV.PNG&quot;  The root C source ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Koilz/2.56_mess_about_uv_editor_mesh_draw_code&amp;diff=140548&amp;oldid=prev"/>
		<updated>2013-02-22T16:38:01Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; These are just notes, some examples of how things work. I want to mess about with the GUI, ive picked the UV/Image Editor because its basic, kinda.  &amp;quot;UV.PNG&amp;quot;  The root C source ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt; These are just notes, some examples of how things work.&lt;br /&gt;
I want to mess about with the GUI, ive picked the UV/Image Editor because its basic, kinda.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;UV.PNG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The root C source code for most of this is in &amp;quot;source\blender\editors\space_image\&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The root source file is space_image.c.&lt;br /&gt;
&lt;br /&gt;
Open it up, scroll to the bottom, you will probably find the setup function.&lt;br /&gt;
 void ED_spacetype_image(void){&lt;br /&gt;
 	..&lt;br /&gt;
 }&lt;br /&gt;
This code sets the callback functions for each region for the UV editor.&lt;br /&gt;
 Header&lt;br /&gt;
 Main Window&lt;br /&gt;
 Buttons&lt;br /&gt;
 Scope&lt;br /&gt;
 Properties&lt;br /&gt;
When they are set, stacked to list, registered to the spacetype:&lt;br /&gt;
 	/* allocate ARegionType */&lt;br /&gt;
 	art=MEM_callocN(sizeof(ARegionType), &amp;quot;spacetype image region&amp;quot;);&lt;br /&gt;
 	&lt;br /&gt;
 	/* region setup */&lt;br /&gt;
 	art-&amp;gt;	regionid	= RGN_TYPE_HEADER;&lt;br /&gt;
 	art-&amp;gt;	prefsizey	= HEADERY;&lt;br /&gt;
 	art-&amp;gt;	keymapflag	= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_HEADER;&lt;br /&gt;
 	art-&amp;gt;	listener	= image_header_area_listener;&lt;br /&gt;
 	art-&amp;gt;	init		= image_header_area_init;&lt;br /&gt;
 	art-&amp;gt;	draw		= image_header_area_draw;&lt;br /&gt;
 	&lt;br /&gt;
 	/* stack into list */&lt;br /&gt;
 	BLI_addhead(&amp;amp;st-&amp;gt;regiontypes, art);&lt;br /&gt;
 	&lt;br /&gt;
 	/* register spacetype */&lt;br /&gt;
 	BKE_spacetype_register(st);&lt;br /&gt;
Blender will process the regions via the list.&lt;br /&gt;
&lt;br /&gt;
Scroll up and you will find some code for the UV editor, callbacks, operators, register stuff.&lt;br /&gt;
&lt;br /&gt;
..&lt;br /&gt;
&lt;br /&gt;
Lets mess about with draw code, Properties region, Display panel buttons, [Outline][Dash][Black][White].&lt;br /&gt;
&lt;br /&gt;
Display.PNG&lt;br /&gt;
&lt;br /&gt;
This draws the uv mesh in different styles based on the active button.&lt;br /&gt;
&lt;br /&gt;
The draw code for the uv mesh is in &amp;quot;source\blender\editors\uvedit\uvedit_draw.c&amp;quot;.&lt;br /&gt;
 static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit){&lt;br /&gt;
 	..&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Look for the code that draws the UV mesh edges/lines based on the active button.&lt;br /&gt;
2.56 looks like this:&lt;br /&gt;
 	/* 4. draw edges */&lt;br /&gt;
 &lt;br /&gt;
 	if(sima-&amp;gt;flag &amp;amp; SI_SMOOTH_UV) {&lt;br /&gt;
 		glEnable(GL_LINE_SMOOTH);&lt;br /&gt;
 		glEnable(GL_BLEND);&lt;br /&gt;
 		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);&lt;br /&gt;
 	}&lt;br /&gt;
 	&lt;br /&gt;
 	switch(sima-&amp;gt;dt_uv) {&lt;br /&gt;
  		case SI_UVDT_DASH:&lt;br /&gt;
 			..&lt;br /&gt;
 		case SI_UVDT_BLACK: /* black/white */&lt;br /&gt;
 		case SI_UVDT_WHITE:&lt;br /&gt;
 &lt;br /&gt;
 			// set gl color, black or white&lt;br /&gt;
 &lt;br /&gt;
 			if(sima-&amp;gt;dt_uv==SI_UVDT_WHITE) glColor3f(1.0f, 1.0f, 1.0f);&lt;br /&gt;
 			else glColor3f(0.0f, 0.0f, 0.0f);&lt;br /&gt;
 &lt;br /&gt;
 			// loop list, uv faces&lt;br /&gt;
 &lt;br /&gt;
 			for(efa= em-&amp;gt;faces.first; efa; efa= efa-&amp;gt;next) {&lt;br /&gt;
 				tf= (MTFace *)efa-&amp;gt;tmp.p; /* visible faces cached */&lt;br /&gt;
 &lt;br /&gt;
 				if(tf) {&lt;br /&gt;
 &lt;br /&gt;
 					// gl line loop, point to point, quad or triangle, black or white.&lt;br /&gt;
 &lt;br /&gt;
 					glBegin(GL_LINE_LOOP);&lt;br /&gt;
 						glVertex2fv(tf-&amp;gt;uv[0]);&lt;br /&gt;
 						glVertex2fv(tf-&amp;gt;uv[1]);&lt;br /&gt;
 						glVertex2fv(tf-&amp;gt;uv[2]);&lt;br /&gt;
 						if(efa-&amp;gt;v4) glVertex2fv(tf-&amp;gt;uv[3]);&lt;br /&gt;
 					glEnd();&lt;br /&gt;
 				}&lt;br /&gt;
 			}&lt;br /&gt;
 			break;&lt;br /&gt;
 		case SI_UVDT_OUTLINE:&lt;br /&gt;
 			..&lt;br /&gt;
 	}&lt;br /&gt;
&lt;br /&gt;
These keywords were passed to the draw function.&lt;br /&gt;
 SpaceImage *sima	// data space image&lt;br /&gt;
 Scene *scene		// data scene&lt;br /&gt;
 Object *obedit		// data object&lt;br /&gt;
&lt;br /&gt;
 sima-&amp;gt;dt_uv		// draw type, Outline, Dash, Black, White&lt;/div&gt;</summary>
		<author><name>wiki&gt;Koilz</name></author>
		
	</entry>
</feed>