Revision: 15566 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15566 Author: campbellbarton Date: 2008-07-14 15:39:48 +0200 (Mon, 14 Jul 2008)
Log Message: ----------- svn merge -r15560:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender Also topology mirror crashed when using smooth + mirror. use eve->hash rather them eve->tmp.l for storing edit vert indices's. Modified Paths: -------------- branches/apricot/intern/elbeem/intern/solver_init.cpp branches/apricot/source/blender/imbuf/intern/openexr/openexr_api.cpp branches/apricot/source/blender/include/BIF_meshtools.h branches/apricot/source/blender/render/intern/source/zbuf.c branches/apricot/source/blender/src/editmesh_mods.c branches/apricot/source/blender/src/meshtools.c branches/apricot/source/blender/src/transform_conversions.c branches/apricot/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp branches/apricot/source/gameengine/GameLogic/SCA_PythonController.cpp branches/apricot/source/gameengine/GamePlayer/ActiveX/BlenderPlayerCtl.cpp branches/apricot/source/gameengine/GamePlayer/ghost/GPG_Application.cpp branches/apricot/source/gameengine/GamePlayer/netscape/src/ketsji/KXH_ketsji_hooks.cpp branches/apricot/source/gameengine/Ketsji/KX_KetsjiEngine.cpp branches/apricot/source/gameengine/Ketsji/KX_PythonInit.cpp branches/apricot/source/gameengine/Ketsji/KX_PythonInit.h branches/apricot/source/gameengine/Ketsji/KX_SoundActuator.cpp Modified: branches/apricot/intern/elbeem/intern/solver_init.cpp =================================================================== --- branches/apricot/intern/elbeem/intern/solver_init.cpp 2008-07-14 12:24:49 UTC (rev 15565) +++ branches/apricot/intern/elbeem/intern/solver_init.cpp 2008-07-14 13:39:48 UTC (rev 15566) @@ -694,7 +694,7 @@ double maxDefaultMemChunk = 2.*1024.*1024.*1024.; //std::cerr<<" memEstFine "<< memEstFine <<" maxWin:" <<maxWinMemChunk <<" maxMac:" <<maxMacMemChunk ; // DEBUG #ifdef WIN32 - if(memEstFine> maxWinMemChunk) { + if(sizeof(void *)==4 && memEstFine>maxWinMemChunk) { memBlockAllocProblem = true; } #endif // WIN32 Modified: branches/apricot/source/blender/imbuf/intern/openexr/openexr_api.cpp =================================================================== --- branches/apricot/source/blender/imbuf/intern/openexr/openexr_api.cpp 2008-07-14 12:24:49 UTC (rev 15565) +++ branches/apricot/source/blender/imbuf/intern/openexr/openexr_api.cpp 2008-07-14 13:39:48 UTC (rev 15566) @@ -451,7 +451,7 @@ openexr_header_compression(&header, compress); /* header.lineOrder() = DECREASING_Y; this crashes in windows for file read! */ - header.insert ("BlenderMultiChannel", StringAttribute ("Blender V2.43")); + header.insert ("BlenderMultiChannel", StringAttribute ("Blender V2.43 and newer")); data->ofile = new OutputFile(filename, header); } Modified: branches/apricot/source/blender/include/BIF_meshtools.h =================================================================== --- branches/apricot/source/blender/include/BIF_meshtools.h 2008-07-14 12:24:49 UTC (rev 15565) +++ branches/apricot/source/blender/include/BIF_meshtools.h 2008-07-14 13:39:48 UTC (rev 15566) @@ -43,7 +43,7 @@ extern long mesh_octree_table(struct Object *ob, float *co, char mode); extern long mesh_mirrtopo_table(struct Object *ob, char mode); extern int mesh_get_x_mirror_vert(struct Object *ob, int index); -extern struct EditVert *editmesh_get_x_mirror_vert(struct Object *ob, struct EditVert *eve); +extern struct EditVert *editmesh_get_x_mirror_vert(struct Object *ob, struct EditVert *eve, int index); extern float *editmesh_get_mirror_uv(int axis, float *co, float *mirrCent, float *face_cent); extern int *mesh_get_x_mirror_faces(struct Object *ob); Modified: branches/apricot/source/blender/render/intern/source/zbuf.c =================================================================== --- branches/apricot/source/blender/render/intern/source/zbuf.c 2008-07-14 12:24:49 UTC (rev 15565) +++ branches/apricot/source/blender/render/intern/source/zbuf.c 2008-07-14 13:39:48 UTC (rev 15566) @@ -3545,7 +3545,7 @@ for(rpass= rl->passes.first; rpass; rpass= rpass->next) { float *col= NULL; - int pixsize= 0; + int pixsize= 3; switch(rpass->passtype) { case SCE_PASS_RGBA: @@ -3580,6 +3580,10 @@ col= &shr->mist; pixsize= 1; break; + case SCE_PASS_Z: + col= &shr->z; + pixsize= 1; + break; case SCE_PASS_VECTOR: { @@ -3612,14 +3616,18 @@ for(samp= 1; samp<R.osa; samp++, fp+=delta) { col[0]+= fp[0]; - col[1]+= fp[1]; - col[2]+= fp[2]; - if(pixsize) col[3]+= fp[3]; + if(pixsize>1) { + col[1]+= fp[1]; + col[2]+= fp[2]; + if(pixsize==4) col[3]+= fp[3]; + } } col[0]*= weight; - col[1]*= weight; - col[2]*= weight; - if(pixsize) col[3]*= weight; + if(pixsize>1) { + col[1]*= weight; + col[2]*= weight; + if(pixsize==4) col[3]*= weight; + } } } @@ -3973,7 +3981,7 @@ /* general shader info, passes */ shade_sample_initialize(&ssamp, pa, rl); - addpassflag= rl->passflag & ~(SCE_PASS_Z|SCE_PASS_COMBINED); + addpassflag= rl->passflag & ~(SCE_PASS_COMBINED); addzbuf= rl->passflag & SCE_PASS_Z; if(R.osa) Modified: branches/apricot/source/blender/src/editmesh_mods.c =================================================================== --- branches/apricot/source/blender/src/editmesh_mods.c 2008-07-14 12:24:49 UTC (rev 15565) +++ branches/apricot/source/blender/src/editmesh_mods.c 2008-07-14 13:39:48 UTC (rev 15566) @@ -117,10 +117,10 @@ if(G.scene->selectmode & SCE_SELECT_VERTEX) { EditMesh *em = G.editMesh; EditVert *eve, *v1; - - for(eve= em->verts.first; eve; eve= eve->next) { + int a; + for(eve= em->verts.first, a=0; eve; eve= eve->next, a++) { if(eve->f & SELECT) { - v1= editmesh_get_x_mirror_vert(G.obedit, eve); + v1= editmesh_get_x_mirror_vert(G.obedit, eve, a); if(v1) { eve->f &= ~SELECT; v1->f |= SELECT; @@ -4168,7 +4168,7 @@ EditEdge *eed; float *adror, *adr, fac; float fvec[3]; - int teller=0; + int teller=0, a; ModifierData *md= G.obedit->modifiers.first; if(G.obedit==0) return; @@ -4243,13 +4243,14 @@ eed= eed->next; } + a = 0; eve= em->verts.first; while(eve) { if(eve->f & SELECT) { if(eve->f1) { if (G.scene->toolsettings->editbutflag & B_MESH_X_MIRROR) { - eve_mir= editmesh_get_x_mirror_vert(G.obedit, eve); + eve_mir= editmesh_get_x_mirror_vert(G.obedit, eve, a); } adr = eve->tmp.p; @@ -4283,6 +4284,7 @@ eve->tmp.p= NULL; } eve= eve->next; + a++; } MEM_freeN(adror); Modified: branches/apricot/source/blender/src/meshtools.c =================================================================== --- branches/apricot/source/blender/src/meshtools.c 2008-07-14 12:24:49 UTC (rev 15565) +++ branches/apricot/source/blender/src/meshtools.c 2008-07-14 13:39:48 UTC (rev 15566) @@ -899,7 +899,7 @@ EditVert *eve; totvert= 0; for(eve= G.editMesh->verts.first; eve; eve= eve->next) { - eve->tmp.l = totvert++; + eve->hash = totvert++; } } else { totvert = me->totvert; @@ -910,8 +910,8 @@ /* Initialize the vert-edge-user counts used to detect unique topology */ if(ob==G.obedit) { for(eed=G.editMesh->edges.first; eed; eed= eed->next) { - MirrTopoHash[eed->v1->tmp.l]++; - MirrTopoHash[eed->v2->tmp.l]++; + MirrTopoHash[eed->v1->hash]++; + MirrTopoHash[eed->v2->hash]++; } } else { for(a=0, medge=me->medge; a<me->totedge; a++, medge++) { @@ -928,8 +928,8 @@ if(ob==G.obedit) { for(eed=G.editMesh->edges.first; eed; eed= eed->next) { - MirrTopoHash[eed->v1->tmp.l] += MirrTopoHash_Prev[eed->v2->tmp.l]; - MirrTopoHash[eed->v2->tmp.l] += MirrTopoHash_Prev[eed->v1->tmp.l]; + MirrTopoHash[eed->v1->hash] += MirrTopoHash_Prev[eed->v2->hash]; + MirrTopoHash[eed->v2->hash] += MirrTopoHash_Prev[eed->v1->hash]; } } else { for(a=0, medge=me->medge; a<me->totedge; a++, medge++) { @@ -1086,14 +1086,16 @@ return NULL; } -static EditVert *editmesh_get_x_mirror_vert_topo(Object *ob, EditVert *eve) +static EditVert *editmesh_get_x_mirror_vert_topo(Object *ob, EditVert *eve, int index) { long poinval; - int index; if (mesh_mirrtopo_table(ob, 'u')==-1) return NULL; - index = BLI_findindex(&G.editMesh->verts, eve); + if (index!=-1) { + index = BLI_findindex(&G.editMesh->verts, eve); + } + if (index==-1) return NULL; @@ -1104,12 +1106,12 @@ return NULL; } -EditVert *editmesh_get_x_mirror_vert(Object *ob, EditVert *eve) +EditVert *editmesh_get_x_mirror_vert(Object *ob, EditVert *eve, int index) { if (G.scene->toolsettings->editbutflag & B_MIRROR_TOPO) { - return editmesh_get_x_mirror_vert_topo(ob, eve); + return editmesh_get_x_mirror_vert_topo(ob, eve, index); } else { - return editmesh_get_x_mirror_vert_spacial(ob, eve); + return editmesh_get_x_mirror_vert_spacial(ob, eve->co); } } Modified: branches/apricot/source/blender/src/transform_conversions.c =================================================================== --- branches/apricot/source/blender/src/transform_conversions.c 2008-07-14 12:24:49 UTC (rev 15565) +++ branches/apricot/source/blender/src/transform_conversions.c 2008-07-14 13:39:48 UTC (rev 15566) @@ -2168,7 +2168,7 @@ /* Mirror? */ if( (mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) { - EditVert *vmir= editmesh_get_x_mirror_vert(G.obedit, eve); /* initializes octree on first call */ + EditVert *vmir= editmesh_get_x_mirror_vert(G.obedit, eve, a); /* initializes octree on first call */ if(vmir != eve) tob->tdmir = vmir; } tob++; Modified: branches/apricot/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp =================================================================== --- branches/apricot/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp 2008-07-14 12:24:49 UTC (rev 15565) +++ branches/apricot/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp 2008-07-14 13:39:48 UTC (rev 15566) @@ -337,6 +337,7 @@ ketsjiengine->SetPythonDictionary(dictionaryobject); initRasterizer(rasterizer, canvas); PyObject *gameLogic = initGameLogic(startscene); + PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module. initGameKeys(); initPythonConstraintBinding(); @@ -404,7 +405,14 @@ exitstring = ketsjiengine->GetExitString(); // when exiting the mainloop - dictionaryClearByHand(gameLogic); + + // Clears the dictionary by hand: + // This prevents, extra references to global variables + // inside the GameLogic dictionary when the python interpreter is finalized. + // which allows the scene to safely delete them :) + // see: (space.c)->start_game + PyDict_Clear(PyModule_GetDict(gameLogic)); + ketsjiengine->StopEngine(); exitGamePythonScripting(); networkdevice->Disconnect(); @@ -596,6 +604,7 @@ ketsjiengine->SetPythonDictionary(dictionaryobject); initRasterizer(rasterizer, canvas); PyObject *gameLogic = initGameLogic(startscene); + PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module initGameKeys(); initPythonConstraintBinding(); Modified: branches/apricot/source/gameengine/GameLogic/SCA_PythonController.cpp =================================================================== --- branches/apricot/source/gameengine/GameLogic/SCA_PythonController.cpp 2008-07-14 12:24:49 UTC (rev 15565) +++ branches/apricot/source/gameengine/GameLogic/SCA_PythonController.cpp 2008-07-14 13:39:48 UTC (rev 15566) @@ -116,7 +116,7 @@ void SCA_PythonController::SetScriptText(const STR_String& text) { - m_scriptText = "import GameLogic\n" + text; + m_scriptText = text; m_bModified = true; } @@ -354,8 +354,10 @@ @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs