[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59189] branches/soc-2013-paint: Merge trunk -r59187 into soc-2013-paint

Antony Riakiotakis kalast at gmail.com
Fri Aug 16 15:55:33 CEST 2013


Revision: 59189
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59189
Author:   psy-fi
Date:     2013-08-16 13:55:33 +0000 (Fri, 16 Aug 2013)
Log Message:
-----------
Merge trunk -r59187 into soc-2013-paint

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59187

Modified Paths:
--------------
    branches/soc-2013-paint/build_files/scons/tools/Blender.py
    branches/soc-2013-paint/doc/python_api/rst/bge.logic.rst
    branches/soc-2013-paint/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
    branches/soc-2013-paint/extern/libmv/libmv/multiview/euclidean_resection.cc
    branches/soc-2013-paint/extern/libmv/libmv/multiview/euclidean_resection.h
    branches/soc-2013-paint/extern/libmv/libmv/tracking/track_region.cc
    branches/soc-2013-paint/extern/libmv/libmv-capi.cc
    branches/soc-2013-paint/extern/libmv/libmv-capi.h
    branches/soc-2013-paint/extern/libmv/libmv-capi_stub.cc
    branches/soc-2013-paint/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
    branches/soc-2013-paint/intern/audaspace/OpenAL/AUD_OpenALDevice.h
    branches/soc-2013-paint/intern/audaspace/Python/AUD_PyAPI.cpp
    branches/soc-2013-paint/intern/audaspace/intern/AUD_IHandle.h
    branches/soc-2013-paint/intern/audaspace/intern/AUD_SoftwareDevice.cpp
    branches/soc-2013-paint/intern/audaspace/intern/AUD_SoftwareDevice.h
    branches/soc-2013-paint/intern/audaspace/intern/AUD_Space.h
    branches/soc-2013-paint/intern/cycles/kernel/kernel_shader.h
    branches/soc-2013-paint/intern/cycles/kernel/osl/osl_closures.h
    branches/soc-2013-paint/intern/guardedalloc/intern/mallocn.c
    branches/soc-2013-paint/release/scripts/modules/bpy_extras/image_utils.py
    branches/soc-2013-paint/release/scripts/startup/bl_operators/add_mesh_torus.py
    branches/soc-2013-paint/release/scripts/startup/bl_ui/properties_mask_common.py
    branches/soc-2013-paint/release/scripts/startup/bl_ui/space_clip.py
    branches/soc-2013-paint/release/scripts/startup/nodeitems_builtins.py
    branches/soc-2013-paint/source/blender/blenkernel/BKE_curve.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_mask.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_material.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_mesh.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_node.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_tracking.h
    branches/soc-2013-paint/source/blender/blenkernel/intern/armature.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/curve.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/mask.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/material.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/mesh.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/node.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/tracking.c
    branches/soc-2013-paint/source/blender/blenlib/BLI_array.h
    branches/soc-2013-paint/source/blender/blenlib/BLI_linklist.h
    branches/soc-2013-paint/source/blender/blenlib/intern/BLI_array.c
    branches/soc-2013-paint/source/blender/blenlib/intern/BLI_linklist.c
    branches/soc-2013-paint/source/blender/blenloader/intern/readfile.c
    branches/soc-2013-paint/source/blender/blenloader/intern/writefile.c
    branches/soc-2013-paint/source/blender/bmesh/intern/bmesh_marking.c
    branches/soc-2013-paint/source/blender/bmesh/intern/bmesh_marking.h
    branches/soc-2013-paint/source/blender/bmesh/intern/bmesh_queries.c
    branches/soc-2013-paint/source/blender/bmesh/intern/bmesh_queries.h
    branches/soc-2013-paint/source/blender/bmesh/operators/bmo_edgenet.c
    branches/soc-2013-paint/source/blender/bmesh/tools/bmesh_edgesplit.c
    branches/soc-2013-paint/source/blender/compositor/CMakeLists.txt
    branches/soc-2013-paint/source/blender/compositor/intern/COM_Converter.cpp
    branches/soc-2013-paint/source/blender/compositor/operations/COM_ImageOperation.cpp
    branches/soc-2013-paint/source/blender/compositor/operations/COM_ImageOperation.h
    branches/soc-2013-paint/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
    branches/soc-2013-paint/source/blender/compositor/operations/COM_ReadBufferOperation.cpp
    branches/soc-2013-paint/source/blender/compositor/operations/COM_ReadBufferOperation.h
    branches/soc-2013-paint/source/blender/compositor/operations/COM_WriteBufferOperation.cpp
    branches/soc-2013-paint/source/blender/compositor/operations/COM_WriteBufferOperation.h
    branches/soc-2013-paint/source/blender/editors/include/ED_transform.h
    branches/soc-2013-paint/source/blender/editors/mask/mask_relationships.c
    branches/soc-2013-paint/source/blender/editors/mask/mask_shapekey.c
    branches/soc-2013-paint/source/blender/editors/mesh/editmesh_rip.c
    branches/soc-2013-paint/source/blender/editors/mesh/editmesh_tools.c
    branches/soc-2013-paint/source/blender/editors/space_clip/clip_draw.c
    branches/soc-2013-paint/source/blender/editors/space_clip/clip_graph_ops.c
    branches/soc-2013-paint/source/blender/editors/space_clip/clip_intern.h
    branches/soc-2013-paint/source/blender/editors/space_clip/clip_utils.c
    branches/soc-2013-paint/source/blender/editors/space_clip/space_clip.c
    branches/soc-2013-paint/source/blender/editors/space_clip/tracking_ops.c
    branches/soc-2013-paint/source/blender/editors/space_clip/tracking_select.c
    branches/soc-2013-paint/source/blender/editors/space_file/file_panels.c
    branches/soc-2013-paint/source/blender/editors/space_logic/logic_window.c
    branches/soc-2013-paint/source/blender/editors/space_node/drawnode.c
    branches/soc-2013-paint/source/blender/editors/space_outliner/outliner_edit.c
    branches/soc-2013-paint/source/blender/editors/transform/transform.c
    branches/soc-2013-paint/source/blender/editors/transform/transform.h
    branches/soc-2013-paint/source/blender/editors/transform/transform_conversions.c
    branches/soc-2013-paint/source/blender/editors/transform/transform_generics.c
    branches/soc-2013-paint/source/blender/gpu/intern/gpu_draw.c
    branches/soc-2013-paint/source/blender/makesdna/DNA_actuator_types.h
    branches/soc-2013-paint/source/blender/makesdna/DNA_mask_types.h
    branches/soc-2013-paint/source/blender/makesdna/DNA_node_types.h
    branches/soc-2013-paint/source/blender/makesdna/DNA_tracking_types.h
    branches/soc-2013-paint/source/blender/makesrna/intern/rna_ID.c
    branches/soc-2013-paint/source/blender/makesrna/intern/rna_actuator.c
    branches/soc-2013-paint/source/blender/makesrna/intern/rna_curve.c
    branches/soc-2013-paint/source/blender/makesrna/intern/rna_mask.c
    branches/soc-2013-paint/source/blender/makesrna/intern/rna_nodetree.c
    branches/soc-2013-paint/source/blender/makesrna/intern/rna_tracking.c
    branches/soc-2013-paint/source/blender/nodes/CMakeLists.txt
    branches/soc-2013-paint/source/blender/nodes/NOD_composite.h
    branches/soc-2013-paint/source/blender/nodes/NOD_static_types.h
    branches/soc-2013-paint/source/gameengine/Converter/BL_ActionActuator.cpp
    branches/soc-2013-paint/source/gameengine/Converter/BL_ActionActuator.h
    branches/soc-2013-paint/source/gameengine/Converter/BL_ArmatureObject.cpp
    branches/soc-2013-paint/source/gameengine/Converter/BL_ArmatureObject.h
    branches/soc-2013-paint/source/gameengine/Converter/KX_ConvertActuators.cpp
    branches/soc-2013-paint/source/gameengine/Ketsji/BL_Action.cpp
    branches/soc-2013-paint/source/gameengine/Ketsji/BL_Action.h
    branches/soc-2013-paint/source/gameengine/Ketsji/BL_ActionManager.cpp
    branches/soc-2013-paint/source/gameengine/Ketsji/BL_ActionManager.h
    branches/soc-2013-paint/source/gameengine/Ketsji/KX_Dome.cpp
    branches/soc-2013-paint/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/soc-2013-paint/source/gameengine/Ketsji/KX_GameObject.h
    branches/soc-2013-paint/source/gameengine/Ketsji/KX_PythonInit.cpp
    branches/soc-2013-paint/source/gameengine/Ketsji/KX_SoundActuator.cpp

