[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16075] trunk/blender/source/gameengine/ GameLogic/SCA_PythonController.cpp:
Revision: 16075 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16075 Author: blendix Date: 2008-08-13 12:19:47 +0200 (Wed, 13 Aug 2008) Log Message: --- Bugfix: in the game engine, errors in a particular python script caused somewhat random crashes, which I think was caused by the error print using python objects that were freed too soon. Now it frees the dictionary after the print. Modified Paths: -- trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp Modified: trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp === --- trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp 2008-08-13 01:38:13 UTC (rev 16074) +++ trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp 2008-08-13 10:19:47 UTC (rev 16075) @@ -273,36 +273,16 @@ * break it by hand, then DECREF (which in this case * should always ensure excdict is cleared). */ -/* PyObject *excdict= myPyDict_Copy(m_pythondictionary); - struct _object* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, - excdict, - excdict - ); - PyDict_Clear(excdict); - Py_DECREF(excdict);*/ - -#if 1 PyObject *excdict= PyDict_Copy(m_pythondictionary); PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, - excdict, - excdict - ); - PyDict_Clear(excdict); - Py_DECREF(excdict); -#else + excdict, excdict); - PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, - m_pythondictionary, - m_pythondictionary - ); - -#endif - if (resultobj) { Py_DECREF(resultobj); - } else + } + else { // something is wrong, tell the user what went wrong printf("PYTHON SCRIPT ERROR:\n"); @@ -310,6 +290,11 @@ //PyRun_SimpleString(m_scriptText.Ptr()); } + // clear after PyErrPrint - seems it can be using + // something in this dictionary and crash? + PyDict_Clear(excdict); + Py_DECREF(excdict); + m_sCurrentController = NULL; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16076] branches/soc-2008-quorn/source/ blender/src: PageUp/ Down now moves the mouse cursor instead of just the view.
Revision: 16076 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16076 Author: quorn Date: 2008-08-13 14:20:49 +0200 (Wed, 13 Aug 2008) Log Message: --- PageUp/Down now moves the mouse cursor instead of just the view. Also added some other pops for when the cursor went off screen (click after horizontal scroll, undo, redo, etc.) Modified Paths: -- branches/soc-2008-quorn/source/blender/src/drawtext.c branches/soc-2008-quorn/source/blender/src/header_text.c Modified: branches/soc-2008-quorn/source/blender/src/drawtext.c === --- branches/soc-2008-quorn/source/blender/src/drawtext.c 2008-08-13 10:19:47 UTC (rev 16075) +++ branches/soc-2008-quorn/source/blender/src/drawtext.c 2008-08-13 12:20:49 UTC (rev 16076) @@ -1064,6 +1064,38 @@ if (st->top<0) st->top= 0; } +static void cursor_skip(SpaceText *st, int lines, int sel) +{ + Text *text; + TextLine **linep; + int oldl, oldc, *charp; + + if (!st) return; + if (st->spacetype != SPACE_TEXT) return; + if (!st->text) return; + + text= st->text; + + if (sel) linep= &text->sell, charp= &text->selc; + else linep= &text->curl, charp= &text->curc; + oldl= txt_get_span(text->lines.first, *linep); + oldc= *charp; + + while (lines>0 && (*linep)->next) { + *linep= (*linep)->next; + lines--; + } + while (lines<0 && (*linep)->prev) { + *linep= (*linep)->prev; + lines++; + } + + if (*charp > (*linep)->len) *charp= (*linep)->len; + + if (!sel) txt_pop_sel(st->text); + txt_undo_add_toop(st->text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, txt_get_span(text->lines.first, *linep), *charp); +} + /* * mode 1 == view scroll * mode 2 == scrollbar @@ -1194,6 +1226,8 @@ if (sell!=linep2 || selc!=charp2) txt_undo_add_toop(st->text, UNDO_STO, sell, selc, linep2, charp2); + + pop_space_text(st); } static int do_suggest_select(SpaceText *st) @@ -2947,11 +2981,13 @@ //txt_print_undo(text); //debug buffer in console if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) { txt_do_redo(text); + pop_space_text(st); do_draw= 1; } if (G.qual == LR_ALTKEY) { txt_do_undo(text); if (st->showsyntax) txt_format_text(st); + pop_space_text(st); do_draw= 1; } break; /* BREAK U */ @@ -3014,6 +3050,7 @@ txt_do_undo(text); } if (st->showsyntax) txt_format_text(st); + pop_space_text(st); do_draw= 1; } break; @@ -3140,11 +3177,13 @@ pop_space_text(st); break; case PAGEDOWNKEY: - screen_skip(st, st->viewlines); + cursor_skip(st, st->viewlines, G.qual & LR_SHIFTKEY); + pop_space_text(st); do_draw= 1; break; case PAGEUPKEY: - screen_skip(st, -st->viewlines); + cursor_skip(st, -st->viewlines, G.qual & LR_SHIFTKEY); + pop_space_text(st); do_draw= 1; break; case HOMEKEY: Modified: branches/soc-2008-quorn/source/blender/src/header_text.c === --- branches/soc-2008-quorn/source/blender/src/header_text.c2008-08-13 10:19:47 UTC (rev 16075) +++ branches/soc-2008-quorn/source/blender/src/header_text.c2008-08-13 12:20:49 UTC (rev 16076) @@ -378,9 +378,11 @@ switch(event) { case 1: txt_do_undo(text); + pop_space_text(st); break; case 2: txt_do_redo(text); + pop_space_text(st); break; case 3: if (text && text->id.lib) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16077] branches/soc-2008-jaguarandi/ source/blender/blenkernel/intern/shrinkwrap.c: Fixed compile for windows
Revision: 16077 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16077 Author: jaguarandi Date: 2008-08-13 15:36:09 +0200 (Wed, 13 Aug 2008) Log Message: --- Fixed compile for windows Modified Paths: -- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c === --- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c 2008-08-13 12:20:49 UTC (rev 16076) +++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c 2008-08-13 13:36:09 UTC (rev 16077) @@ -60,7 +60,7 @@ #define OUT_OF_MEMORY()((void)printf("Shrinkwrap: Out of memory\n")) /* Benchmark macros */ -#if 1 +#ifndef _WIN32 #include ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16078] branches/soc-2008-quorn/source/ blender/blenkernel/intern/text.c: Small bug fix: Scripts were not being recompiled after an error, if the (aut
Revision: 16078 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16078 Author: quorn Date: 2008-08-13 19:29:51 +0200 (Wed, 13 Aug 2008) Log Message: --- Small bug fix: Scripts were not being recompiled after an error, if the (auto-selected) erroneous text was simply deleted and the script re-run. Modified Paths: -- branches/soc-2008-quorn/source/blender/blenkernel/intern/text.c Modified: branches/soc-2008-quorn/source/blender/blenkernel/intern/text.c === --- branches/soc-2008-quorn/source/blender/blenkernel/intern/text.c 2008-08-13 13:36:09 UTC (rev 16077) +++ branches/soc-2008-quorn/source/blender/blenkernel/intern/text.c 2008-08-13 17:29:51 UTC (rev 16078) @@ -2221,6 +2221,7 @@ if (txt_has_sel(text)) { /* deleting a selection */ txt_delete_sel(text); + txt_make_dirty(text); return; } else if (text->curc== text->curl->len) { /* Appending two lines */ @@ -2281,6 +2282,7 @@ if (txt_has_sel(text)) { /* deleting a selection */ txt_delete_sel(text); + txt_make_dirty(text); return; } else if (text->curc==0) { /* Appending two lines */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16079] branches/soc-2008-jaguarandi/ source/blender: Fixed a typo
Revision: 16079 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16079 Author: jaguarandi Date: 2008-08-13 19:34:09 +0200 (Wed, 13 Aug 2008) Log Message: --- Fixed a typo I was using the word "kept" (past tense) instead of "keep" (basic form). I hope my english teachter dont sees this commit xD Modified Paths: -- branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_shrinkwrap.h branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c branches/soc-2008-jaguarandi/source/blender/makesdna/DNA_modifier_types.h branches/soc-2008-jaguarandi/source/blender/src/buttons_editing.c Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_shrinkwrap.h === --- branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_shrinkwrap.h 2008-08-13 17:29:51 UTC (rev 16078) +++ branches/soc-2008-jaguarandi/source/blender/blenkernel/BKE_shrinkwrap.h 2008-08-13 17:34:09 UTC (rev 16079) @@ -112,7 +112,7 @@ struct DerivedMesh *target; //mesh we are shrinking to SpaceTransform local2target;//transform to move bettwem local and target space - float keptDist; //Distance to kept from target (units are in local space) + float keepDist; //Distance to kept from target (units are in local space) } ShrinkwrapCalcData; Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c === --- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c 2008-08-13 17:29:51 UTC (rev 16078) +++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c 2008-08-13 17:34:09 UTC (rev 16079) @@ -7231,7 +7231,7 @@ ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; smd->shrinkType = MOD_SHRINKWRAP_NEAREST_SURFACE; smd->shrinkOpts = MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR; - smd->keptDist = 0.0f; + smd->keepDist = 0.0f; smd->target = NULL; smd->auxTarget = NULL; @@ -7247,7 +7247,7 @@ strcpy(tsmd->vgroup_name, smd->vgroup_name); - tsmd->keptDist = smd->keptDist; + tsmd->keepDist = smd->keepDist; tsmd->shrinkType= smd->shrinkType; tsmd->shrinkOpts= smd->shrinkOpts; } Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c === --- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c 2008-08-13 17:29:51 UTC (rev 16078) +++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c 2008-08-13 17:34:09 UTC (rev 16079) @@ -172,7 +172,7 @@ //because space has been deformed space_transform_setup(&calc.local2target, ob, smd->target); - calc.keptDist = smd->keptDist; //TODO: smd->keptDist is in global units.. must change to local + calc.keepDist = smd->keepDist; //TODO: smd->keepDist is in global units.. must change to local } @@ -256,9 +256,9 @@ //Found the nearest vertex if(nearest.index != -1) { - //Adjusting the vertex weight, so that after interpolating it kepts a certain distance from the nearest position + //Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position float dist = sasqrt(nearest.dist); - if(dist > FLT_EPSILON) weight *= (dist - calc->keptDist)/dist; + if(dist > FLT_EPSILON) weight *= (dist - calc->keepDist)/dist; //Convert the coordinates back to mesh coordinates VECCOPY(tmp_co, nearest.co); @@ -388,7 +388,7 @@ //Build target tree - BENCH(bvhtree_from_mesh_faces(&treeData, calc->target, calc->keptDist, 4, 6)); + BENCH(bvhtree_from_mesh_faces(&treeData, calc->target, calc->keepDist, 4, 6)); if(treeData.tree == NULL) return OUT_OF_MEMORY(); //Build auxiliar target @@ -521,17 +521,17 @@ //Found the nearest vertex if(nearest.index) { - if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE) + if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE) { //Make the vertex stay on the front side of the face - VECADDFAC(tmp_co, nearest.co, nearest.no, calc->keptDist); + VECADDFAC(tmp_
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16080] branches/apricot: Apricot Branch
Revision: 16080 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16080 Author: blendix Date: 2008-08-13 19:37:37 +0200 (Wed, 13 Aug 2008) Log Message: --- Apricot Branch == Various cleanups and optimizations in the game engine: * Remove some duplication in the RAS_RenderTools, and sync the blender and game player versions. Also avoid some opengl state changes. * Don't make separate materials for triangles and quads, this distinction was moved to the mesh level. Also don't take some other irrelevant tface settings into account to avoid making more materials. * Refactoring of mesh storage, should fix wrong normals on meshes that are reused. It also allows for joining together nearby meshes for speed, though that's disabled still because it doesn't work together correct yet with ome features. * Added a distinction for game objects to be either culled or set invisible, previously there was only one flag, which couldn't work correct. * For parenting to bones, where_is_pose was executed multiple times per frame, now should be once per armature. * Fix uninitialized intertia value in the physics system. * Various warning fixes. * Removed some conditionals in GLSL and other minor optimizations in the code. Also cache opengl uniform locations, and fix an invalid memory read. * Avoid doing some math for GLSL lamps if it is not required. Modified Paths: -- branches/apricot/intern/moto/include/GEN_Map.h branches/apricot/intern/moto/include/MT_Matrix4x4.h branches/apricot/intern/moto/include/MT_Matrix4x4.inl branches/apricot/source/blender/blenkernel/intern/armature.c branches/apricot/source/blender/gpu/GPU_extensions.h branches/apricot/source/blender/gpu/intern/gpu_codegen.c branches/apricot/source/blender/gpu/intern/gpu_codegen.h branches/apricot/source/blender/gpu/intern/gpu_extensions.c branches/apricot/source/blender/gpu/intern/gpu_material.c branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c branches/apricot/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h branches/apricot/source/gameengine/Converter/BL_ArmatureObject.cpp branches/apricot/source/gameengine/Converter/BL_ArmatureObject.h branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp branches/apricot/source/gameengine/Converter/BL_MeshDeformer.cpp branches/apricot/source/gameengine/Converter/BL_ShapeActionActuator.cpp branches/apricot/source/gameengine/Converter/BL_ShapeDeformer.cpp branches/apricot/source/gameengine/Converter/BL_SkinDeformer.cpp branches/apricot/source/gameengine/Converter/BL_SkinDeformer.h branches/apricot/source/gameengine/Converter/BL_SkinMeshObject.cpp branches/apricot/source/gameengine/Converter/BL_SkinMeshObject.h branches/apricot/source/gameengine/Converter/KX_BlenderSceneConverter.cpp branches/apricot/source/gameengine/Converter/KX_ConvertActuators.cpp branches/apricot/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp branches/apricot/source/gameengine/GamePlayer/common/GPC_RenderTools.h branches/apricot/source/gameengine/GamePlayer/common/unix/GPU_PolygonMaterial.h branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.cpp branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.h branches/apricot/source/gameengine/Ketsji/BL_Material.h branches/apricot/source/gameengine/Ketsji/BL_Shader.cpp branches/apricot/source/gameengine/Ketsji/BL_Shader.h branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.h branches/apricot/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp branches/apricot/source/gameengine/Ketsji/KX_GameObject.h branches/apricot/source/gameengine/Ketsji/KX_MeshProxy.cpp branches/apricot/source/gameengine/Ketsji/KX_PolygonMaterial.cpp branches/apricot/source/gameengine/Ketsji/KX_PolygonMaterial.h branches/apricot/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp branches/apricot/source/gameengine/Ketsji/KX_Scene.cpp branches/apricot/source/gameengine/Ketsji/KX_VertexProxy.cpp branches/apricot/source/gameengine/Ketsji/KX_VisibilityActuator.cpp branches/apricot/source/gameengine/Physics/Bullet/CcdPhysicsController.h branches/apricot/source/gameengine/Rasterizer/RAS_BucketManager.cpp branches/apricot/source/gameengine/Rasterizer/RAS_BucketManager.h branches/apricot/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp branches/apricot/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h branche
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16081] trunk/blender/source/blender/src/ header_view3d.c: Snap menu header rewording, to make documentation clearer (there was "mode" and "snap mode
Revision: 16081 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16081 Author: theeth Date: 2008-08-13 19:38:38 +0200 (Wed, 13 Aug 2008) Log Message: --- Snap menu header rewording, to make documentation clearer (there was "mode" and "snap mode"). This can and should be merged for 2.47, as the docs will use those wordings. Modified Paths: -- trunk/blender/source/blender/src/header_view3d.c Modified: trunk/blender/source/blender/src/header_view3d.c === --- trunk/blender/source/blender/src/header_view3d.c2008-08-13 17:37:37 UTC (rev 16080) +++ trunk/blender/source/blender/src/header_view3d.c2008-08-13 17:38:38 UTC (rev 16081) @@ -5139,7 +5139,7 @@ static char string[512]; char *str = string; - str += sprintf(str, "%s", "Snap Mode: %t"); + str += sprintf(str, "%s", "Snap Element: %t"); str += sprintf(str, "%s", "|Vertex%x0"); str += sprintf(str, "%s", "|Edge%x1"); str += sprintf(str, "%s", "|Face%x2"); @@ -5777,7 +5777,7 @@ xco+= XIC; uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_VERTEXSEL, snapmode_pup(), xco,0,XIC+10,YIC, &(G.scene->snap_mode), 0.0, 0.0, 0, 0, "Snapping mode"); xco+= XIC; - uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode"); + uiDefButS(block, MENU, B_NOP, "Snap Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode"); xco+= 70; } else { uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16082] branches/apricot/source: Apricot Branch
Revision: 16082 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16082 Author: blendix Date: 2008-08-13 19:42:58 +0200 (Wed, 13 Aug 2008) Log Message: --- Apricot Branch == svn merge -r16064:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender Modified Paths: -- branches/apricot/source/blender/blenkernel/intern/bvhutils.c branches/apricot/source/blender/src/header_view3d.c branches/apricot/source/gameengine/GameLogic/SCA_PythonController.cpp Modified: branches/apricot/source/blender/blenkernel/intern/bvhutils.c === --- branches/apricot/source/blender/blenkernel/intern/bvhutils.c 2008-08-13 17:38:38 UTC (rev 16081) +++ branches/apricot/source/blender/blenkernel/intern/bvhutils.c 2008-08-13 17:42:58 UTC (rev 16082) @@ -48,9 +48,6 @@ /* Math stuff for ray casting on mesh faces and for nearest surface */ -static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest); - -#define ISECT_EPSILON 1e-6 static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) { float dist; @@ -79,170 +76,324 @@ return FLT_MAX; } + /* - * This calculates the distance from point to the plane - * Distance is negative if point is on the back side of plane + * Function adapted from David Eberly's distance tools (LGPL) + * http://www.geometrictools.com/LibFoundation/Distance/Distance.html */ -static float point_plane_distance(const float *point, const float *plane_point, const float *plane_normal) +static float nearest_point_in_tri_surface(const float *v0,const float *v1,const float *v2,const float *p, int *v, int *e, float *d, float *nearest ) { - float pp[3]; - VECSUB(pp, point, plane_point); - return INPR(pp, plane_normal); -} -static float choose_nearest(const float v0[2], const float v1[2], const float point[2], float closest[2]) -{ - float d[2][2], sdist[2]; - VECSUB2D(d[0], v0, point); - VECSUB2D(d[1], v1, point); + float diff[3]; + float e0[3]; + float e1[3]; + float A00; + float A01; + float A11; + float B0; + float B1; + float C; + float Det; + float S; + float T; + float sqrDist; + int lv = -1, le = -1; + + VECSUB(diff, v0, p); + VECSUB(e0, v1, v0); + VECSUB(e1, v2, v0); + + A00 = INPR ( e0, e0 ); + A01 = INPR( e0, e1 ); + A11 = INPR ( e1, e1 ); + B0 = INPR( diff, e0 ); + B1 = INPR( diff, e1 ); + C = INPR( diff, diff ); + Det = fabs( A00 * A11 - A01 * A01 ); + S = A01 * B1 - A11 * B0; + T = A01 * B0 - A00 * B1; - sdist[0] = d[0][0]*d[0][0] + d[0][1]*d[0][1]; - sdist[1] = d[1][0]*d[1][0] + d[1][1]*d[1][1]; - - if(sdist[0] < sdist[1]) + if ( S + T <= Det ) { - if(closest) - VECCOPY2D(closest, v0); - return sdist[0]; + if ( S < 0.0f ) + { + if ( T < 0.0f ) // Region 4 + { + if ( B0 < 0.0f ) + { + T = 0.0f; + if ( -B0 >= A00 ) + { + S = (float)1.0; + sqrDist = A00 + 2.0f * B0 + C; + lv = 1; + } + else + { + if(fabs(A00) > FLT_EPSILON) + S = -B0/A00; + else + S = 0.0f; + sqrDist = B0 * S + C; + le = 0; + } + } + else + { + S = 0.0f; + if ( B1 >= 0.0f ) + { + T = 0.0f; + sqrDist = C; + lv = 0; + } + else if ( -B1 >= A11 ) + { + T = 1.0f; +
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16083] branches/blender-2.47/source: branches/blender-2.47
Revision: 16083 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16083 Author: bdiego Date: 2008-08-13 20:29:13 +0200 (Wed, 13 Aug 2008) Log Message: --- branches/blender-2.47 Merge from trunk: Revision: 16075 Revision: 16081 Modified Paths: -- branches/blender-2.47/source/blender/src/header_view3d.c branches/blender-2.47/source/gameengine/GameLogic/SCA_PythonController.cpp Modified: branches/blender-2.47/source/blender/src/header_view3d.c === --- branches/blender-2.47/source/blender/src/header_view3d.c2008-08-13 17:42:58 UTC (rev 16082) +++ branches/blender-2.47/source/blender/src/header_view3d.c2008-08-13 18:29:13 UTC (rev 16083) @@ -5077,7 +5077,7 @@ static char string[512]; char *str = string; - str += sprintf(str, "%s", "Snap Mode: %t"); + str += sprintf(str, "%s", "Snap Element: %t"); str += sprintf(str, "%s", "|Vertex%x0"); str += sprintf(str, "%s", "|Edge%x1"); str += sprintf(str, "%s", "|Face%x2"); @@ -5715,7 +5715,7 @@ xco+= XIC; uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_VERTEXSEL, snapmode_pup(), xco,0,XIC+10,YIC, &(G.scene->snap_mode), 0.0, 0.0, 0, 0, "Snapping mode"); xco+= XIC; - uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode"); + uiDefButS(block, MENU, B_NOP, "Snap Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode"); xco+= 70; } else { uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)"); Modified: branches/blender-2.47/source/gameengine/GameLogic/SCA_PythonController.cpp === --- branches/blender-2.47/source/gameengine/GameLogic/SCA_PythonController.cpp 2008-08-13 17:42:58 UTC (rev 16082) +++ branches/blender-2.47/source/gameengine/GameLogic/SCA_PythonController.cpp 2008-08-13 18:29:13 UTC (rev 16083) @@ -273,36 +273,16 @@ * break it by hand, then DECREF (which in this case * should always ensure excdict is cleared). */ -/* PyObject *excdict= myPyDict_Copy(m_pythondictionary); - struct _object* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, - excdict, - excdict - ); - PyDict_Clear(excdict); - Py_DECREF(excdict);*/ - -#if 1 PyObject *excdict= PyDict_Copy(m_pythondictionary); PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, - excdict, - excdict - ); - PyDict_Clear(excdict); - Py_DECREF(excdict); -#else + excdict, excdict); - PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, - m_pythondictionary, - m_pythondictionary - ); - -#endif - if (resultobj) { Py_DECREF(resultobj); - } else + } + else { // something is wrong, tell the user what went wrong printf("PYTHON SCRIPT ERROR:\n"); @@ -310,6 +290,11 @@ //PyRun_SimpleString(m_scriptText.Ptr()); } + // clear after PyErrPrint - seems it can be using + // something in this dictionary and crash? + PyDict_Clear(excdict); + Py_DECREF(excdict); + m_sCurrentController = NULL; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16084] branches/soc-2008-jaguarandi/ source: svn merge -r 15988:16077 https://svn.blender.org/svnroot/bf-blender /trunk/blender
Revision: 16084 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16084 Author: jaguarandi Date: 2008-08-13 21:22:35 +0200 (Wed, 13 Aug 2008) Log Message: --- svn merge -r 15988:16077 https://svn.blender.org/svnroot/bf-blender/trunk/blender To have the 50% faster nearest_surface point. Changed mesh_faces_nearest_point to return the face normal instead of collision normal Modified Paths: -- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/bvhutils.c branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/softbody.c branches/soc-2008-jaguarandi/source/blender/python/api2_2x/Texture.c branches/soc-2008-jaguarandi/source/blender/python/api2_2x/doc/Texture.py branches/soc-2008-jaguarandi/source/blender/src/buttons_editing.c branches/soc-2008-jaguarandi/source/gameengine/Expressions/Value.cpp branches/soc-2008-jaguarandi/source/gameengine/GameLogic/SCA_PythonController.cpp Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/bvhutils.c === --- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/bvhutils.c 2008-08-13 18:29:13 UTC (rev 16083) +++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/bvhutils.c 2008-08-13 19:22:35 UTC (rev 16084) @@ -48,9 +48,6 @@ /* Math stuff for ray casting on mesh faces and for nearest surface */ -static float nearest_point_in_tri_surface(const float *point, const float *v0, const float *v1, const float *v2, float *nearest); - -#define ISECT_EPSILON 1e-6 static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) { float dist; @@ -79,170 +76,324 @@ return FLT_MAX; } + /* - * This calculates the distance from point to the plane - * Distance is negative if point is on the back side of plane + * Function adapted from David Eberly's distance tools (LGPL) + * http://www.geometrictools.com/LibFoundation/Distance/Distance.html */ -static float point_plane_distance(const float *point, const float *plane_point, const float *plane_normal) +static float nearest_point_in_tri_surface(const float *v0,const float *v1,const float *v2,const float *p, int *v, int *e, float *nearest ) { - float pp[3]; - VECSUB(pp, point, plane_point); - return INPR(pp, plane_normal); -} -static float choose_nearest(const float v0[2], const float v1[2], const float point[2], float closest[2]) -{ - float d[2][2], sdist[2]; - VECSUB2D(d[0], v0, point); - VECSUB2D(d[1], v1, point); + float diff[3]; + float e0[3]; + float e1[3]; + float A00; + float A01; + float A11; + float B0; + float B1; + float C; + float Det; + float S; + float T; + float sqrDist; + int lv = -1, le = -1; + + VECSUB(diff, v0, p); + VECSUB(e0, v1, v0); + VECSUB(e1, v2, v0); + + A00 = INPR ( e0, e0 ); + A01 = INPR( e0, e1 ); + A11 = INPR ( e1, e1 ); + B0 = INPR( diff, e0 ); + B1 = INPR( diff, e1 ); + C = INPR( diff, diff ); + Det = fabs( A00 * A11 - A01 * A01 ); + S = A01 * B1 - A11 * B0; + T = A01 * B0 - A00 * B1; - sdist[0] = d[0][0]*d[0][0] + d[0][1]*d[0][1]; - sdist[1] = d[1][0]*d[1][0] + d[1][1]*d[1][1]; - - if(sdist[0] < sdist[1]) + if ( S + T <= Det ) { - if(closest) - VECCOPY2D(closest, v0); - return sdist[0]; + if ( S < 0.0f ) + { + if ( T < 0.0f ) // Region 4 + { + if ( B0 < 0.0f ) + { + T = 0.0f; + if ( -B0 >= A00 ) + { + S = (float)1.0; + sqrDist = A00 + 2.0f * B0 + C; + lv = 1; + } + else + { + if(fabs(A00) > FLT_EPSILON) + S = -B0/A00; + else + S = 0.0f; + sqrDist = B0 * S + C; + le = 0; + } + } + else + { +
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16085] branches/soc-2008-jaguarandi/ source/blender/blenkernel/intern: Fixed problem of " lack of normal information"
Revision: 16085 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16085 Author: jaguarandi Date: 2008-08-13 22:18:56 +0200 (Wed, 13 Aug 2008) Log Message: --- Fixed problem of "lack of normal information" Modified Paths: -- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c === --- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c 2008-08-13 19:22:35 UTC (rev 16084) +++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c 2008-08-13 20:18:56 UTC (rev 16085) @@ -7285,21 +7285,50 @@ static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, derivedData, vertexCos, numVerts); + DerivedMesh *dm = NULL; + CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(md); + + /* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */ + if(shrinkwrapModifier_requiredDataMask(md)) + { + if(derivedData) dm = CDDM_copy(derivedData); + else if(ob->type==OB_MESH) dm = CDDM_from_mesh(ob->data, ob); + else return; + + if(dataMask & CD_MVERT) + { + CDDM_apply_vert_coords(dm, vertexCos); + CDDM_calc_normals(dm); + } + } + + shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, dm, vertexCos, numVerts); + + if(dm) + dm->release(dm); } static void shrinkwrapModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - DerivedMesh *dm; + DerivedMesh *dm = NULL; + CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(md); - if(!derivedData && ob->type == OB_MESH) - dm = CDDM_from_editmesh(editData, ob->data); - else - dm = CDDM_copy(derivedData);//TODO: this is only needed if derevedData doenst supports getVertexArray + if(dataMask) + { + if(derivedData) dm = CDDM_copy(derivedData); + else if(ob->type==OB_MESH) dm = CDDM_from_editmesh(editData, ob); + else return; + if(dataMask & CD_MVERT) + { + CDDM_apply_vert_coords(dm, vertexCos); + CDDM_calc_normals(dm); + } + } + shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, dm, vertexCos, numVerts); - if(dm != derivedData) + if(dm) dm->release(dm); } Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c === --- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c 2008-08-13 19:22:35 UTC (rev 16084) +++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c 2008-08-13 20:18:56 UTC (rev 16085) @@ -364,7 +364,6 @@ if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) { vert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MVERT) : NULL; - if(vert) CDDM_calc_normals(calc->original); //Maybe normals aren't yet calculated } else { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16086] branches/harmonic-skeleton/source/ blender/src/autoarmature.c: starting threading code for retarget
Revision: 16086 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16086 Author: theeth Date: 2008-08-13 22:33:57 +0200 (Wed, 13 Aug 2008) Log Message: --- starting threading code for retarget nothing working yet, will finish tomorrow at home Modified Paths: -- branches/harmonic-skeleton/source/blender/src/autoarmature.c Modified: branches/harmonic-skeleton/source/blender/src/autoarmature.c === --- branches/harmonic-skeleton/source/blender/src/autoarmature.c 2008-08-13 20:18:56 UTC (rev 16085) +++ branches/harmonic-skeleton/source/blender/src/autoarmature.c 2008-08-13 20:33:57 UTC (rev 16086) @@ -52,6 +52,7 @@ #include "BLI_ghash.h" #include "BLI_graph.h" #include "BLI_rand.h" +#include "BLI_threads.h" #include "BDR_editobject.h" @@ -92,6 +93,7 @@ ReebGraph *link_mesh; ListBase controls; + ListBase threads; GHash *bones_map; @@ -149,6 +151,11 @@ int flag; } RigControl; +typedef struct RetargetParam { + RigGraph*rigg; + RigArc *iarc; +} RetargetParam; + typedef enum { RETARGET_LENGTH, @@ -163,6 +170,8 @@ /***/ +void *exec_retargetArctoArc(void *param); + static void RIG_calculateEdgeAngle(RigEdge *edge_first, RigEdge *edge_second); /* two levels */ @@ -249,6 +258,8 @@ rg->free_arc = RIG_freeRigArc; rg->free_node = NULL; + BLI_init_threads(&rg->threads, exec_retargetArctoArc, 2); /* fix number of threads */ + return rg; } @@ -1551,6 +1562,19 @@ } } +void *exec_retargetArctoArc(void *param) +{ + RetargetParam *p = (RetargetParam*)param; + retargetArctoArc(p->rigg, p->iarc); + MEM_freeN(param); + + return NULL; +} + +void thread_retargetArctoArc(RigGraph *rigg, RigArc *iarc) +{ +} + static void matchMultiResolutionNode(RigNode *inode, ReebNode *top_node) { ReebNode *enode; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16087] branches/soc-2008-quorn/source/ blender/src: Added a Marker sub-menu to the Edit menu in the text space header.
Revision: 16087 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16087 Author: quorn Date: 2008-08-13 23:13:56 +0200 (Wed, 13 Aug 2008) Log Message: --- Added a Marker sub-menu to the Edit menu in the text space header. Modified Paths: -- branches/soc-2008-quorn/source/blender/src/drawtext.c branches/soc-2008-quorn/source/blender/src/header_text.c Modified: branches/soc-2008-quorn/source/blender/src/drawtext.c === --- branches/soc-2008-quorn/source/blender/src/drawtext.c 2008-08-13 20:33:57 UTC (rev 16086) +++ branches/soc-2008-quorn/source/blender/src/drawtext.c 2008-08-13 21:13:56 UTC (rev 16087) @@ -2455,7 +2455,7 @@ text= st->text; if (!text || text->id.lib || text->curl != text->sell) return 0; - marker= txt_find_marker(text, text->curl, text->curc, 0); + marker= txt_find_marker(text, text->sell, text->selc, 0); if (!marker) { /* Find the next temporary marker */ if (evnt==TABKEY) { Modified: branches/soc-2008-quorn/source/blender/src/header_text.c === --- branches/soc-2008-quorn/source/blender/src/header_text.c2008-08-13 20:33:57 UTC (rev 16086) +++ branches/soc-2008-quorn/source/blender/src/header_text.c2008-08-13 21:13:56 UTC (rev 16087) @@ -42,6 +42,7 @@ #include "BMF_Api.h" #include "BIF_language.h" +#include "MEM_guardedalloc.h" #include "BSE_headerbuttons.h" @@ -315,9 +316,14 @@ txt_write_file(text); break; case 6: + text->flags |= TXT_ISMEM | TXT_ISDIRTY | TXT_ISTMP; + MEM_freeN(text->name); + text->name= NULL; + break; + case 7: run_python_script(st); break; - case 7: + case 8: { Object *ob; bConstraint *con; @@ -491,6 +497,57 @@ } } +/* action executed after clicking in Markers menu */ +static void do_text_editmenu_markermenu(void *arg, int event) +{ + SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */ + Text *text; + TextMarker *mrk; + ScrArea *sa; + int lineno; + + if (st==NULL || st->spacetype != SPACE_TEXT) return; + + text = st->text; + + switch(event) { + case 1: + txt_clear_markers(text, 0); + break; + case 2: + lineno= txt_get_span(text->lines.first, text->curl); + mrk= text->markers.first; + while (mrk && (mrk->linenolineno==lineno && mrk->start <= text->curc))) + mrk= mrk->next; + if (!mrk) mrk= text->markers.first; + if (mrk) { + txt_move_to(text, mrk->lineno, mrk->start, 0); + txt_move_to(text, mrk->lineno, mrk->end, 1); + } + break; + case 3: + lineno= txt_get_span(text->lines.first, text->curl); + mrk= text->markers.last; + while (mrk && (mrk->lineno>lineno || (mrk->lineno==lineno && mrk->end > text->curc))) + mrk= mrk->prev; + if (!mrk) mrk= text->markers.last; + if (mrk) { + txt_move_to(text, mrk->lineno, mrk->start, 0); + txt_move_to(text, mrk->lineno, mrk->end, 1); + } + break; + default: + break; + } + + for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { + SpaceText *st= sa->spacedata.first; + if (st && st->spacetype==SPACE_TEXT) { + scrarea_queue_redraw(sa); + } + } +} + /* action executed after clicking in Format menu */ static void do_text_formatmenu(void *arg, int event) { @@ -600,6 +657,25 @@ return block; } +/* Select menu */ +static uiBlock *text_editmenu_markermenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "text_editmenu_markermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_text_editmenu_markermenu, NULL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear All", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Next Marker", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Previous Marker", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + + return block; +} + void do_text_formatmenu_convert(void *a
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16088] branches/soc-2008-unclezeiv/source /blender/render/intern/source/lightcuts.c: Improved Oren Nayar bounding: the bounding was previously way to
Revision: 16088 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16088 Author: unclezeiv Date: 2008-08-14 00:00:49 +0200 (Thu, 14 Aug 2008) Log Message: --- Improved Oren Nayar bounding: the bounding was previously way too loose and would result in very slow renderings, as the algorithm would never reach a satisfying error level. Modified Paths: -- branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c Modified: branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c === --- branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c 2008-08-13 21:13:56 UTC (rev 16087) +++ branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c 2008-08-13 22:00:49 UTC (rev 16088) @@ -1397,7 +1397,7 @@ { float nv, t, A, B; float View_B[3], lmin[3], lmax[3], mat[3][3]; - float bound_sin_tan, x; + float bound_sin_tan, k1, k2; if(max_dot <= 0.0f) return 0.0f; @@ -1428,14 +1428,16 @@ * a = MAX(acos(realnl), acos(nv)), b = MIN(*) * sin(a) * tan(b) * this is equivalent to: -* a = MAX(realnl, nv), b = MIN(*) +* a = MIN(realnl, nv), b = MAX(*) * sqrt(1 - a * a) * sqrt(1 - b * b) / b * which in turn is bound by: -* sqrt(1 - b * b) * sqrt(1 - b * b) / b = (1 - b * b) / b +* sqrt(1 - a * a) * sqrt(1 - a * a) / b = (1 - a * a) / b * Tighter bounds could possibly be found. */ - x = MIN3(nv, min_dot, 0.95); - bound_sin_tan= 1 / x - x; + k1= MIN3(nv, min_dot, 0.95); + k2= MAX2(nv, max_dot); + k2= MIN2(k2, 0.95); + bound_sin_tan= (1 - k1*k1) / k2; /* TODO: optim: these values can be precomputed (also in shadeoutput.c) */ A = 1.0f - 0.5f * rough_sq / (rough_sq + 0.33f); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16089] branches/soc-2008-nicholasbishop/ source/blender: _Finally_ got the conversion from old multires files to the new kind working .
Revision: 16089 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16089 Author: nicholasbishop Date: 2008-08-14 01:26:25 +0200 (Thu, 14 Aug 2008) Log Message: --- _Finally_ got the conversion from old multires files to the new kind working. Still some cleanups to do, and a couple of performance fixes, but it works OK now. Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/readfile.c Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-08-13 22:00:49 UTC (rev 16088) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-08-13 23:26:25 UTC (rev 16089) @@ -126,6 +126,8 @@ int x, y, ax, ay; } MultiresDisplacer; + +void multires_load_old(struct DerivedMesh *, struct Multires *); void multires_force_update(struct Object *ob); struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, struct DerivedMesh*, Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-08-13 22:00:49 UTC (rev 16088) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-08-13 23:26:25 UTC (rev 16089) @@ -817,6 +817,297 @@ static const int multires_tri_tot[] = {3, 7, 19, 61, 217, 817, 3169, 12481, 49537, 197377, 787969, 3148801, 12589057}; static const int multires_side_tot[] = {2, 3, 5, 9, 17, 33, 65, 129, 257, 513,1025,2049,4097}; +static void create_old_vert_face_map(ListBase **map, IndexNode **mem, const MultiresFace *mface, +const int totvert, const int totface) +{ + int i,j; + IndexNode *node = NULL; + + (*map) = MEM_callocN(sizeof(ListBase) * totvert, "vert face map"); + (*mem) = MEM_callocN(sizeof(IndexNode) * totface*4, "vert face map mem"); + node = *mem; + + /* Find the users */ + for(i = 0; i < totface; ++i){ + for(j = 0; j < (mface[i].v[3]?4:3); ++j, ++node) { + node->index = i; + BLI_addtail(&(*map)[mface[i].v[j]], node); + } + } +} + +static void create_old_vert_edge_map(ListBase **map, IndexNode **mem, const MultiresEdge *medge, +const int totvert, const int totedge) +{ + int i,j; + IndexNode *node = NULL; + + (*map) = MEM_callocN(sizeof(ListBase) * totvert, "vert edge map"); + (*mem) = MEM_callocN(sizeof(IndexNode) * totedge*2, "vert edge map mem"); + node = *mem; + + /* Find the users */ + for(i = 0; i < totedge; ++i){ + for(j = 0; j < 2; ++j, ++node) { + node->index = i; + BLI_addtail(&(*map)[medge[i].v[j]], node); + } + } +} + +static MultiresFace *find_old_face(ListBase *map, MultiresFace *faces, int v1, int v2, int v3, int v4) +{ + IndexNode *n1; + int v[4] = {v1, v2, v3, v4}, i, j; + + for(n1 = map[v1].first; n1; n1 = n1->next) { + int fnd[4] = {0, 0, 0, 0}; + + for(i = 0; i < 4; ++i) { + for(j = 0; j < 4; ++j) { + if(v[i] == faces[n1->index].v[j]) + fnd[i] = 1; + } + } + + if(fnd[0] && fnd[1] && fnd[2] && fnd[3]) + return &faces[n1->index]; + } + + return NULL; +} + +static MultiresEdge *find_old_edge(ListBase *map, MultiresEdge *edges, int v1, int v2) +{ + IndexNode *n1, *n2; + + for(n1 = map[v1].first; n1; n1 = n1->next) { + for(n2 = map[v2].first; n2; n2 = n2->next) { + if(n1->index == n2->index) + return &edges[n1->index]; + } + } + + return NULL; +} + +static void multires_load_old_edges(ListBase **emap, MultiresLevel *lvl, int *vvmap, int dst, int v1, int v2, int mov) +{ + int emid = find_old_edge(emap[2], lvl->edges, v1, v2)->mid; + vvmap[dst + mov] = emid; + + if(lvl->next->next) { + multires_load_old_edges(emap + 1, lvl->next, vvmap, dst + mov, v1, emid, mov / 2); + multires_load_old_edges(emap + 1, lvl->next, vvmap, dst + mov, v2, emid, -mov / 2); + } +} + +static void multires_load_old_faces(ListBase **fmap,
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16090] branches/soc-2008-nicholasbishop/ source/blender/blenkernel/intern/multires.c: For loading old files: no need to generate maps for the last le
Revision: 16090 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16090 Author: nicholasbishop Date: 2008-08-14 01:31:29 +0200 (Thu, 14 Aug 2008) Log Message: --- For loading old files: no need to generate maps for the last level. Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-08-13 23:26:25 UTC (rev 16089) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-08-13 23:31:29 UTC (rev 16090) @@ -1040,13 +1040,13 @@ } - /* calculate vert to edge/face maps for each level */ - fmap = MEM_callocN(sizeof(ListBase*) * mr->level_count, "multires fmap"); - emap = MEM_callocN(sizeof(ListBase*) * mr->level_count, "multires emap"); - fmem = MEM_callocN(sizeof(IndexNode*) * mr->level_count, "multires fmem"); - emem = MEM_callocN(sizeof(IndexNode*) * mr->level_count, "multires emem"); + /* calculate vert to edge/face maps for each level (except the last) */ + fmap = MEM_callocN(sizeof(ListBase*) * (mr->level_count-1), "multires fmap"); + emap = MEM_callocN(sizeof(ListBase*) * (mr->level_count-1), "multires emap"); + fmem = MEM_callocN(sizeof(IndexNode*) * (mr->level_count-1), "multires fmem"); + emem = MEM_callocN(sizeof(IndexNode*) * (mr->level_count-1), "multires emem"); lvl = lvl1; - for(i = 0; i < mr->level_count; ++i) { + for(i = 0; i < mr->level_count - 1; ++i) { create_old_vert_face_map(fmap + i, fmem + i, lvl->faces, lvl->totvert, lvl->totface); create_old_vert_edge_map(emap + i, emem + i, lvl->edges, lvl->totvert, lvl->totedge); lvl = lvl->next; @@ -1054,41 +1054,36 @@ /* Interior face verts */ lvl = lvl1->next->next; - for(i = 3; i <= 3/*(mr->level_count*/; ++i) { - tottri = totquad = 0; - dst = 0; - for(j = 0; j < lvl1->totface; ++j) { - int sides = lvl1->faces[j].v[3] ? 4 : 3; - int ldst = dst + 1 + sides * (st - 1); + dst = 0; + for(j = 0; j < lvl1->totface; ++j) { + int sides = lvl1->faces[j].v[3] ? 4 : 3; + int ldst = dst + 1 + sides * (st - 1); - for(s = 0; s < sides; ++s) { - int st2 = multires_side_tot[totlvl - 2] - 2; - int st3 = multires_side_tot[totlvl - 3] - 2; - int st4 = st3 == 0 ? 1 : (st3 + 1) / 2; - int mid = ldst + st2 * st3 + st3; - int cv = lvl1->faces[j].v[s]; - int nv = lvl1->faces[j].v[s == sides - 1 ? 0 : s + 1]; - int pv = lvl1->faces[j].v[s == 0 ? sides - 1 : s - 1]; + for(s = 0; s < sides; ++s) { + int st2 = multires_side_tot[totlvl - 2] - 2; + int st3 = multires_side_tot[totlvl - 3] - 2; + int st4 = st3 == 0 ? 1 : (st3 + 1) / 2; + int mid = ldst + st2 * st3 + st3; + int cv = lvl1->faces[j].v[s]; + int nv = lvl1->faces[j].v[s == sides - 1 ? 0 : s + 1]; + int pv = lvl1->faces[j].v[s == 0 ? sides - 1 : s - 1]; - multires_load_old_faces(fmap, emap, lvl1->next, vvmap, mid, - vvmap[dst], cv, - find_old_edge(emap[0], lvl1->edges, pv, cv)->mid, - find_old_edge(emap[0], lvl1->edges, cv, nv)->mid, - st2, st4); + multires_load_old_faces(fmap, emap, lvl1->next, vvmap, mid, + vvmap[dst], cv, + find_old_edge(emap[0], lvl1->edges, pv, cv)->mid, + find_old_edge(emap[0], lvl1->edges, cv, nv)->mid, + st2, s
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16091] branches/soc-2008-nicholasbishop/ source/blender: Better performance for loading old multires files by blocking multires updates during subdiv
Revision: 16091 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16091 Author: nicholasbishop Date: 2008-08-14 01:36:23 +0200 (Thu, 14 Aug 2008) Log Message: --- Better performance for loading old multires files by blocking multires updates during subdivision. Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/readfile.c branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-08-13 23:31:29 UTC (rev 16090) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-08-13 23:36:23 UTC (rev 16091) @@ -135,7 +135,7 @@ int multiresModifier_switch_level(struct Object *ob, const int); void multiresModifier_join(struct Object *ob); -void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob); +void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob, int updateblock); void multiresModifier_setLevel(void *mmd_v, void *ob_v); int multiresModifier_reshape(struct MultiresModifierData *mmd, struct Object *dst, struct Object *src); Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-08-13 23:31:29 UTC (rev 16090) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-08-13 23:36:23 UTC (rev 16091) @@ -1181,7 +1181,7 @@ /* TODO: subdivision should be doable in one step rather than iteratively. */ for(i = mmd->totlvl; i < highest_lvl; ++i) - multiresModifier_subdivide(mmd, base->object); + multiresModifier_subdivide(mmd, base->object, 0); } } base = base->next; @@ -1466,13 +1466,13 @@ mrdm->release(mrdm); } -void multiresModifier_subdivide(MultiresModifierData *mmd, Object *ob) +void multiresModifier_subdivide(MultiresModifierData *mmd, Object *ob, int updateblock) { DerivedMesh *final = NULL; int totsubvert, totsubface, totsubedge; Mesh *me = get_mesh(ob); MDisps *mdisps; - int i, slo, shi; + int i; if(mmd->totlvl == multires_max_levels) { // TODO @@ -1484,15 +1484,11 @@ ++mmd->lvl; ++mmd->totlvl; - slo = multires_side_tot[mmd->totlvl - 2]; - shi = multires_side_tot[mmd->totlvl - 1]; - mdisps = CustomData_get_layer(&me->fdata, CD_MDISPS); if(!mdisps) mdisps = CustomData_add_layer(&me->fdata, CD_MDISPS, CD_DEFAULT, NULL, me->totface); - - if(mdisps->disps) { + if(mdisps->disps && !updateblock) { DerivedMesh *orig, *mrdm; MultiresModifierData mmd_sub; @@ -1523,7 +1519,7 @@ } - if(final) { + if(final && !updateblock) { DerivedMesh *orig; orig = CDDM_from_mesh(me, NULL); Modified: branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/readfile.c === --- branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/readfile.c 2008-08-13 23:31:29 UTC (rev 16090) +++ branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/readfile.c 2008-08-13 23:36:23 UTC (rev 16091) @@ -7793,7 +7793,7 @@ BLI_insertlinkbefore(&ob->modifiers, md, mmd); for(i = 1; i < me->mr->level_count; ++i) - multiresModifier_subdivide(mmd, ob); + multiresModifier_subdivide(mmd, ob, 1); mmd->lvl = mmd->totlvl; orig = CDDM_from_mesh(me, NULL); Modified: branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c === --- branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c 2008-08-13 23:31:29 UTC (rev 16090) +++ branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c 2008-08-13 23:36:23 UTC (rev 16091) @@ -1666,7 +1666,7 @@ MultiresModifierData *mmd = mmd_v; if(mmd && ob_v
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16092] branches/soc-2008-nicholasbishop/ source/blender: Removed a bunch of references to the old multires.
Revision: 16092 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16092 Author: nicholasbishop Date: 2008-08-14 01:53:28 +0200 (Thu, 14 Aug 2008) Log Message: --- Removed a bunch of references to the old multires. Note: python needs updating to work with the new multires. For now, I've just been commenting out the python multires stuff with #warnings Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/subsurf_ccg.c branches/soc-2008-nicholasbishop/source/blender/include/multires.h branches/soc-2008-nicholasbishop/source/blender/python/api2_2x/Mesh.c branches/soc-2008-nicholasbishop/source/blender/render/intern/source/convertblender.c branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c branches/soc-2008-nicholasbishop/source/blender/src/multires.c Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/subsurf_ccg.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/subsurf_ccg.c 2008-08-13 23:36:23 UTC (rev 16091) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/subsurf_ccg.c 2008-08-13 23:53:28 UTC (rev 16092) @@ -64,8 +64,6 @@ #include "CCGSubSurf.h" -#include "multires.h" - typedef struct _VertData { float co[3]; float no[3]; Modified: branches/soc-2008-nicholasbishop/source/blender/include/multires.h === --- branches/soc-2008-nicholasbishop/source/blender/include/multires.h 2008-08-13 23:36:23 UTC (rev 16091) +++ branches/soc-2008-nicholasbishop/source/blender/include/multires.h 2008-08-13 23:53:28 UTC (rev 16092) @@ -30,30 +30,8 @@ #ifndef MULTIRES_H #define MULTIRES_H -struct CustomData; -struct EditMesh; -struct Object; -struct MDeformVert; -struct Mesh; -struct MultiresLevel; -struct Multires; -struct uiBlock; - /* For canceling operations that don't work with multires on or on a non-base level */ int multires_test(); int multires_level1_test(); -void multires_draw_interface(struct uiBlock *block, unsigned short cx, unsigned short cy); - -void multires_make(void *ob, void *me); -void multires_delete(void *ob, void *me); -void multires_level_to_editmesh(struct Object *ob, struct Mesh *me, const int render); -void multires_finish_mesh_update(struct Object *ob); -void multires_subdivide(void *ob, void *me); -void multires_del_lower(void *ob, void *me); -void multires_del_higher(void *ob, void *me); -void multires_set_level_cb(void *ob, void *me); -void multires_edge_level_update_cb(void *ob, void *me); -int multires_modifier_warning(); - #endif Modified: branches/soc-2008-nicholasbishop/source/blender/python/api2_2x/Mesh.c === --- branches/soc-2008-nicholasbishop/source/blender/python/api2_2x/Mesh.c 2008-08-13 23:36:23 UTC (rev 16091) +++ branches/soc-2008-nicholasbishop/source/blender/python/api2_2x/Mesh.c 2008-08-13 23:53:28 UTC (rev 16092) @@ -87,7 +87,6 @@ #include "constant.h" #include "gen_utils.h" #include "gen_library.h" -#include "multires.h" /* EXPP Mesh defines */ @@ -7157,19 +7156,20 @@ "value out of range" ); switch (GET_INT_FROM_POINTER(type)) { +#warning "Python needs to be updated to work with the new multires." case MESH_MULTIRES_LEVEL: - self->mesh->mr->newlvl = i; - multires_set_level_cb(self->object, self->mesh); + /*self->mesh->mr->newlvl = i; + multires_set_level_cb(self->object, self->mesh);*/ break; case MESH_MULTIRES_EDGE: - self->mesh->mr->edgelvl = i; - multires_edge_level_update(self->object, self->mesh); + /*self->mesh->mr->edgelvl = i; + multires_edge_level_update(self->object, self->mesh);*/ break; case MESH_MULTIRES_PIN: - self->mesh->mr->pinlvl = i; + /*self->mesh->mr->pinlvl = i;*/ break; case MESH_MULTIRES_RENDER: - self->mesh->mr->renderlvl = i; + /*self->mesh->mr->renderlvl = i;*/ break; } @@ -8061,14 +8061,14 @@ if( !param ) { if ( mesh->mr ) { - multires_delete(self->object, mesh); + /*multires_delete(self->object, mesh);*/ } } else { if ( !mesh->mr ) { if (mesh->key) return EXPP_ReturnIntError( PyExc_RuntimeError, "Cannot enable multires for a mesh wi
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16093] branches/soc-2008-nicholasbishop/ source/blender: Removed huge tons of old multires stuff.
Revision: 16093 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16093 Author: nicholasbishop Date: 2008-08-14 02:05:39 +0200 (Thu, 14 Aug 2008) Log Message: --- Removed huge tons of old multires stuff. Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c branches/soc-2008-nicholasbishop/source/blender/src/drawview.c branches/soc-2008-nicholasbishop/source/blender/src/editdeform.c branches/soc-2008-nicholasbishop/source/blender/src/editmesh.c branches/soc-2008-nicholasbishop/source/blender/src/editmesh_add.c branches/soc-2008-nicholasbishop/source/blender/src/editmesh_mods.c branches/soc-2008-nicholasbishop/source/blender/src/editmesh_tools.c branches/soc-2008-nicholasbishop/source/blender/src/editsima.c branches/soc-2008-nicholasbishop/source/blender/src/header_view3d.c branches/soc-2008-nicholasbishop/source/blender/src/sculptmode.c branches/soc-2008-nicholasbishop/source/blender/src/space.c branches/soc-2008-nicholasbishop/source/blender/src/vpaint.c Removed Paths: - branches/soc-2008-nicholasbishop/source/blender/include/multires.h branches/soc-2008-nicholasbishop/source/blender/src/multires.c Deleted: branches/soc-2008-nicholasbishop/source/blender/include/multires.h === --- branches/soc-2008-nicholasbishop/source/blender/include/multires.h 2008-08-13 23:53:28 UTC (rev 16092) +++ branches/soc-2008-nicholasbishop/source/blender/include/multires.h 2008-08-14 00:05:39 UTC (rev 16093) @@ -1,37 +0,0 @@ -/* - * $Id$ - * - * * BEGIN GPL LICENSE BLOCK * - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2006 by Nicholas Bishop - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * * END GPL LICENSE BLOCK * - */ - -#ifndef MULTIRES_H -#define MULTIRES_H - -/* For canceling operations that don't work with multires on or on a non-base level */ -int multires_test(); -int multires_level1_test(); - -#endif Modified: branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c === --- branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c 2008-08-13 23:53:28 UTC (rev 16092) +++ branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c 2008-08-14 00:05:39 UTC (rev 16093) @@ -178,7 +178,6 @@ #include "RE_render_ext.h" // make_sticky #include "butspace.h" // own module -#include "multires.h" static float editbutweight= 1.0; float editbutvweight= 1; @@ -5843,16 +5842,14 @@ allqueue(REDRAWBUTSEDIT, 0); break; case B_CLR_WPAINT: - if(!multires_level1_test()) { - defGroup = BLI_findlink(&ob->defbase, ob->actdef-1); - if(defGroup) { - Mesh *me= ob->data; - int a; - for(a=0; atotvert; a++) - remove_vert_defgroup (ob, defGroup, a); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } + defGroup = BLI_findlink(&ob->defbase, ob->actdef-1); + if(defGroup) { + Mesh *me= ob->data; + int a; + for(a=0; atotvert; a++) + remove_vert_defgroup (ob, defGroup, a); + allqueue(REDRAWVIEW3D, 0); + DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); } break; case B_SCULPT_TEXBROWSE: Modified: branches/soc-2008-nicholasbishop/source/blender/src/drawview.c === --- branches/soc-2008-nicholasbishop/source/blender/src/drawview.c 2008-08-13 23:53:28 UTC (rev 16092) +++ branches/soc-2008-nicholasbishop/source/blender/src/drawview.c 2008-08-14 00:05:39 UTC (rev 1
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16094] branches/soc-2008-nicholasbishop/ source/blender: Added back the choice between simple subdiv vs.
Revision: 16094 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16094 Author: nicholasbishop Date: 2008-08-14 02:42:54 +0200 (Thu, 14 Aug 2008) Log Message: --- Added back the choice between simple subdiv vs. catmull clark for multires. Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/readfile.c branches/soc-2008-nicholasbishop/source/blender/makesdna/DNA_modifier_types.h branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-08-14 00:05:39 UTC (rev 16093) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-08-14 00:42:54 UTC (rev 16094) @@ -135,7 +135,7 @@ int multiresModifier_switch_level(struct Object *ob, const int); void multiresModifier_join(struct Object *ob); -void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob, int updateblock); +void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob, int updateblock, int simple); void multiresModifier_setLevel(void *mmd_v, void *ob_v); int multiresModifier_reshape(struct MultiresModifierData *mmd, struct Object *dst, struct Object *src); Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-08-14 00:05:39 UTC (rev 16093) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-08-14 00:42:54 UTC (rev 16094) @@ -1181,7 +1181,7 @@ /* TODO: subdivision should be doable in one step rather than iteratively. */ for(i = mmd->totlvl; i < highest_lvl; ++i) - multiresModifier_subdivide(mmd, base->object, 0); + multiresModifier_subdivide(mmd, base->object, 0, 0); } } base = base->next; @@ -1245,13 +1245,16 @@ VecCopyf(target, orco[f->v1]); } -DerivedMesh *multires_subdisp_pre(DerivedMesh *mrdm, int distance) +DerivedMesh *multires_subdisp_pre(DerivedMesh *mrdm, int distance, int simple) { DerivedMesh *final; SubsurfModifierData smd; memset(&smd, 0, sizeof(SubsurfModifierData)); smd.levels = distance; + if(simple) + smd.subdivType = ME_SIMPLE_SUBSURF; + final = subsurf_make_derived_from_derived_with_multires(mrdm, &smd, NULL, 0, NULL, 0, 0); return final; @@ -1454,11 +1457,6 @@ } } - /*if(addverts) { - for(i = 0; i < totvert; ++i) - VecAddf(mvd[i].co, mvd[i].co, addverts[i].co); - }*/ - final->needsFree = 1; final->release(final); mrdm->needsFree = 1; @@ -1466,7 +1464,7 @@ mrdm->release(mrdm); } -void multiresModifier_subdivide(MultiresModifierData *mmd, Object *ob, int updateblock) +void multiresModifier_subdivide(MultiresModifierData *mmd, Object *ob, int updateblock, int simple) { DerivedMesh *final = NULL; int totsubvert, totsubface, totsubedge; @@ -1501,7 +1499,7 @@ orig->needsFree = 1; orig->release(orig); - final = multires_subdisp_pre(mrdm, 1); + final = multires_subdisp_pre(mrdm, 1, simple); mrdm->needsFree = 1; mrdm->release(mrdm); } @@ -1903,7 +1901,7 @@ for(i = 0; i < dm->getNumVerts(dm); ++i) VecSubf(verts_new[i].co, verts_new[i].co, cur_lvl_orig_verts[i].co); - final = multires_subdisp_pre(dm, totlvl - lvl); + final = multires_subdisp_pre(dm, totlvl - lvl, 0); multires_subdisp(orig, me, final, lvl, totlvl, dm->getNumVerts(dm), dm->getNumEdges(dm), dm->getNumFaces(dm), 1); Modified: branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/readfile.c === --- branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/readfile.c 2008-08-14 00:05:39 UTC (rev 16093) +++ branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/readfile.c 2008-08-14 00:42:54 UTC (rev 16094) @@ -7793,7 +7793
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16095] branches/soc-2008-nicholasbishop/ source/blender: Removed *yet more!* old crufty multires stuff.
Revision: 16095 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16095 Author: nicholasbishop Date: 2008-08-14 03:14:46 +0200 (Thu, 14 Aug 2008) Log Message: --- Removed *yet more!* old crufty multires stuff. I think this is all of it now. Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/mesh.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c branches/soc-2008-nicholasbishop/source/blender/makesdna/DNA_meshdata_types.h branches/soc-2008-nicholasbishop/source/blender/render/intern/include/render_types.h branches/soc-2008-nicholasbishop/source/blender/render/intern/source/convertblender.c branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c branches/soc-2008-nicholasbishop/source/blender/src/editface.c branches/soc-2008-nicholasbishop/source/blender/src/editkey.c branches/soc-2008-nicholasbishop/source/blender/src/editmesh_mods.c branches/soc-2008-nicholasbishop/source/blender/src/editobject.c branches/soc-2008-nicholasbishop/source/blender/src/meshtools.c Removed Paths: - branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires-firstlevel.c Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-08-14 00:42:54 UTC (rev 16094) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-08-14 01:14:46 UTC (rev 16095) @@ -37,7 +37,6 @@ struct Object; /* Level access */ -struct MultiresLevel *current_level(struct Multires *mr); struct MultiresLevel *multires_level_n(struct Multires *mr, int n); /* Level control */ Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/mesh.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/mesh.c 2008-08-14 00:42:54 UTC (rev 16094) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/mesh.c 2008-08-14 01:14:46 UTC (rev 16095) @@ -58,7 +58,6 @@ #include "BKE_DerivedMesh.h" #include "BKE_global.h" #include "BKE_mesh.h" -#include "BKE_multires.h" #include "BKE_subsurf.h" #include "BKE_displist.h" #include "BKE_library.h" @@ -182,8 +181,6 @@ if(me->bb) MEM_freeN(me->bb); if(me->mselect) MEM_freeN(me->mselect); - - if(me->mr) multires_free(me->mr); } void copy_dverts(MDeformVert *dst, MDeformVert *src, int copycount) @@ -271,9 +268,6 @@ } } - if(me->mr) - men->mr= multires_copy(me->mr); - men->mselect= NULL; men->bb= MEM_dupallocN(men->bb); Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c 2008-08-14 00:42:54 UTC (rev 16094) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c 2008-08-14 01:14:46 UTC (rev 16095) @@ -5709,7 +5709,6 @@ DerivedMesh *dm = derivedData; ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md; ParticleSystem * psys=0; - Mesh *me; int needsFree=0; if(ob->particlesystem.first) @@ -5717,14 +5716,6 @@ else return; - /* multires check */ - if(ob->type == OB_MESH) { - me= (Mesh*)ob->data; - if(me->mr && me->mr->current != 1) - modifier_setError(md, - "Particles only supported on first multires level."); - } - if(!psys_check_enabled(ob, psys)) return; Deleted: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires-firstlevel.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires-firstlevel.c 2008-08-14 00:42:54 UTC (rev 16094) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires-firstlevel.c 2008-08-14 01:14:46 UTC (rev 16095) @@ -1,409 +0,0 @@ -/* - * $Id$ - * - * * BEGIN GPL LICENSE BLOCK * - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16096] branches/soc-2008-nicholasbishop: Merge with r16081
Revision: 16096 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16096 Author: nicholasbishop Date: 2008-08-14 03:36:55 +0200 (Thu, 14 Aug 2008) Log Message: --- Merge with r16081 Modified Paths: -- branches/soc-2008-nicholasbishop/CMakeLists.txt branches/soc-2008-nicholasbishop/SConstruct branches/soc-2008-nicholasbishop/bin/.blender/.Blanguages branches/soc-2008-nicholasbishop/config/linux2-config.py branches/soc-2008-nicholasbishop/intern/boolop/SConscript branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Edge.cpp branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Edge.h branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Face.cpp branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Face.h branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Interface.cpp branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Merge.cpp branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Merge.h branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Mesh.cpp branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Mesh.h branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Tag.h branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Vertex.cpp branches/soc-2008-nicholasbishop/intern/boolop/intern/BOP_Vertex.h branches/soc-2008-nicholasbishop/intern/boolop/make/msvc_7_0/boolop.vcproj branches/soc-2008-nicholasbishop/intern/bsp/SConscript branches/soc-2008-nicholasbishop/projectfiles_vc7/blender/BPY_python/BPY_python.vcproj branches/soc-2008-nicholasbishop/projectfiles_vc7/blender/blender.sln branches/soc-2008-nicholasbishop/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj branches/soc-2008-nicholasbishop/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj branches/soc-2008-nicholasbishop/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj branches/soc-2008-nicholasbishop/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Sumo/PHY_Sumo.vcproj branches/soc-2008-nicholasbishop/release/scripts/bpymodules/colladaImEx/collada.py branches/soc-2008-nicholasbishop/release/scripts/bpymodules/colladaImEx/cstartup.py branches/soc-2008-nicholasbishop/release/scripts/bpymodules/colladaImEx/helperObjects.py branches/soc-2008-nicholasbishop/release/scripts/bpymodules/colladaImEx/translator.py branches/soc-2008-nicholasbishop/release/scripts/bpymodules/colladaImEx/xmlUtils.py branches/soc-2008-nicholasbishop/release/scripts/flt_export.py branches/soc-2008-nicholasbishop/release/scripts/flt_palettemanager.py branches/soc-2008-nicholasbishop/release/scripts/import_dxf.py branches/soc-2008-nicholasbishop/release/scripts/ply_export.py branches/soc-2008-nicholasbishop/release/scripts/rvk1_torvk2.py branches/soc-2008-nicholasbishop/release/scripts/weightpaint_clean.py branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_DerivedMesh.h branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_blender.h branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_texture.h branches/soc-2008-nicholasbishop/source/blender/blenkernel/bad_level_call_stubs/stubs.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/DerivedMesh.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/anim.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/collision.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/customdata.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/modifier.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/particle.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/particle_system.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/softbody.c branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/texture.c branches/soc-2008-nicholasbishop/source/blender/blenlib/BLI_kdopbvh.h branches/soc-2008-nicholasbishop/source/blender/blenlib/intern/BLI_kdopbvh.c branches/soc-2008-nicholasbishop/source/blender/blenlib/intern/boxpack2d.c branches/soc-2008-nicholasbishop/source/blender/blenlib/intern/freetypefont.c branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/readfile.c branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/writefile.c branches/soc-2008-nicholasbishop/source/blender/imbuf/intern/anim.c branches/soc-2008-nicholasbishop/source/blender/include/BDR_gpencil.h branches/soc-2008-nicholasbishop/source/blender/include/BIF_editarmature.h branches/soc-2008-nicholasbishop/source/blender/include/BIF_editmesh.h branches/soc-2008-nicholasbishop/source/blender/include/BIF_editview.h branches/soc-2008-nicholasbishop/source/blender/include/BIF_poseobject.h branches/s
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16097] branches/soc-2008-jaguarandi/ source/blender: Added subsurface levels option to normal projection.
Revision: 16097 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16097 Author: jaguarandi Date: 2008-08-14 05:05:13 +0200 (Thu, 14 Aug 2008) Log Message: --- Added subsurface levels option to normal projection. Now when doing normal projeciton is possible to ask it to project along the normals that the vertex would have if it was subsurfaced... this gives "better" projections on low polys. Point of this commit is to add the feature request from Eclectiel http://blenderartists.org/forum/showpost.php?p=1181531&postcount=9 workflow as Eclectiel wanted is now possible: to archieve a nice low-res retopology that aproximates a high-res mesh when subsurfaced: 1 - make base low-poly retopo 2 - apply a shrinkwrap with projection along normal.. and with SS level = N (where N>0) 3 - add a Subsurface with level N 4 - run bretch's script (ss_fit) Modified Paths: -- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c branches/soc-2008-jaguarandi/source/blender/makesdna/DNA_modifier_types.h branches/soc-2008-jaguarandi/source/blender/src/buttons_editing.c Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c === --- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c 2008-08-14 01:36:55 UTC (rev 16096) +++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/modifier.c 2008-08-14 03:05:13 UTC (rev 16097) @@ -7316,7 +7316,7 @@ if(dataMask) { if(derivedData) dm = CDDM_copy(derivedData); - else if(ob->type==OB_MESH) dm = CDDM_from_editmesh(editData, ob); + else if(ob->type==OB_MESH) dm = CDDM_from_editmesh(editData, ob->data); else return; if(dataMask & CD_MVERT) Modified: branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c === --- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c 2008-08-14 01:36:55 UTC (rev 16096) +++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c 2008-08-14 03:05:13 UTC (rev 16097) @@ -32,10 +32,12 @@ #include #include #include +#include #include "DNA_object_types.h" #include "DNA_modifier_types.h" #include "DNA_meshdata_types.h" +#include "DNA_mesh_types.h" #include "BKE_shrinkwrap.h" #include "BKE_DerivedMesh.h" @@ -44,6 +46,7 @@ #include "BKE_cdderivedmesh.h" #include "BKE_displist.h" #include "BKE_global.h" +#include "BKE_subsurf.h" #include "BLI_arithb.h" #include "BLI_kdtree.h" @@ -344,6 +347,7 @@ const char use_normal= calc->smd->shrinkOpts; float proj_axis[3] = {0.0f, 0.0f, 0.0f}; MVert *vert = NULL; //Needed in case of vertex normal + DerivedMesh* ss_mesh = NULL; //Vertex group data const int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name); @@ -359,11 +363,46 @@ BVHTreeFromMesh auxData= NULL_BVHTreeFromMesh; SpaceTransform local2aux; +do +{ //Prepare data to retrieve the direction in which we should project each vertex if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) { - vert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MVERT) : NULL; + //No Mvert information: jump to "free memory and return" part + if(calc->original == NULL) break; + + if(calc->smd->subsurfLevels) + { + SubsurfModifierData smd; + memset(&smd, 0, sizeof(smd)); + smd.subdivType = ME_CC_SUBSURF; //catmull clark + smd.levels = calc->smd->subsurfLevels; //levels + + ss_mesh = subsurf_make_derived_from_derived(calc->original, &smd, FALSE, NULL, 0, 0); + + if(ss_mesh) + { + vert = ss_mesh->getVertDataArray(ss_mesh, CD_MVERT); + if(vert) + { + //TRICKY: this code assumes subsurface will have the transformed original vertices + //in their original order at the end of the vert array. + vert = vert ++ ss_mesh->getNumVerts(ss_mesh) +- calc->original->getNumVerts(calc->original); + } + } + + //To make sure we are not letting any memory behind + assert
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16098] trunk/blender/source/gameengine: game engine python api
Revision: 16098 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16098 Author: campbellbarton Date: 2008-08-14 05:23:36 +0200 (Thu, 14 Aug 2008) Log Message: --- game engine python api * removed macros that were not used much, some misleading. * removed error string setting calls that overwrote the error set by PyArg_ParseTuple with a less useful one. * use python macros Py_RETURN_NONE, Py_RETURN_TRUE, Py_RETURN_FALSE Modified Paths: -- trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp trunk/blender/source/gameengine/Expressions/InputParser.cpp trunk/blender/source/gameengine/Expressions/ListValue.cpp trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp trunk/blender/source/gameengine/Expressions/PyObjectPlus.h trunk/blender/source/gameengine/Expressions/Value.cpp trunk/blender/source/gameengine/Expressions/Value.h trunk/blender/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp trunk/blender/source/gameengine/GameLogic/SCA_ILogicBrick.cpp trunk/blender/source/gameengine/Ketsji/BL_Shader.cpp trunk/blender/source/gameengine/Ketsji/KX_ConstraintActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp trunk/blender/source/gameengine/Ketsji/KX_IpoActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp trunk/blender/source/gameengine/Ketsji/KX_ObjectActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp trunk/blender/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp trunk/blender/source/gameengine/Ketsji/KX_VehicleWrapper.cpp Modified: trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp === --- trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 2008-08-14 03:05:13 UTC (rev 16097) +++ trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 2008-08-14 03:23:36 UTC (rev 16098) @@ -484,17 +484,10 @@ PyObject* BL_ActionActuator::PyGetAction(PyObject* self, PyObject* args, PyObject* kwds) { - PyObject *result; - if (m_action){ - result = Py_BuildValue("s", m_action->id.name+2); + return PyString_FromString(m_action->id.name+2); } - else{ - Py_INCREF(Py_None); - result = Py_None; - } - - return result; + Py_RETURN_NONE; } /* getProperty */ @@ -640,8 +633,7 @@ return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setStart */ @@ -662,8 +654,7 @@ return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setEnd*/ @@ -684,8 +675,7 @@ return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setBlendin*/ @@ -707,8 +697,7 @@ return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setBlendtime */ @@ -735,8 +724,7 @@ return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setPriority */ @@ -759,8 +747,7 @@ return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setFrame */ @@ -785,8 +772,7 @@ return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setProperty */ @@ -808,8 +794,7 @@ return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* setFrameProperty */ @@ -830,8 +815,7 @@ return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /* @@ -848,8 +832,7 @@ return NULL; } - Py_INCREF(Py_None); - retur
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16099] branches/soc-2008-nicholasbishop/ source/blender: For file loading and mesh joining, allow single-step subdivision (same result, just faster)
Revision: 16099 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16099 Author: nicholasbishop Date: 2008-08-14 06:14:13 +0200 (Thu, 14 Aug 2008) Log Message: --- For file loading and mesh joining, allow single-step subdivision (same result, just faster) Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c branches/soc-2008-nicholasbishop/source/blender/blenloader/intern/readfile.c branches/soc-2008-nicholasbishop/source/blender/src/buttons_editing.c Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-08-14 03:23:36 UTC (rev 16098) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_multires.h 2008-08-14 04:14:13 UTC (rev 16099) @@ -27,50 +27,12 @@ * * END GPL LICENSE BLOCK * */ -struct CustomData; -struct EditMesh; -struct MCol; -struct Multires; -struct MultiresColFace; -struct MultiresLevel; +struct DerivedMesh; struct Mesh; +struct MFace; +struct Multires; struct Object; -/* Level access */ -struct MultiresLevel *multires_level_n(struct Multires *mr, int n); - -/* Level control */ -void multires_set_level(struct Object *ob, struct Mesh *me, const int render); -void multires_free_level(struct MultiresLevel *lvl); - -void multires_edge_level_update(struct Object *ob, struct Mesh *me); - -void multires_free(struct Multires *mr); -struct Multires *multires_copy(struct Multires *orig); -void multires_create(struct Object *ob, struct Mesh *me); - -/* CustomData */ -void multires_delete_layer(struct Mesh *me, struct CustomData *cd, const int type, int n); -void multires_add_layer(struct Mesh *me, struct CustomData *cd, const int type, const int n); -void multires_del_lower_customdata(struct Multires *mr, struct MultiresLevel *cr_lvl); -void multires_to_mcol(struct MultiresColFace *f, struct MCol *mcol); -/* After adding or removing vcolor layers, run this */ -void multires_load_cols(struct Mesh *me); - -/* Private (used in multires-firstlevel.c) */ -void multires_level_to_mesh(struct Object *ob, struct Mesh *me, const int render); -void multires_update_levels(struct Mesh *me, const int render); -void multires_update_first_level(struct Mesh *me, struct EditMesh *em); -void multires_update_customdata(struct MultiresLevel *lvl1, struct EditMesh *em, struct CustomData *src, - struct CustomData *dst, const int type); -void multires_customdata_to_mesh(struct Mesh *me, struct EditMesh *em, -struct MultiresLevel *lvl, struct CustomData *src, - struct CustomData *dst, const int type); - -struct DerivedMesh; -struct MFace; -struct MEdge; - typedef struct MultiresSubsurf { struct Mesh *me; int totlvl, lvl; @@ -81,6 +43,8 @@ int index; } IndexNode; +void multires_free(struct Multires*); + void create_vert_face_map(ListBase **map, IndexNode **mem, const struct MFace *mface, const int totvert, const int totface); @@ -125,7 +89,6 @@ int x, y, ax, ay; } MultiresDisplacer; - void multires_load_old(struct DerivedMesh *, struct Multires *); void multires_force_update(struct Object *ob); @@ -134,7 +97,8 @@ int multiresModifier_switch_level(struct Object *ob, const int); void multiresModifier_join(struct Object *ob); -void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob, int updateblock, int simple); +void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob, int distance, + int updateblock, int simple); void multiresModifier_setLevel(void *mmd_v, void *ob_v); int multiresModifier_reshape(struct MultiresModifierData *mmd, struct Object *dst, struct Object *src); Modified: branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c === --- branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-08-14 03:23:36 UTC (rev 16098) +++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/multires.c 2008-08-14 04:14:13 UTC (rev 16099) @@ -475,13 +475,8 @@ BLI_insertlinkbefore(&base->object->modifiers, md, mmd); } - if(mmd) { - int i; - - /* TODO: subdivision should be doable in one step rather than iteratively. */ - for(i = mmd->totlvl; i < highest_lvl; ++i) - multiresModifier_subdivide(mmd, base->ob
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16100] trunk/blender/source/gameengine/ Ketsji: bugfix (good for 2.47) - 2 cases of returning Py_None without increfing it.
Revision: 16100 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16100 Author: campbellbarton Date: 2008-08-14 07:06:59 +0200 (Thu, 14 Aug 2008) Log Message: --- bugfix (good for 2.47) - 2 cases of returning Py_None without increfing it. this can crash blender. Modified Paths: -- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp === --- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-08-14 04:14:13 UTC (rev 16099) +++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-08-14 05:06:59 UTC (rev 16100) @@ -942,7 +942,7 @@ KX_Scene *scene = PHY_GetActiveScene(); scene->DelayedRemoveObject(this); - return Py_None; + Py_RETURN_NONE; } Modified: trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp === --- trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp 2008-08-14 04:14:13 UTC (rev 16099) +++ trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp 2008-08-14 05:06:59 UTC (rev 16100) @@ -238,5 +238,5 @@ "Reinstance the physics mesh.") { //this needs to be reviewed, it is dependend on Sumo/Solid. Who is using this ? - return Py_None;//(KX_ReInstanceShapeFromMesh(m_meshobj)) ? Py_RETURN_TRUE : Py_RETURN_FALSE; + Py_RETURN_NONE;//(KX_ReInstanceShapeFromMesh(m_meshobj)) ? Py_RETURN_TRUE : Py_RETURN_FALSE; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16101] branches/soc-2008-nicholasbishop/ source/blender/src/usiblender.c: Before saving a file, make sure sculpts to multires are stored in MDisps
Revision: 16101 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16101 Author: nicholasbishop Date: 2008-08-14 07:57:09 +0200 (Thu, 14 Aug 2008) Log Message: --- Before saving a file, make sure sculpts to multires are stored in MDisps Modified Paths: -- branches/soc-2008-nicholasbishop/source/blender/src/usiblender.c Modified: branches/soc-2008-nicholasbishop/source/blender/src/usiblender.c === --- branches/soc-2008-nicholasbishop/source/blender/src/usiblender.c 2008-08-14 05:06:59 UTC (rev 16100) +++ branches/soc-2008-nicholasbishop/source/blender/src/usiblender.c 2008-08-14 05:57:09 UTC (rev 16101) @@ -79,6 +79,7 @@ #include "BKE_global.h" #include "BKE_main.h" #include "BKE_mball.h" +#include "BKE_multires.h" #include "BKE_node.h" #include "BKE_packedFile.h" #include "BKE_texture.h" @@ -903,10 +904,16 @@ if(G.obedit) { exit_editmode(0); /* 0 = no free data */ } + + if(G.f & G_SCULPTMODE) { + Object *ob = OBACT; + multires_force_update(ob); + } + if (G.fileflags & G_AUTOPACK) { packAll(); } - + waitcursor(1); // exit_editmode sets cursor too do_history(di); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16102] branches/blender-2.47/source/ gameengine/Ketsji: branches/blender-2.47
Revision: 16102 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16102 Author: bdiego Date: 2008-08-14 08:09:57 +0200 (Thu, 14 Aug 2008) Log Message: --- branches/blender-2.47 Merge from trunk: Revision: 16100 Modified Paths: -- branches/blender-2.47/source/gameengine/Ketsji/KX_GameObject.cpp branches/blender-2.47/source/gameengine/Ketsji/KX_MeshProxy.cpp Modified: branches/blender-2.47/source/gameengine/Ketsji/KX_GameObject.cpp === --- branches/blender-2.47/source/gameengine/Ketsji/KX_GameObject.cpp 2008-08-14 05:57:09 UTC (rev 16101) +++ branches/blender-2.47/source/gameengine/Ketsji/KX_GameObject.cpp 2008-08-14 06:09:57 UTC (rev 16102) @@ -941,7 +941,7 @@ KX_Scene *scene = PHY_GetActiveScene(); scene->DelayedRemoveObject(this); - return Py_None; + Py_RETURN_NONE; } Modified: branches/blender-2.47/source/gameengine/Ketsji/KX_MeshProxy.cpp === --- branches/blender-2.47/source/gameengine/Ketsji/KX_MeshProxy.cpp 2008-08-14 05:57:09 UTC (rev 16101) +++ branches/blender-2.47/source/gameengine/Ketsji/KX_MeshProxy.cpp 2008-08-14 06:09:57 UTC (rev 16102) @@ -238,5 +238,5 @@ "Reinstance the physics mesh.") { //this needs to be reviewed, it is dependend on Sumo/Solid. Who is using this ? - return Py_None;//Py_Success(KX_ReInstanceShapeFromMesh(m_meshobj)); + Py_RETURN_NONE;//(KX_ReInstanceShapeFromMesh(m_meshobj)) ? Py_RETURN_TRUE : Py_RETURN_FALSE; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16103] trunk/blender/release: Part one of the 2.47 release commit
Revision: 16103 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16103 Author: bdiego Date: 2008-08-14 08:33:19 +0200 (Thu, 14 Aug 2008) Log Message: --- Part one of the 2.47 release commit Modified Paths: -- trunk/blender/release/VERSION trunk/blender/release/datafiles/splash.jpg Added Paths: --- trunk/blender/release/text/release_247.txt Removed Paths: - trunk/blender/release/text/release_246.txt Modified: trunk/blender/release/VERSION === --- trunk/blender/release/VERSION 2008-08-14 06:09:57 UTC (rev 16102) +++ trunk/blender/release/VERSION 2008-08-14 06:33:19 UTC (rev 16103) @@ -1 +1 @@ -2.46 +2.47 Modified: trunk/blender/release/datafiles/splash.jpg === (Binary files differ) Deleted: trunk/blender/release/text/release_246.txt === --- trunk/blender/release/text/release_246.txt 2008-08-14 06:09:57 UTC (rev 16102) +++ trunk/blender/release/text/release_246.txt 2008-08-14 06:33:19 UTC (rev 16103) @@ -1,13 +0,0 @@ -- Blender 2.46 release - -May 2008 - -This is the release of version 2.46, the result of 9 months of development, -including everything as used to render the open movie Big Buck Bunny. - -For html versions of release logs, with images and examples, please check: -http://www.blender.org - -Have fun! - -The blender.org team. Added: trunk/blender/release/text/release_247.txt === --- trunk/blender/release/text/release_247.txt (rev 0) +++ trunk/blender/release/text/release_247.txt 2008-08-14 06:33:19 UTC (rev 16103) @@ -0,0 +1,15 @@ +- Blender 2.47 release + +Aug 2008 + +This is the upgrade release of 2.47, it is a bugfix release to stabilize +the 2.4x series. No new feature have been added, but serious effort has +been put in tracking bugs and fixing them. Some performance issues have +also been addressed. + +For html versions of release logs, please check: +http://www.blender.org + +Have fun! + +The blender.org team. ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16104] trunk/blender/source/blender: Last part of the svn release commit.
Revision: 16104 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16104 Author: bdiego Date: 2008-08-14 08:42:52 +0200 (Thu, 14 Aug 2008) Log Message: --- Last part of the svn release commit. No need freeze, in a sec I merge both revision into the 2.47 branch and tag it. Modified Paths: -- trunk/blender/source/blender/blenkernel/BKE_blender.h trunk/blender/source/blender/src/splash.jpg.c Modified: trunk/blender/source/blender/blenkernel/BKE_blender.h === --- trunk/blender/source/blender/blenkernel/BKE_blender.h 2008-08-14 06:33:19 UTC (rev 16103) +++ trunk/blender/source/blender/blenkernel/BKE_blender.h 2008-08-14 06:42:52 UTC (rev 16104) @@ -40,8 +40,8 @@ struct ListBase; struct MemFile; -#define BLENDER_VERSION246 -#define BLENDER_SUBVERSION 1 +#define BLENDER_VERSION247 +#define BLENDER_SUBVERSION 0 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 Modified: trunk/blender/source/blender/src/splash.jpg.c === --- trunk/blender/source/blender/src/splash.jpg.c 2008-08-14 06:33:19 UTC (rev 16103) +++ trunk/blender/source/blender/src/splash.jpg.c 2008-08-14 06:42:52 UTC (rev 16104) @@ -1,2990 +1,1590 @@ /* DataToC output of file */ -int datatoc_splash_jpg_size= 95515; +int datatoc_splash_jpg_size= 50665; char datatoc_splash_jpg[]= { -255,216,255,224, 0, 16, 74, 70, 73, 70, 0, 1, 2, 0, 0,100, 0,100, 0, 0,255,236, 0, 17, 68,117, 99, -107,121, 0, 1, 0, 4, 0, 0, 0, 95, 0, 0,255,238, 0, 14, 65,100,111, 98,101, 0,100,192, 0, 0, 0, 1,255,219, 0,132, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 1, 1, 1, 1, 2, 1, 2, 3, 2, 2, 3, 4, 4, 3, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5,255,192, 0, 17, 8, 1, 26, 1,245, 3, 1, 17, 0, 2, 17, 1, 3, 17, 1,255,196, 0,230, 0, 0, 0, 6, 3, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, 8, 0, 2, 9, 1, 10, 11, 1, 0, 0, 7, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 0, 1, 3, 3, 3, 1, 4, 4, 9, 8, 5, 8, 5, - 8, 5, 13, 1, 2, 3, 4, 17, 5, 6, 0, 18, 7, 33, 49, 65, 19, 8, 81, 97, 34, 20,113,129,145, 50, 35, 51, 52, 21, 9,240, -161,177,193, 66, 82, 98, 53,225,149,213, 22, 54,209,241,114, 36,212, 69, 85, 24,194, 67, 83, 99,148,130,162,179, 37,117,181, 23, - 55,115,195, 68,133, 10,146,178,210,131,147,211,116,196,165,197, 38, 70, 71, 17, 0, 1, 3, 2, 4, 2, 6, 5, 8, 8, 5, 4, - 2, 1, 5, 1, 1, 17, 2, 3, 0, 4, 33, 49, 18, 5, 65, 6, 81, 97,113, 34, 19, 7,129,145,161, 50, 20,240,177,193,209, 66, -146, 83,211,225,114, 35, 51, 67, 21, 23, 8,241, 82, 98,130,210,178, 36, 52, 22,194,115,162,226, 99, 68,116, 9, 53,255,218, 0, - 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0,251,244,208,161, 89,161, 66,136, 93,149,114, 77,174,228,171, 50, 34,185,119, 76, 9, -106,181, 55, 57, 74, 76, 37,220, 67,106,240, 3,197, 21, 88, 65,114,155,138,122,211,179, 81,175, 76,194, 25, 62, 31, 79,139,164, -232,212,186,117, 39,117, 83, 20, 84, 84,225, 82,172, 68, 38,104,254, 32,184, 69,168,107,210,154,180,175,123, 74,224,168,168,188, -107,147,184, 15,158, 62, 82,226,238, 69,187,224, 62,105,236,206, 52,193,184, 58,148,222, 45,214, 86,160,203,199,208,226,190,140, -161,168,200, 67,115,225,148,252,215, 81,185,116,235, 85,158,131,197, 92,181,253,196,239, 60,147,187, 75,181,115,188, 37,163, 81, - 73, 26,192, 11, 1,201, 3, 64, 18, 68,120, 57,170,239,214,225,237,206,102,254,220,118, 94,120,218, 34,221,185, 26, 96,227,164, - 44,110,121, 34, 66, 51, 82,226, 76,114,142, 45,114, 55,169,185,158,172, 99,217, 21,139, 44,179,192,200, 49,171,180, 27,221,150, -230,194, 36,193,185, 91,100,166, 84, 73, 44,172, 84, 20,173, 4,142,157,132,118,131,208,245,215,180, 54,221,202,223,120,129,151, - 54,178, 54, 72,158, 21,174,105, 5,164, 30, 32,138,241, 62,229,182, 92,108,211,190,214,238, 55, 71, 43, 10, 57,174, 4, 56, 17, -192,131, 75, 58,157, 80,107, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, - 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66, -179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21, -154,