[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43665] branches/bmesh/blender: svn merge ^/trunk/blender -r43639:43664
Campbell Barton
ideasman42 at gmail.com
Tue Jan 24 17:18:31 CET 2012
Revision: 43665
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43665
Author: campbellbarton
Date: 2012-01-24 16:18:20 +0000 (Tue, 24 Jan 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r43639:43664
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43639
Modified Paths:
--------------
branches/bmesh/blender/doc/python_api/examples/bge.constraints.py
branches/bmesh/blender/doc/python_api/examples/bge.texture.1.py
branches/bmesh/blender/doc/python_api/examples/bge.texture.py
branches/bmesh/blender/doc/python_api/rst/bge.constraints.rst
branches/bmesh/blender/doc/python_api/rst/bge.texture.rst
branches/bmesh/blender/doc/python_api/rst/bge.types.rst
branches/bmesh/blender/intern/boolop/intern/BOP_CarveInterface.cpp
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_particle.py
branches/bmesh/blender/source/blender/blenkernel/intern/constraint.c
branches/bmesh/blender/source/blender/blenkernel/intern/smoke.c
branches/bmesh/blender/source/blender/blenkernel/intern/tracking.c
branches/bmesh/blender/source/blender/editors/sculpt_paint/paint_ops.c
branches/bmesh/blender/source/blender/editors/space_clip/tracking_ops.c
branches/bmesh/blender/source/blender/editors/space_outliner/outliner_edit.c
branches/bmesh/blender/source/blender/editors/space_text/text_ops.c
branches/bmesh/blender/source/blender/editors/space_time/space_time.c
branches/bmesh/blender/source/blender/editors/space_view3d/view3d_select.c
branches/bmesh/blender/source/blender/editors/uvedit/uvedit_smart_stitch.c
branches/bmesh/blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c
branches/bmesh/blender/source/blender/makesdna/DNA_smoke_types.h
branches/bmesh/blender/source/blender/makesrna/intern/rna_cloth.c
branches/bmesh/blender/source/blender/makesrna/intern/rna_scene.c
branches/bmesh/blender/source/blender/modifiers/intern/MOD_boolean_util.c
branches/bmesh/blender/source/blender/python/mathutils/mathutils_Matrix.c
Property Changed:
----------------
branches/bmesh/blender/
branches/bmesh/blender/release/
branches/bmesh/blender/source/blender/editors/space_outliner/
Property changes on: branches/bmesh/blender
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:39992-43639
+ /branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:39992-43664
Modified: branches/bmesh/blender/doc/python_api/examples/bge.constraints.py
===================================================================
--- branches/bmesh/blender/doc/python_api/examples/bge.constraints.py 2012-01-24 15:51:44 UTC (rev 43664)
+++ branches/bmesh/blender/doc/python_api/examples/bge.constraints.py 2012-01-24 16:18:20 UTC (rev 43665)
@@ -1,6 +1,6 @@
"""
Basic Physics Constraint
-++++++++++++++++++++++
+++++++++++++++++++++++++
Example of how to create a hinge Physics Constraint between two objects.
"""
from bge import logic
Modified: branches/bmesh/blender/doc/python_api/examples/bge.texture.1.py
===================================================================
--- branches/bmesh/blender/doc/python_api/examples/bge.texture.1.py 2012-01-24 15:51:44 UTC (rev 43664)
+++ branches/bmesh/blender/doc/python_api/examples/bge.texture.1.py 2012-01-24 16:18:20 UTC (rev 43665)
@@ -1,6 +1,6 @@
"""
-Texture replacement
-++++++++++++++++++++++
+Texture Replacement
++++++++++++++++++++
Example of how to replace a texture in game with an external image.
createTexture() and removeTexture() are to be called from a module Python
Controller.
Modified: branches/bmesh/blender/doc/python_api/examples/bge.texture.py
===================================================================
--- branches/bmesh/blender/doc/python_api/examples/bge.texture.py 2012-01-24 15:51:44 UTC (rev 43664)
+++ branches/bmesh/blender/doc/python_api/examples/bge.texture.py 2012-01-24 16:18:20 UTC (rev 43665)
@@ -1,6 +1,6 @@
"""
Basic Video Playback
-++++++++++++++++++++++
+++++++++++++++++++++
Example of how to replace a texture in game with a video. It needs to run everyframe
"""
import bge
Modified: branches/bmesh/blender/doc/python_api/rst/bge.constraints.rst
===================================================================
--- branches/bmesh/blender/doc/python_api/rst/bge.constraints.rst 2012-01-24 15:51:44 UTC (rev 43664)
+++ branches/bmesh/blender/doc/python_api/rst/bge.constraints.rst 2012-01-24 16:18:20 UTC (rev 43665)
@@ -5,7 +5,12 @@
.. module:: bge.constraints
.. literalinclude:: ../examples/bge.constraints.py
+ :language: rest
+ :lines: 2-4
+.. literalinclude:: ../examples/bge.constraints.py
+ :lines: 6-
+
.. function:: createConstraint(physicsid, physicsid2, constrainttype, [pivotX, pivotY, pivotZ, [axisX, axisY, axisZ, [flag]]]])
Creates a constraint.
Modified: branches/bmesh/blender/doc/python_api/rst/bge.texture.rst
===================================================================
--- branches/bmesh/blender/doc/python_api/rst/bge.texture.rst 2012-01-24 15:51:44 UTC (rev 43664)
+++ branches/bmesh/blender/doc/python_api/rst/bge.texture.rst 2012-01-24 16:18:20 UTC (rev 43665)
@@ -37,9 +37,19 @@
.. module:: bge.texture
.. literalinclude:: ../examples/bge.texture.py
+ :language: rest
+ :lines: 2-4
+.. literalinclude:: ../examples/bge.texture.py
+ :lines: 6-
+
.. literalinclude:: ../examples/bge.texture.1.py
+ :language: rest
+ :lines: 2-6
+.. literalinclude:: ../examples/bge.texture.1.py
+ :lines: 8-
+
.. class:: VideoFFmpeg(file [, capture=-1, rate=25.0, width=0, height=0])
FFmpeg video source
Modified: branches/bmesh/blender/doc/python_api/rst/bge.types.rst
===================================================================
--- branches/bmesh/blender/doc/python_api/rst/bge.types.rst 2012-01-24 15:51:44 UTC (rev 43664)
+++ branches/bmesh/blender/doc/python_api/rst/bge.types.rst 2012-01-24 16:18:20 UTC (rev 43665)
@@ -954,7 +954,7 @@
.. deprecated:: use :data:`localPosition` and :data:`worldPosition`.
- :type: :class:`mathurils.Vector`
+ :type: :class:`mathutils.Vector`
.. attribute:: orientation
Modified: branches/bmesh/blender/intern/boolop/intern/BOP_CarveInterface.cpp
===================================================================
--- branches/bmesh/blender/intern/boolop/intern/BOP_CarveInterface.cpp 2012-01-24 15:51:44 UTC (rev 43664)
+++ branches/bmesh/blender/intern/boolop/intern/BOP_CarveInterface.cpp 2012-01-24 16:18:20 UTC (rev 43665)
@@ -15,12 +15,13 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2010 by the Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Ken Hughes,
+ * Sergey Sharybin.
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -36,6 +37,9 @@
#include <carve/interpolator.hpp>
#include <carve/rescale.hpp>
+#include <iostream>
+
+using namespace carve::mesh;
typedef unsigned int uint;
#define MAX(x,y) ((x)>(y)?(x):(y))
@@ -61,11 +65,162 @@
return 1;
}
-static carve::mesh::MeshSet<3> *Carve_addMesh(CSG_FaceIteratorDescriptor& face_it,
- CSG_VertexIteratorDescriptor& vertex_it,
- carve::interpolate::FaceAttr<uint> &oface_num,
- uint &num_origfaces )
+static MeshSet<3> *Carve_meshSetFromMeshes(std::vector<MeshSet<3>::mesh_t*> &meshes)
{
+ std::vector<MeshSet<3>::mesh_t*> new_meshes;
+
+ std::vector<MeshSet<3>::mesh_t*>::iterator it = meshes.begin();
+ for(; it!=meshes.end(); it++) {
+ MeshSet<3>::mesh_t *mesh = *it;
+ MeshSet<3>::mesh_t *new_mesh = new MeshSet<3>::mesh_t(mesh->faces);
+
+ new_meshes.push_back(new_mesh);
+ }
+
+ return new MeshSet<3>(new_meshes);
+}
+
+static void Carve_getIntersectedOperandMeshes(std::vector<MeshSet<3>::mesh_t*> &meshes,
+ std::vector<MeshSet<3>::aabb_t> &precomputedAABB,
+ MeshSet<3>::aabb_t &otherAABB,
+ std::vector<MeshSet<3>::mesh_t*> &operandMeshes)
+{
+ std::vector<MeshSet<3>::mesh_t*>::iterator it = meshes.begin();
+ std::vector<MeshSet<3>::aabb_t>::iterator aabb_it = precomputedAABB.begin();
+ std::vector<MeshSet<3>::aabb_t> usedAABB;
+
+ while(it != meshes.end()) {
+ MeshSet<3>::mesh_t *mesh = *it;
+ MeshSet<3>::aabb_t aabb = mesh->getAABB();
+ bool isIntersect = false;
+
+ std::vector<MeshSet<3>::aabb_t>::iterator used_it = usedAABB.begin();
+ for(; used_it!=usedAABB.end(); used_it++) {
+ MeshSet<3>::aabb_t usedAABB = *used_it;
+
+ if(usedAABB.intersects(aabb) && usedAABB.intersects(otherAABB)) {
+ isIntersect = true;
+ break;
+ }
+ }
+
+ if(!isIntersect) {
+ operandMeshes.push_back(mesh);
+ usedAABB.push_back(aabb);
+
+ it = meshes.erase(it);
+ aabb_it = precomputedAABB.erase(aabb_it);
+ }
+ else {
+ it++;
+ aabb_it++;
+ }
+ }
+}
+
+static MeshSet<3> *Carve_getIntersectedOperand(std::vector<MeshSet<3>::mesh_t*> &meshes,
+ std::vector<MeshSet<3>::aabb_t> &precomputedAABB,
+ MeshSet<3>::aabb_t &otherAABB)
+{
+ std::vector<MeshSet<3>::mesh_t*> operandMeshes;
+ Carve_getIntersectedOperandMeshes(meshes, precomputedAABB, otherAABB, operandMeshes);
+
+ return Carve_meshSetFromMeshes(operandMeshes);
+}
+
+static MeshSet<3> *Carve_unionIntersectingMeshes(MeshSet<3> *poly,
+ std::vector<MeshSet<3>::aabb_t> &precomputedAABB,
+ MeshSet<3>::aabb_t &otherAABB,
+ carve::interpolate::FaceAttr<uint> &oface_num)
+{
+ if(poly->meshes.size()<=1)
+ return poly;
+
+ carve::csg::CSG csg;
+
+ oface_num.installHooks(csg);
+ csg.hooks.registerHook(new carve::csg::CarveTriangulator, carve::csg::CSG::Hooks::PROCESS_OUTPUT_FACE_BIT);
+
+ std::vector<MeshSet<3>::mesh_t*> orig_meshes =
+ std::vector<MeshSet<3>::mesh_t*>(poly->meshes.begin(), poly->meshes.end());
+
+ MeshSet<3> *left = Carve_getIntersectedOperand(orig_meshes, precomputedAABB, otherAABB);
+
+ while(orig_meshes.size()) {
+ MeshSet<3> *right = Carve_getIntersectedOperand(orig_meshes, precomputedAABB, otherAABB);
+
+ try {
+ MeshSet<3> *result = csg.compute(left, right, carve::csg::CSG::UNION, NULL, carve::csg::CSG::CLASSIFY_EDGE);
+
+ delete left;
+ delete right;
+
+ left = result;
+ }
+ catch(carve::exception e) {
+ std::cerr << "CSG failed, exception " << e.str() << std::endl;
+
+ delete right;
+ }
+ catch(...) {
+ delete left;
+ delete right;
+
+ throw "Unknown error in Carve library";
+ }
+ }
+
+ return left;
+}
+
+static MeshSet<3>::aabb_t Carve_computeAABB(MeshSet<3> *poly,
+ std::vector<MeshSet<3>::aabb_t> &precomputedAABB)
+{
+ MeshSet<3>::aabb_t overallAABB;
+ std::vector<MeshSet<3>::mesh_t*>::iterator it = poly->meshes.begin();
+
+ for(; it!=poly->meshes.end(); it++) {
+ MeshSet<3>::aabb_t aabb;
+ MeshSet<3>::mesh_t *mesh = *it;
+
+ aabb = mesh->getAABB();
+ precomputedAABB.push_back(aabb);
+
+ overallAABB.unionAABB(aabb);
+ }
+
+ return overallAABB;
+}
+
+static void Carve_prepareOperands(MeshSet<3> **left_r, MeshSet<3> **right_r,
+ carve::interpolate::FaceAttr<uint> &oface_num)
+{
+ MeshSet<3> *left, *right;
+
+ std::vector<MeshSet<3>::aabb_t> left_precomputedAABB;
+ std::vector<MeshSet<3>::aabb_t> right_precomputedAABB;
+
+ MeshSet<3>::aabb_t leftAABB = Carve_computeAABB(*left_r, left_precomputedAABB);
+ MeshSet<3>::aabb_t rightAABB = Carve_computeAABB(*right_r, right_precomputedAABB);
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list