Added Paths:
-----------
    branches/soc-2013-paint/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp
    branches/soc-2013-paint/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.h
    branches/soc-2013-paint/source/blender/compositor/operations/COM_PlaneTrackCommonOperation.cpp
    branches/soc-2013-paint/source/blender/compositor/operations/COM_PlaneTrackCommonOperation.h
    branches/soc-2013-paint/source/blender/compositor/operations/COM_PlaneTrackMaskOperation.cpp
    branches/soc-2013-paint/source/blender/compositor/operations/COM_PlaneTrackMaskOperation.h
    branches/soc-2013-paint/source/blender/compositor/operations/COM_PlaneTrackWarpImageOperation.cpp
    branches/soc-2013-paint/source/blender/compositor/operations/COM_PlaneTrackWarpImageOperation.h
    branches/soc-2013-paint/source/blender/nodes/composite/nodes/node_composite_planetrackdeform.c

Modified: branches/soc-2013-paint/build_files/scons/tools/Blender.py
===================================================================
--- branches/soc-2013-paint/build_files/scons/tools/Blender.py	2013-08-16 13:11:15 UTC (rev 59188)
+++ branches/soc-2013-paint/build_files/scons/tools/Blender.py	2013-08-16 13:55:33 UTC (rev 59189)
@@ -151,12 +151,6 @@
         libincs += Split(lenv['BF_JACK_LIBPATH'])
     if lenv['WITH_BF_SNDFILE']:
         libincs += Split(lenv['BF_SNDFILE_LIBPATH'])
