[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12392] branches/cloth/blender/source/ blender: svn merge -r 12382:12391 https://svn.blender.org/svnroot/ bf-blender/trunk/blender

Daniel Genrich daniel.genrich at gmx.net
Thu Oct 25 18:42:17 CEST 2007


Revision: 12392
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12392
Author:   genscher
Date:     2007-10-25 18:42:17 +0200 (Thu, 25 Oct 2007)

Log Message:
-----------
svn merge -r 12382:12391 https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--------------
    branches/cloth/blender/source/blender/blenkernel/BKE_global.h
    branches/cloth/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c
    branches/cloth/blender/source/blender/include/mydevice.h
    branches/cloth/blender/source/blender/makesdna/DNA_object_types.h
    branches/cloth/blender/source/blender/makesdna/DNA_scene_types.h
    branches/cloth/blender/source/blender/src/buttons_editing.c
    branches/cloth/blender/source/blender/src/drawimage.c
    branches/cloth/blender/source/blender/src/drawmesh.c
    branches/cloth/blender/source/blender/src/drawobject.c
    branches/cloth/blender/source/blender/src/editmesh_mods.c
    branches/cloth/blender/source/blender/src/editview.c
    branches/cloth/blender/source/blender/src/space.c

Modified: branches/cloth/blender/source/blender/blenkernel/BKE_global.h
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/BKE_global.h	2007-10-25 15:23:52 UTC (rev 12391)
+++ branches/cloth/blender/source/blender/blenkernel/BKE_global.h	2007-10-25 16:42:17 UTC (rev 12392)
@@ -175,6 +175,7 @@
 #define G_DRAWCREASES	(1 << 19)
 #define G_DRAWSEAMS     (1 << 20)
 #define G_HIDDENEDGES   (1 << 21)
+#define G_HIDDENHANDLES (1 << 22) /* used for curves only */
 
 
 /* Measurement info Drawing */

Modified: branches/cloth/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c	2007-10-25 15:23:52 UTC (rev 12391)
+++ branches/cloth/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c	2007-10-25 16:42:17 UTC (rev 12392)
@@ -208,6 +208,9 @@
 
 void IK_SolverAddGoal(IK_Solver *solver, IK_Segment *tip, float goal[3], float weight) {}
 void IK_SolverAddGoalOrientation(IK_Solver *solver, IK_Segment *tip, float goal[][3], float weight) {}
+void IK_SolverSetPoleVectorConstraint(IK_Solver *solver, IK_Segment *tip, float goal[3], float polegoal[3], float poleangle, int getangle) {}
+float IK_SolverGetPoleAngle(IK_Solver *solver) {}
+
 int IK_Solve(IK_Solver *solver, float tolerance, int max_iterations) { return 0; }
 
 /* exotic.c */

Modified: branches/cloth/blender/source/blender/include/mydevice.h
===================================================================
--- branches/cloth/blender/source/blender/include/mydevice.h	2007-10-25 15:23:52 UTC (rev 12391)
+++ branches/cloth/blender/source/blender/include/mydevice.h	2007-10-25 16:42:17 UTC (rev 12392)
@@ -254,7 +254,7 @@
 #define REDRAWNODE			0x4038
 #define RECALC_COMPOSITE	0x4039
 #define REDRAWMARKER		0x4040 /* all views that display markers */
+#define REDRAWVIEW3D_IMAGE	0x4041
 
-
 #endif	/* !__MYDEVICE_H__ */
 

Modified: branches/cloth/blender/source/blender/makesdna/DNA_object_types.h
===================================================================
--- branches/cloth/blender/source/blender/makesdna/DNA_object_types.h	2007-10-25 15:23:52 UTC (rev 12391)
+++ branches/cloth/blender/source/blender/makesdna/DNA_object_types.h	2007-10-25 16:42:17 UTC (rev 12392)
@@ -308,6 +308,9 @@
 #define OB_SHADED		4
 #define OB_TEXTURE		5
 
+/* this condition has been made more complex since editmode can draw textures */
+#define CHECK_OB_DRAWTEXTURE(vd, dt)	((vd->drawtype==OB_TEXTURE && dt>OB_SOLID) || (vd->drawtype==OB_SOLID && vd->flag2 & V3D_SOLID_TEX))
+
 /* dtx: flags, char! */
 #define OB_AXIS			2
 #define OB_TEXSPACE		4

Modified: branches/cloth/blender/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/cloth/blender/source/blender/makesdna/DNA_scene_types.h	2007-10-25 15:23:52 UTC (rev 12391)
+++ branches/cloth/blender/source/blender/makesdna/DNA_scene_types.h	2007-10-25 16:42:17 UTC (rev 12392)
@@ -427,7 +427,7 @@
 	
 	/* editmode stuff */
 	float editbutsize;                      /* size of normals */
-	short selectmode;
+	short selectmode;						/* for mesh only! */
 	short proportional, prop_mode;
 	short automerge, pad5, pad6, pad7;
 	
