[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14490] branches/apricot: merge from trunk + some own stuff commented
Campbell Barton
ideasman42 at gmail.com
Sun Apr 20 20:26:13 CEST 2008
Revision: 14490
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14490
Author: campbellbarton
Date: 2008-04-20 20:26:06 +0200 (Sun, 20 Apr 2008)
Log Message:
-----------
merge from trunk + some own stuff commented
Modified Paths:
--------------
branches/apricot/intern/elbeem/intern/ntl_vector3dim.h
branches/apricot/intern/elbeem/intern/solver_util.cpp
branches/apricot/source/blender/include/BIF_toolbox.h
branches/apricot/source/blender/render/intern/source/pipeline.c
branches/apricot/source/blender/render/intern/source/rendercore.c
branches/apricot/source/blender/render/intern/source/shadeoutput.c
branches/apricot/source/blender/src/editmesh.c
branches/apricot/source/blender/src/toolbox.c
branches/apricot/source/blender/src/transform_conversions.c
branches/apricot/source/blender/src/transform_generics.c
branches/apricot/source/gameengine/GameLogic/SCA_IScene.cpp
branches/apricot/source/gameengine/GameLogic/SCA_IScene.h
branches/apricot/source/gameengine/Ketsji/KX_NearSensor.cpp
branches/apricot/source/gameengine/Ketsji/KX_NearSensor.h
branches/apricot/source/gameengine/Ketsji/KX_Scene.cpp
branches/apricot/source/gameengine/Ketsji/KX_TouchSensor.cpp
Modified: branches/apricot/intern/elbeem/intern/ntl_vector3dim.h
===================================================================
--- branches/apricot/intern/elbeem/intern/ntl_vector3dim.h 2008-04-20 18:19:15 UTC (rev 14489)
+++ branches/apricot/intern/elbeem/intern/ntl_vector3dim.h 2008-04-20 18:26:06 UTC (rev 14490)
@@ -833,7 +833,7 @@
//#define vecGfx2F(x) (x)
//#define vecD2Gfx(x) vecD2F(x)
//#define vecGfx2D(x) vecF2D(x)
-#define VECTOR_EPSILON (1.192092896e-07F)
+#define VECTOR_EPSILON (1e-5f)
#else
typedef double gfxReal;
#define GFX_REAL_MAX __DBL_MAX__
@@ -841,7 +841,7 @@
//#define vecGfx2F(x) vecF2D(x)
//#define vecD2Gfx(x) (x)
//#define vecGfx2D(x) (x)
-#define VECTOR_EPSILON (2.2204460492503131e-016)
+#define VECTOR_EPSILON (1e-10)
#endif
/* fixed double prec. type, for epxlicitly double values */
Modified: branches/apricot/intern/elbeem/intern/solver_util.cpp
===================================================================
--- branches/apricot/intern/elbeem/intern/solver_util.cpp 2008-04-20 18:19:15 UTC (rev 14489)
+++ branches/apricot/intern/elbeem/intern/solver_util.cpp 2008-04-20 18:26:06 UTC (rev 14490)
@@ -40,7 +40,7 @@
int mainGravDir=6; // if normalizing fails, we asume z-direction gravity
LbmFloat mainGravLen = 0.;
FORDF1{
- LbmFloat thisGravLen = dot(LbmVec(dfVecX[l],dfVecY[l],dfVecZ[l]), getNormalized(mLevel[mMaxRefine].gravity) );
+ LbmFloat thisGravLen = dot(LbmVec(dfVecX[l],dfVecY[l],dfVecZ[l]), mLevel[mMaxRefine].gravity );
if(thisGravLen>mainGravLen) {
mainGravLen = thisGravLen;
mainGravDir = l;
Modified: branches/apricot/source/blender/include/BIF_toolbox.h
===================================================================
--- branches/apricot/source/blender/include/BIF_toolbox.h 2008-04-20 18:19:15 UTC (rev 14489)
+++ branches/apricot/source/blender/include/BIF_toolbox.h 2008-04-20 18:26:06 UTC (rev 14490)
@@ -47,7 +47,7 @@
short button (short *var, short min, short max, char *str);
short fbutton (float *var, float min, float max, float a1, float a2, char *str);
-short sbutton (char *var, float min, float max, char *str); /* __NLA */
+short sbutton (char *var, short min, short max, char *str); /* __NLA */
int movetolayer_buts (unsigned int *lay, char *title);
int movetolayer_short_buts (short *lay, char *title);
Modified: branches/apricot/source/blender/render/intern/source/pipeline.c
===================================================================
--- branches/apricot/source/blender/render/intern/source/pipeline.c 2008-04-20 18:19:15 UTC (rev 14489)
+++ branches/apricot/source/blender/render/intern/source/pipeline.c 2008-04-20 18:26:06 UTC (rev 14490)
@@ -870,7 +870,7 @@
printf("read exr tmp file: %s\n", str);
- if(rectx!=re->result->rectx || recty!=re->result->recty) {
+ if(re->result == NULL || rectx!=re->result->rectx || recty!=re->result->recty) {
printf("error in reading render result\n");
}
else {
Modified: branches/apricot/source/blender/render/intern/source/rendercore.c
===================================================================
--- branches/apricot/source/blender/render/intern/source/rendercore.c 2008-04-20 18:19:15 UTC (rev 14489)
+++ branches/apricot/source/blender/render/intern/source/rendercore.c 2008-04-20 18:26:06 UTC (rev 14490)
@@ -1447,6 +1447,8 @@
rl= rr->layers.first;
ssamp.shi[0].passflag |= SCE_PASS_RGBA|SCE_PASS_COMBINED;
ssamp.shi[0].combinedflag &= ~(SCE_PASS_SPEC);
+ ssamp.shi[0].mat_override= NULL;
+ ssamp.shi[0].light_override= NULL;
lay= ssamp.shi[0].lay;
/* create the pixelstrs to be used later */
Modified: branches/apricot/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- branches/apricot/source/blender/render/intern/source/shadeoutput.c 2008-04-20 18:19:15 UTC (rev 14489)
+++ branches/apricot/source/blender/render/intern/source/shadeoutput.c 2008-04-20 18:26:06 UTC (rev 14490)
@@ -1303,7 +1303,7 @@
}
/* 'is' is diffuse */
- if((ma->shade_flag & MA_CUBIC) && is>0.0f)
+ if((ma->shade_flag & MA_CUBIC) && is>0.0f && is<1.0f)
is= 3.0*is*is - 2.0*is*is*is; // nicer termination of shades
i= is*phongcorr;
Modified: branches/apricot/source/blender/src/editmesh.c
===================================================================
--- branches/apricot/source/blender/src/editmesh.c 2008-04-20 18:19:15 UTC (rev 14489)
+++ branches/apricot/source/blender/src/editmesh.c 2008-04-20 18:26:06 UTC (rev 14490)
@@ -1010,20 +1010,20 @@
/* select and hide face flag */
if(mface->flag & ME_HIDE) {
efa->h= 1;
- /* dont allow hidden and selected */
- } else if(mface->flag & ME_FACE_SEL) {
- efa->f |= SELECT;
-
- /* only allow selected face to be active */
+ } else {
if (a==me->act_face) {
EM_set_actFace(efa);
}
- if(FACESEL_PAINT_TEST) {
- EM_select_face(efa, 1); /* flush down */
+ /* dont allow hidden and selected */
+ if(mface->flag & ME_FACE_SEL) {
+ efa->f |= SELECT;
+
+ if(FACESEL_PAINT_TEST) {
+ EM_select_face(efa, 1); /* flush down */
+ }
}
}
-
}
}
}
Modified: branches/apricot/source/blender/src/toolbox.c
===================================================================
--- branches/apricot/source/blender/src/toolbox.c 2008-04-20 18:19:15 UTC (rev 14489)
+++ branches/apricot/source/blender/src/toolbox.c 2008-04-20 18:26:06 UTC (rev 14490)
@@ -291,13 +291,14 @@
return 0;
}
-short sbutton(char *var, float min, float max, char *str)
+short sbutton(char *var, short min, short max, char *str)
{
uiBlock *block;
ListBase listb={0, 0};
short x1,y1;
short mval[2], ret=0;
-
+ char *editvar = NULL; /* dont edit the original text, incase we cancel the popup */
+
if(min>max) min= max;
getmouseco_sc(mval);
@@ -313,7 +314,10 @@
x1=mval[0]-250;
y1=mval[1]-20;
- uiDefButC(block, TEX, 32766, str, x1+5,y1+10,225,20, var,(float)min,(float)max, 0, 0, "");
+ editvar = MEM_callocN(max, "sbutton");
+ BLI_strncpy(editvar, var, max);
+
+ uiDefButC(block, TEX, 32766, str, x1+5,y1+10,225,20, editvar,(float)min,(float)max, 0, 0, "");
uiDefBut(block, BUT, 32767, "OK", x1+236,y1+10,25,20, NULL, 0, 0, 0, 0, "");
uiBoundsBlock(block, 5);
@@ -321,7 +325,12 @@
mainqenter_ext(BUT_ACTIVATE, 32766, 0); /* note, button id '32766' is asking for errors some day! */
ret= uiDoBlocks(&listb, 0, 0);
- if(ret==UI_RETURN_OK) return 1;
+ if(ret==UI_RETURN_OK) {
+ BLI_strncpy(var, editvar, max);
+ MEM_freeN(editvar);
+ return 1;
+ }
+ MEM_freeN(editvar);
return 0;
}
Modified: branches/apricot/source/blender/src/transform_conversions.c
===================================================================
--- branches/apricot/source/blender/src/transform_conversions.c 2008-04-20 18:19:15 UTC (rev 14489)
+++ branches/apricot/source/blender/src/transform_conversions.c 2008-04-20 18:26:06 UTC (rev 14490)
@@ -3428,10 +3428,74 @@
int cancelled= (t->state == TRANS_CANCEL);
if (t->spacetype==SPACE_VIEW3D) {
- EM_automerge(1);
- /* when snapping, delay retopo until after automerge */
- if (G.qual & LR_CTRLKEY) {
- retopo_do_all();
+ if (G.obedit) {
+ if (cancelled==0) {
+ EM_automerge(1);
+ /* when snapping, delay retopo until after automerge */
+ if (G.qual & LR_CTRLKEY) {
+ retopo_do_all();
+ }
+ }
+#if 0
+ } else {
+ /* APRICOT HACK */
+ float pmat[4][4], vmat[4][4];
+ short s[2];
+ View3D *v3d = G.vd;
+
+ /* --- Make external func --- */
+
+ /* ZBuffer depth vars */
+ bglMats mats;
+ float depth, depth_close= MAXFLOAT;
+ int had_depth = 0;
+ double cent[2], p[3];
+ int xs, ys;
+
+ persp(PERSP_VIEW);
+
+ /* Get Z Depths, needed for perspective, nice for ortho */
+ bgl_get_mats(&mats);
+ draw_depth(curarea, (void *)G.vd);
+
+ /* force updating */
+ if (v3d->depths) {
+ had_depth = 1;
+ v3d->depths->damaged = 1;
+ }
+
+ view3d_update_depths(v3d);
+
+ /* we have depths now*/
+ for (base=G.scene->base.first; base; base=base->next) {
+ /* object mode */
+ if (TESTBASELIB(base)) {
+ ob = base->object;
+ project_short(ob->loc, s);
+
+ if (s[0] != IS_CLIPPED) {
+ cent[0] = (double)s[0];
+ cent[1] = (double)s[1];
+ depth_close= v3d->depths->depths[s[1]*v3d->depths->w+s[0]];
+ if (!gluUnProject(cent[0], cent[1], depth_close, mats.modelview, mats.projection, mats.viewport, &p[0], &p[1], &p[2])) {
+ /* do nothing */
+ } else {
+ ob->loc[0] = (float)p[0];
+ ob->loc[1] = (float)p[1];
+ ob->loc[2] = (float)p[2];
+ }
+ }
+ }
+ }
+
+ if (had_depth==0) {
+ MEM_freeN(v3d->depths->depths);
+ v3d->depths->depths = NULL;
+ }
+ v3d->depths->damaged = 1;
+
+ /* --- */
+#endif
}
}
if (t->spacetype == SPACE_ACTION) {
Modified: branches/apricot/source/blender/src/transform_generics.c
===================================================================
--- branches/apricot/source/blender/src/transform_generics.c 2008-04-20 18:19:15 UTC (rev 14489)
+++ branches/apricot/source/blender/src/transform_generics.c 2008-04-20 18:26:06 UTC (rev 14490)
@@ -378,14 +378,14 @@
if (G.sima->flag & SI_LIVE_UNWRAP)
unwrap_lscm_live_re_solve();
} else {
- /* Only retopo if not snapping, Note, this is the only case of G.qual being used, but we have no T_SHIFT_MOD - Campbell */
- if ((G.qual & LR_CTRLKEY)==0)
- retopo_do_all();
-
/* mirror modifier clipping? */
- if(t->state != TRANS_CANCEL)
+ if(t->state != TRANS_CANCEL) {
+ if ((G.qual & LR_CTRLKEY)==0) {
+ /* Only retopo if not snapping, Note, this is the only case of G.qual being used, but we have no T_SHIFT_MOD - Campbell */
+ retopo_do_all();
+ }
clipMirrorModifier(t, G.obedit);
-
+ }
if((t->context & CTX_NO_MIRROR) == 0 && (G.scene->toolsettings->editbutflag & B_MESH_X_MIRROR))
editmesh_apply_to_mirror(t);
Modified: branches/apricot/source/gameengine/GameLogic/SCA_IScene.cpp
===================================================================
--- branches/apricot/source/gameengine/GameLogic/SCA_IScene.cpp 2008-04-20 18:19:15 UTC (rev 14489)
+++ branches/apricot/source/gameengine/GameLogic/SCA_IScene.cpp 2008-04-20 18:26:06 UTC (rev 14490)
@@ -47,19 +47,23 @@
{
}
-
-
-SCA_IScene::~SCA_IScene()
+void SCA_IScene::RemoveAllDebugProperties()
{
- // release debugprop list
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list