-    if lenv['WITH_BF_OPENEXR']:
-        libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
-        if lenv['WITH_BF_STATICOPENEXR']:
-            statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
-    if lenv['WITH_BF_ZLIB'] and lenv['WITH_BF_STATICZLIB']:
-        statlibs += Split(lenv['BF_ZLIB_LIB_STATIC'])
     if lenv['WITH_BF_TIFF']:
         libincs += Split(lenv['BF_TIFF_LIBPATH'])
         if lenv['WITH_BF_STATICTIFF']:
@@ -212,6 +206,12 @@
         libincs += Split(lenv['BF_OIIO_LIBPATH'])
         if lenv['WITH_BF_STATICOIIO']:
             statlibs += Split(lenv['BF_OIIO_LIB_STATIC'])
+    if lenv['WITH_BF_OPENEXR']:
+        libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
+        if lenv['WITH_BF_STATICOPENEXR']:
+            statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
+    if lenv['WITH_BF_ZLIB'] and lenv['WITH_BF_STATICZLIB']:
+        statlibs += Split(lenv['BF_ZLIB_LIB_STATIC'])
 
     if lenv['WITH_BF_OCIO']:
         libincs += Split(lenv['BF_OCIO_LIBPATH'])

Modified: branches/soc-2013-paint/doc/python_api/rst/bge.logic.rst
===================================================================
--- branches/soc-2013-paint/doc/python_api/rst/bge.logic.rst	2013-08-16 13:11:15 UTC (rev 59188)
+++ branches/soc-2013-paint/doc/python_api/rst/bge.logic.rst	2013-08-16 13:55:33 UTC (rev 59189)
@@ -1114,7 +1114,20 @@
    
    :value: 2
 
+.. _gameobject-playaction-blend:
 
+.. data:: KX_ACTION_BLEND_BLEND
+
+   Blend layers using linear interpolation
+
+   :value: 0
+
+.. data:: KX_ACTION_BLEND_ADD
+
+   Adds the layers together
+
+   :value: 1
+
 -------------
 Mouse Buttons
 -------------

Modified: branches/soc-2013-paint/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
===================================================================
--- branches/soc-2013-paint/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst	2013-08-16 13:11:15 UTC (rev 59188)
+++ branches/soc-2013-paint/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst	2013-08-16 13:55:33 UTC (rev 59189)
@@ -776,7 +776,7 @@
       Return the value matching key, or the default value if its not found.
       :return: The key value or a default.
 
-   .. method:: playAction(name, start_frame, end_frame, layer=0, priority=0, blendin=0, play_mode=ACT_MODE_PLAY, layer_weight=0.0, ipo_flags=0, speed=1.0)
+   .. method:: playAction(name, start_frame, end_frame, layer=0, priority=0, blendin=0, play_mode=KX_ACTION_MODE_PLAY, layer_weight=0.0, ipo_flags=0, speed=1.0, blend_mode=KX_ACTION_BLEND_BLEND)
 
       Plays an action.
       
@@ -794,12 +794,14 @@
       :type blendin: float
       :arg play_mode: the play mode
       :type play_mode: one of :ref:`these constants <gameobject-playaction-mode>`