@@ -603,8 +603,6 @@
 #define SCE_SELECT_EDGE		2
 #define SCE_SELECT_FACE		4
 
-#define SCE_SELECT_CU_HANDLES_HIDE 8 /* for curve, when flagged hide handles */ 
-
 /* sce->recalc (now in use by previewrender) */
 #define SCE_PRV_CHANGED		1
 

Modified: branches/cloth/blender/source/blender/src/buttons_editing.c
===================================================================
--- branches/cloth/blender/source/blender/src/buttons_editing.c	2007-10-25 15:23:52 UTC (rev 12391)
+++ branches/cloth/blender/source/blender/src/buttons_editing.c	2007-10-25 16:42:17 UTC (rev 12392)
@@ -2960,7 +2960,7 @@
 
 	uiBlockBeginAlign(block);
 	uiDefButF(block, NUM,	REDRAWVIEW3D, "NSize:",	400, 60, 150, 19, &G.scene->editbutsize, 0.001, 1.0, 10, 0, "Normal size for drawing");
-	uiDefButBitI(block, TOGN, SCE_SELECT_CU_HANDLES_HIDE, REDRAWVIEW3D, "Draw Handles", 	400, 40, 150, 19, &G.scene->selectmode, 0, 0, 0, 0, "Draw curve handles in 3D view");
+	uiDefButBitI(block, TOGN, G_HIDDENHANDLES, REDRAWVIEW3D, "Draw Handles", 	400, 40, 150, 19, &G.f, 0, 0, 0, 0, "Draw curve handles in 3D view");
 	uiBlockEndAlign(block);
 	
 	if(G.obedit) {
@@ -4397,7 +4397,7 @@
 	uiBlockEndAlign(block);
 	
 	uiBlockBeginAlign(block);
-	uiDefButBitI(block, TOG, G_DRAWFACES, REDRAWVIEW3D|REDRAWIMAGE, "Draw Faces",		955,88,150,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
+	uiDefButBitI(block, TOG, G_DRAWFACES, REDRAWVIEW3D_IMAGE, "Draw Faces",		955,88,150,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades in the 3d view and UV editor");
 	uiDefButBitI(block, TOG, G_DRAWEDGES, REDRAWVIEW3D, "Draw Edges", 	955,66,150,19, &G.f, 0, 0, 0, 0, "Displays selected edges using hilights");
 	uiDefButBitI(block, TOG, G_DRAWCREASES, REDRAWVIEW3D, "Draw Creases",	955,44,150,19, &G.f, 0, 0, 0, 0, "Displays creases created for subsurf weighting");
 	uiDefButBitI(block, TOG, G_DRAWSEAMS, REDRAWVIEW3D, "Draw Seams",	955,22,150,19, &G.f, 0, 0, 0, 0, "Displays UV unwrapping seams");
@@ -5337,9 +5337,9 @@
 
 		uiBlockBeginAlign(block);
 		uiBlockSetCol(block, TH_BUT_SETTING1);
-		uiDefButC(block, ROW, REDRAWVIEW3D, "Opaque",	600,80,60,19, &tf->transp, 2.0, 0.0, 0, 0, "Render color of textured face as color");
-		uiDefButC(block, ROW, REDRAWVIEW3D, "Add",		660,80,60,19, &tf->transp, 2.0, 1.0, 0, 0, "Render face transparent and add color of face");
-		uiDefButC(block, ROW, REDRAWVIEW3D, "Alpha",	720,80,60,19, &tf->transp, 2.0, 2.0, 0, 0, "Render polygon transparent, depending on alpha channel of the texture");
+		uiDefButC(block, ROW, REDRAWVIEW3D, "Opaque",	600,80,60,19, &tf->transp, 2.0, (float)TF_SOLID,0, 0, "Render color of textured face as color");
+		uiDefButC(block, ROW, REDRAWVIEW3D, "Add",		660,80,60,19, &tf->transp, 2.0, (float)TF_ADD,	0, 0, "Render face transparent and add color of face");
+		uiDefButC(block, ROW, REDRAWVIEW3D, "Alpha",	720,80,60,19, &tf->transp, 2.0, (float)TF_ALPHA,0, 0, "Render polygon transparent, depending on alpha channel of the texture");
 	}
 }
 

Modified: branches/cloth/blender/source/blender/src/drawimage.c
===================================================================
--- branches/cloth/blender/source/blender/src/drawimage.c	2007-10-25 15:23:52 UTC (rev 12391)
+++ branches/cloth/blender/source/blender/src/drawimage.c	2007-10-25 16:42:17 UTC (rev 12392)
@@ -96,6 +96,7 @@
 #include "BIF_screen.h"
 #include "BIF_toolbox.h"
 #include "BIF_transform.h"
+#include "BIF_editmesh.h"
 
 #include "BSE_drawipo.h"
 #include "BSE_drawview.h"
@@ -243,31 +244,33 @@
 void what_image(SpaceImage *sima)
 {
 	MTFace *activetf;
-		
+	
 	if(		(sima->mode!=SI_TEXTURE) ||
 			(sima->image && sima->image->source==IMA_SRC_VIEWER) ||
-			(G.obedit != OBACT)
+			(G.obedit != OBACT) ||
+			(sima->pin)
 	) {
 		return;
 	}
 	
-	/* viewer overrides faceselect */
-	if (!sima->pin)
+	/* viewer overrides uv editmode */
+	if (EM_texFaceCheck()) {
 		sima->image= NULL;
-	
-	activetf = get_active_mtface(NULL, NULL, 1); /* partially selected face is ok */
-	
-	if(activetf && activetf->mode & TF_TEX) {
-		if (!sima->pin)
-			sima->image= activetf->tpage;
 		
-		if(sima->flag & SI_EDITTILE);
-		else sima->curtile= activetf->tile;
+		activetf = get_active_mtface(NULL, NULL, 1); /* partially selected face is ok */
 		
-		if(sima->image) {
-			if(activetf->mode & TF_TILES)
-				sima->image->tpageflag |= IMA_TILES;
-			else sima->image->tpageflag &= ~IMA_TILES;
+		if(activetf && activetf->mode & TF_TEX) {
+			if (!sima->pin)
+				sima->image= activetf->tpage;
+			
+			if(sima->flag & SI_EDITTILE);
+			else sima->curtile= activetf->tile;
+			
+			if(sima->image) {
+				if(activetf->mode & TF_TILES)
+					sima->image->tpageflag |= IMA_TILES;
+				else sima->image->tpageflag &= ~IMA_TILES;
+			}
 		}
 	}
 }
@@ -293,32 +296,45 @@
 	MTFace *tface;
 	EditMesh *em = G.editMesh;
 	EditFace *efa;
-
-	if(image==NULL)
+	ImBuf *ibuf = NULL;
+	short change = 0;
+	
+	if(image==NULL) {
 		sima->flag &= ~SI_DRAWTOOL;
+	} else {
+		ibuf = BKE_image_get_ibuf(image, NULL);
+	}
 	
-	if(sima->mode!=SI_TEXTURE || !EM_texFaceCheck())
+	if(sima->mode!=SI_TEXTURE)
 		return;
-		
+	
 	/* skip assigning these procedural images... */
-	if(image && (image->type==IMA_TYPE_R_RESULT || image->type==IMA_TYPE_COMPOSITE))
+	if(image && (image->type==IMA_TYPE_R_RESULT || image->type==IMA_TYPE_COMPOSITE)) {;
 		return;
-
-	for (efa= em->faces.first; efa; efa= efa->next) {
-		tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-		if (efa->h==0 && efa->f & SELECT) {
-			if (image) {
-				tface->tpage= image;
-				tface->mode |= TF_TEX;
-				
-				if(image->tpageflag & IMA_TILES) tface->mode |= TF_TILES;
-				else tface->mode &= ~TF_TILES;
-				
-				if(image->id.us==0) id_us_plus(&image->id);
-				else id_lib_extern(&image->id);
-			} else {
-				tface->tpage= NULL;
-				tface->mode &= ~TF_TEX;
+	} else if (EM_texFaceCheck()) {
+		for (efa= em->faces.first; efa; efa= efa->next) {
+			tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+			if (efa->h==0 && efa->f & SELECT) {
+				if (image) {
+					tface->tpage= image;
+					tface->mode |= TF_TEX;
+					
+					if(image->tpageflag & IMA_TILES) tface->mode |= TF_TILES;
+					else tface->mode &= ~TF_TILES;
+					
+					if(image->id.us==0) id_us_plus(&image->id);
+					else id_lib_extern(&image->id);
+					
+					if (tface->transp==TF_ADD) {} /* they obviously know what they are doing! - leave as is */
+					else if (ibuf && ibuf->depth == 32)	tface->transp = TF_ALPHA;
+					else								tface->transp = TF_SOLID;
+					
+				} else {
+					tface->tpage= NULL;
+					tface->mode &= ~TF_TEX;
+					tface->transp = TF_SOLID;
+				}
+				change = 1;
 			}
 		}
 	}
@@ -326,7 +342,9 @@
 	 * to check if the face is displayed in UV-localview */
 	sima->image = image;
 	
-	object_uvs_changed(OBACT);
+	if (change)
+		object_uvs_changed(OBACT);
+	
 	allqueue(REDRAWBUTSEDIT, 0);
 }
 /*
@@ -1688,44 +1706,28 @@
 
 static void sima_draw_alpha_backdrop(SpaceImage *sima, float x1, float y1, float xsize, float ysize)
 {
-	float tile= sima->zoom*15.0f;
-	float x, y, maxx, maxy;
+	GLubyte checker_stipple[32*32/8] =
+	{
+		255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list