-      :arg layer_weight: how much of the previous layer to use for blending (0 = add)
+      :arg layer_weight: how much of the previous layer to use for blending
       :type layer_weight: float
       :arg ipo_flags: flags for the old IPO behaviors (force, etc)
       :type ipo_flags: int bitfield
       :arg speed: the playback speed of the action as a factor (1.0 = normal speed, 2.0 = 2x speed, etc)
       :type speed: float
+	  :arg blend_mode: how to blend this layer with previous layers
+	  :type blend_mode: one of :ref:`these constants <gameobject-playaction-blend>`
 
    .. method:: stopAction(layer=0)
       

Modified: branches/soc-2013-paint/extern/libmv/libmv/multiview/euclidean_resection.cc
===================================================================
--- branches/soc-2013-paint/extern/libmv/libmv/multiview/euclidean_resection.cc	2013-08-16 13:11:15 UTC (rev 59188)
+++ branches/soc-2013-paint/extern/libmv/libmv/multiview/euclidean_resection.cc	2013-08-16 13:55:33 UTC (rev 59189)
@@ -34,6 +34,11 @@
 namespace euclidean_resection {
 
 typedef unsigned int uint;
+  
+bool EuclideanResectionPPnP(const Mat2X &x_camera,
+                            const Mat3X &X_world,
+                            Mat3 *R, Vec3 *t,
+                            double tolerance);
 
 bool EuclideanResection(const Mat2X &x_camera,
                         const Mat3X &X_world,
@@ -47,6 +52,9 @@
     case RESECTION_EPNP:
       return EuclideanResectionEPnP(x_camera, X_world, R, t, success_threshold);
       break;
+    case RESECTION_PPNP:
+      return EuclideanResectionPPnP(x_camera, X_world, R, t, success_threshold);
+      break;
     default:
       LOG(FATAL) << "Unknown resection method.";
   }
@@ -674,6 +682,107 @@
   // TODO(julien): Improve the solutions with non-linear refinement.
   return true;
 }
+  
+/*
+ 
+ Straight from the paper:
+ http://www.diegm.uniud.it/fusiello/papers/3dimpvt12-b.pdf
+ 
+ function [R T] = ppnp(P,S,tol)
+ % input
+ % P  : matrix (nx3) image coordinates in camera reference [u v 1]
+ % S  : matrix (nx3) coordinates in world reference [X Y Z]
+ % tol: exit threshold
+ %
+ % output
+ % R : matrix (3x3) rotation (world-to-camera)
+ % T : vector (3x1) translation (world-to-camera)
+ %
+ n = size(P,1);
+ Z = zeros(n);
+ e = ones(n,1);
+ A = eye(n)-((e*e’)./n);
+ II = e./n;
+ err = +Inf;
+ E_old = 1000*ones(n,3);
+ while err>tol
+   [U,˜,V] = svd(P’*Z*A*S);
+   VT = V’;
+   R=U*[1 0 0; 0 1 0; 0 0 det(U*VT)]*VT;
+   PR = P*R;
+   c = (S-Z*PR)’*II;
+   Y = S-e*c’;
+   Zmindiag = diag(PR*Y’)./(sum(P.*P,2));
+   Zmindiag(Zmindiag<0)=0;
+   Z = diag(Zmindiag);
+   E = Y-Z*PR;
+   err = norm(E-E_old,’fro’);
+   E_old = E;
+ end
+ T = -R*c;
+ end
+ 
+ */
+// TODO(keir): Re-do all the variable names and add comments matching the paper.
+// This implementation has too much of the terseness of the original. On the
+// other hand, it did work on the first try.
+bool EuclideanResectionPPnP(const Mat2X &x_camera,
+                            const Mat3X &X_world,
+                            Mat3 *R, Vec3 *t,
+                            double tolerance) {
+  int n = x_camera.cols();
+  Mat Z = Mat::Zero(n, n);
+  Vec e = Vec::Ones(n);
+  Mat A = Mat::Identity(n, n) - (e * e.transpose() / n);
+  Vec II = e / n;
+  
+  Mat P(n, 3);
+  P.col(0) = x_camera.row(0);
+  P.col(1) = x_camera.row(1);
+  P.col(2).setConstant(1.0);
+  
+  Mat S = X_world.transpose();
+  
+  double error = std::numeric_limits<double>::infinity();
+  Mat E_old = 1000 * Mat::Ones(n, 3);
+  
+  Vec3 c;
+  Mat E(n, 3);
+  
+  int iteration = 0;
+  tolerance = 1e-5;
+  // TODO(keir): The limit of 100 can probably be reduced, but this will require
+  // some investigation.
+  while (error > tolerance && iteration < 100) {
+    Mat3 tmp = P.transpose() * Z * A * S;
+    Eigen::JacobiSVD<Mat3> svd(tmp, Eigen::ComputeFullU | Eigen::ComputeFullV);
+    Mat3 U = svd.matrixU();
+    Mat3 VT = svd.matrixV().transpose();
+    Vec3 s;
+    s << 1, 1, (U * VT).determinant();
+    *R = U * s.asDiagonal() * VT;
+    Mat PR = P * *R;  // n x 3
+    c = (S - Z*PR).transpose() * II;
+    Mat Y = S - e*c.transpose();  // n x 3
+    Vec Zmindiag = (PR * Y.transpose()).diagonal()
+        .cwiseQuotient(P.rowwise().squaredNorm());
+    for (int i = 0; i < n; ++i) {
+      Zmindiag[i] = std::max(Zmindiag[i], 0.0);
+    }
+    Z = Zmindiag.asDiagonal();
+    E = Y - Z*PR;
+    error = (E - E_old).norm();
+    LOG(INFO) << "PPnP error(" << (iteration++) << "): " << error;
+    E_old = E;
+  }
+  *t = -*R*c;
 
+  // TODO(keir): Figure out what the failure cases are. Is it too many
+  // iterations? Spend some time going through the math figuring out if there
+  // is some way to detect that the algorithm is going crazy, and return false.
+  return true;
+}
+
+
 }  // namespace resection
 }  // namespace libmv

Modified: branches/soc-2013-paint/extern/libmv/libmv/multiview/euclidean_resection.h
===================================================================
--- branches/soc-2013-paint/extern/libmv/libmv/multiview/euclidean_resection.h	2013-08-16 13:11:15 UTC (rev 59188)
+++ branches/soc-2013-paint/extern/libmv/libmv/multiview/euclidean_resection.h	2013-08-16 13:55:33 UTC (rev 59189)
@@ -33,6 +33,10 @@
   // The "EPnP" algorithm by Lepetit et al.
   // http://cvlab.epfl.ch/~lepetit/papers/lepetit_ijcv08.pdf
   RESECTION_EPNP,
+  
+  // The Procrustes PNP algorithm ("PPnP")
+  // http://www.diegm.uniud.it/fusiello/papers/3dimpvt12-b.pdf
+  RESECTION_PPNP
 };
 
 /**

Modified: branches/soc-2013-paint/extern/libmv/libmv/tracking/track_region.cc
===================================================================
--- branches/soc-2013-paint/extern/libmv/libmv/tracking/track_region.cc	2013-08-16 13:11:15 UTC (rev 59188)
+++ branches/soc-2013-paint/extern/libmv/libmv/tracking/track_region.cc	2013-08-16 13:55:33 UTC (rev 59189)
@@ -796,7 +796,7 @@
     parameters[1] = t[1];
 
     // Obtain the rotation via orthorgonal procrustes.
-    Mat2 correlation_matrix;
+    Mat2 correlation_matrix = Mat2::Zero();
     for (int i = 0; i < 4; ++i) {
       correlation_matrix += q1.CornerRelativeToCentroid(i) *
                             q2.CornerRelativeToCentroid(i).transpose();
@@ -864,7 +864,7 @@
     parameters[2] = 1.0 - q2.Scale() / q1.Scale();
 
     // Obtain the rotation via orthorgonal procrustes.
-    Mat2 correlation_matrix;
+    Mat2 correlation_matrix = Mat2::Zero();
     for (int i = 0; i < 4; ++i) {
       correlation_matrix += q1.CornerRelativeToCentroid(i) *
                             q2.CornerRelativeToCentroid(i).transpose();

Modified: branches/soc-2013-paint/extern/libmv/libmv-capi.cc
===================================================================
--- branches/soc-2013-paint/extern/libmv/libmv-capi.cc	2013-08-16 13:11:15 UTC (rev 59188)
+++ branches/soc-2013-paint/extern/libmv/libmv-capi.cc	2013-08-16 13:55:33 UTC (rev 59189)
@@ -58,6 +58,8 @@
 #include "libmv/simple_pipeline/reconstruction_scale.h"
 #include "libmv/simple_pipeline/keyframe_selection.h"
 
+#include "libmv/multiview/homography.h"
+
 #ifdef _MSC_VER
 #  define snprintf _snprintf
 #endif
@@ -1080,4 +1082,28 @@
 	}
 }
 
+void libmv_homography2DFromCorrespondencesLinear(double (*x1)[2], double (*x2)[2], int num_points,

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list