[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36652] branches/bmesh/blender: svn merge -r36603:36651 https://svn.blender.org/svnroot/bf-blender/trunk/ blender \nwith some manual edits
Campbell Barton
ideasman42 at gmail.com
Fri May 13 06:04:58 CEST 2011
Revision: 36652
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36652
Author: campbellbarton
Date: 2011-05-13 04:04:53 +0000 (Fri, 13 May 2011)
Log Message:
-----------
svn merge -r36603:36651 https://svn.blender.org/svnroot/bf-blender/trunk/blender \nwith some manual edits
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36603
Modified Paths:
--------------
branches/bmesh/blender/CMakeLists.txt
branches/bmesh/blender/build_files/cmake/macros.cmake
branches/bmesh/blender/intern/ghost/intern/GHOST_SystemWin32.cpp
branches/bmesh/blender/intern/iksolver/intern/IK_QSegment.cpp
branches/bmesh/blender/release/scripts/startup/bl_ui/space_userpref.py
branches/bmesh/blender/scons/scons-local-1.2.0.d20090223/SCons/Tool/MSCommon/vs.py
branches/bmesh/blender/source/blender/blenkernel/BKE_sketch.h
branches/bmesh/blender/source/blender/blenkernel/intern/sketch.c
branches/bmesh/blender/source/blender/blenlib/BLI_math_geom.h
branches/bmesh/blender/source/blender/blenlib/intern/math_geom.c
branches/bmesh/blender/source/blender/blenloader/intern/readfile.c
branches/bmesh/blender/source/blender/editors/armature/armature_intern.h
branches/bmesh/blender/source/blender/editors/armature/editarmature.c
branches/bmesh/blender/source/blender/editors/armature/editarmature_sketch.c
branches/bmesh/blender/source/blender/editors/curve/editcurve.c
branches/bmesh/blender/source/blender/editors/gpencil/gpencil_edit.c
branches/bmesh/blender/source/blender/editors/gpencil/gpencil_paint.c
branches/bmesh/blender/source/blender/editors/include/ED_armature.h
branches/bmesh/blender/source/blender/editors/include/ED_curve.h
branches/bmesh/blender/source/blender/editors/include/ED_gpencil.h
branches/bmesh/blender/source/blender/editors/include/ED_mball.h
branches/bmesh/blender/source/blender/editors/include/ED_mesh.h
branches/bmesh/blender/source/blender/editors/include/ED_object.h
branches/bmesh/blender/source/blender/editors/include/ED_particle.h
branches/bmesh/blender/source/blender/editors/include/ED_view3d.h
branches/bmesh/blender/source/blender/editors/interface/interface_ops.c
branches/bmesh/blender/source/blender/editors/interface/interface_regions.c
branches/bmesh/blender/source/blender/editors/interface/interface_widgets.c
branches/bmesh/blender/source/blender/editors/interface/view2d.c
branches/bmesh/blender/source/blender/editors/interface/view2d_ops.c
branches/bmesh/blender/source/blender/editors/mesh/bmesh_select.c
branches/bmesh/blender/source/blender/editors/mesh/bmesh_tools.c
branches/bmesh/blender/source/blender/editors/mesh/editface.c
branches/bmesh/blender/source/blender/editors/metaball/mball_edit.c
branches/bmesh/blender/source/blender/editors/object/object_edit.c
branches/bmesh/blender/source/blender/editors/object/object_lattice.c
branches/bmesh/blender/source/blender/editors/physics/particle_edit.c
branches/bmesh/blender/source/blender/editors/sculpt_paint/paint_image.c
branches/bmesh/blender/source/blender/editors/sculpt_paint/paint_vertex.c
branches/bmesh/blender/source/blender/editors/space_graph/graph_select.c
branches/bmesh/blender/source/blender/editors/space_image/image_buttons.c
branches/bmesh/blender/source/blender/editors/space_image/image_draw.c
branches/bmesh/blender/source/blender/editors/space_info/info_report.c
branches/bmesh/blender/source/blender/editors/space_node/node_edit.c
branches/bmesh/blender/source/blender/editors/space_node/node_select.c
branches/bmesh/blender/source/blender/editors/space_node/node_state.c
branches/bmesh/blender/source/blender/editors/space_sequencer/sequencer_add.c
branches/bmesh/blender/source/blender/editors/space_sequencer/sequencer_edit.c
branches/bmesh/blender/source/blender/editors/space_sequencer/sequencer_intern.h
branches/bmesh/blender/source/blender/editors/space_sequencer/sequencer_select.c
branches/bmesh/blender/source/blender/editors/space_text/text_ops.c
branches/bmesh/blender/source/blender/editors/space_text/text_python.c
branches/bmesh/blender/source/blender/editors/space_view3d/drawobject.c
branches/bmesh/blender/source/blender/editors/space_view3d/view3d_draw.c
branches/bmesh/blender/source/blender/editors/space_view3d/view3d_edit.c
branches/bmesh/blender/source/blender/editors/space_view3d/view3d_fly.c
branches/bmesh/blender/source/blender/editors/space_view3d/view3d_select.c
branches/bmesh/blender/source/blender/editors/space_view3d/view3d_view.c
branches/bmesh/blender/source/blender/editors/transform/transform.c
branches/bmesh/blender/source/blender/editors/transform/transform.h
branches/bmesh/blender/source/blender/editors/transform/transform_constraints.c
branches/bmesh/blender/source/blender/editors/transform/transform_input.c
branches/bmesh/blender/source/blender/editors/transform/transform_manipulator.c
branches/bmesh/blender/source/blender/makesdna/DNA_object_fluidsim.h
branches/bmesh/blender/source/blender/makesrna/intern/rna_fluidsim.c
branches/bmesh/blender/source/blender/makesrna/intern/rna_scene.c
branches/bmesh/blender/source/blender/modifiers/intern/MOD_fluidsim_util.c
branches/bmesh/blender/source/blender/render/intern/source/convertblender.c
branches/bmesh/blender/source/blender/windowmanager/WM_types.h
branches/bmesh/blender/source/blender/windowmanager/intern/wm_event_system.c
branches/bmesh/blender/source/blender/windowmanager/intern/wm_operators.c
Added Paths:
-----------
branches/bmesh/blender/release/scripts/modules/view3d_utils.py
Property Changed:
----------------
branches/bmesh/blender/
branches/bmesh/blender/release/scripts/startup/bl_operators/add_mesh_torus.py
branches/bmesh/blender/release/scripts/startup/bl_operators/uvcalc_smart_project.py
branches/bmesh/blender/release/scripts/startup/bl_operators/vertexpaint_dirt.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_armature.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_bone.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_camera.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_empty.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_lamp.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_lattice.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_mesh.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_metaball.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_modifier.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_game.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_material.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_particle.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_physics_field.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_physics_fluid.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_physics_smoke.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_texture.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_world.py
branches/bmesh/blender/release/scripts/startup/bl_ui/space_node.py
branches/bmesh/blender/source/blender/editors/uvedit/uvedit_buttons.c
Property changes on: branches/bmesh/blender
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/blender:31524-36628
+ /trunk/blender:31524-36651
Modified: branches/bmesh/blender/CMakeLists.txt
===================================================================
--- branches/bmesh/blender/CMakeLists.txt 2011-05-12 22:52:30 UTC (rev 36651)
+++ branches/bmesh/blender/CMakeLists.txt 2011-05-13 04:04:53 UTC (rev 36652)
@@ -175,6 +175,10 @@
endif()
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
+# disable for now, but plan to support on all platforms eventually
+option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
+mark_as_advanced(WITH_MEM_JEMALLOC)
+
# Debug
option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
mark_as_advanced(WITH_CXX_GUARDEDALLOC)
@@ -424,6 +428,15 @@
set(EXPAT_LIB expat)
endif()
+ if(WITH_MEM_JEMALLOC)
+ set(JEMALLOC /usr)
+ set(JEMALLOC_LIBRARY ljemalloc CACHE STRING "JeMalloc library")
+ set(JEMALLOC_LIBPATH ${JEMALLOC}/lib CACHE FILEPATH "JeMalloc library path")
+ # no use for this yet.
+ # set(JEMALLOC_INCLUDE_DIR ${JEMALLOC}/include CACHE FILEPATH "JeMalloc include path")
+ unset(JEMALLOC)
+ endif()
+
find_package(X11 REQUIRED)
find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
Modified: branches/bmesh/blender/build_files/cmake/macros.cmake
===================================================================
--- branches/bmesh/blender/build_files/cmake/macros.cmake 2011-05-12 22:52:30 UTC (rev 36651)
+++ branches/bmesh/blender/build_files/cmake/macros.cmake 2011-05-13 04:04:53 UTC (rev 36652)
@@ -114,6 +114,9 @@
link_directories(${PCRE_LIBPATH})
link_directories(${EXPAT_LIBPATH})
endif()
+ if(WITH_MEM_JEMALLOC)
+ link_directories(${JEMALLOC_LIBPATH})
+ endif()
if(WIN32 AND NOT UNIX)
link_directories(${PTHREADS_LIBPATH})
@@ -220,6 +223,9 @@
target_link_libraries(${target} optimized ${LCMS_LIB})
endif()
endif()
+ if(WITH_MEM_JEMALLOC)
+ target_link_libraries(${target} ${JEMALLOC_LIBRARY})
+ endif()
if(WIN32 AND NOT UNIX)
target_link_libraries(${target} ${PTHREADS_LIB})
endif()
Modified: branches/bmesh/blender/intern/ghost/intern/GHOST_SystemWin32.cpp
===================================================================
--- branches/bmesh/blender/intern/ghost/intern/GHOST_SystemWin32.cpp 2011-05-12 22:52:30 UTC (rev 36651)
+++ branches/bmesh/blender/intern/ghost/intern/GHOST_SystemWin32.cpp 2011-05-13 04:04:53 UTC (rev 36652)
@@ -1178,25 +1178,29 @@
char *temp_buff;
if ( IsClipboardFormatAvailable(CF_TEXT) && OpenClipboard(NULL) ) {
+ size_t len = 0;
HANDLE hData = GetClipboardData( CF_TEXT );
if (hData == NULL) {
CloseClipboard();
return NULL;
}
buffer = (char*)GlobalLock( hData );
+ if (!buffer) {
+ CloseClipboard();
+ return NULL;
+ }
- temp_buff = (char*) malloc(strlen(buffer)+1);
- strcpy(temp_buff, buffer);
+ len = strlen(buffer);
+ temp_buff = (char*) malloc(len+1);
+ strncpy(temp_buff, buffer, len);
+ temp_buff[len] = '\0';
+ /* Buffer mustn't be accessed after CloseClipboard
+ it would like accessing free-d memory */
GlobalUnlock( hData );
CloseClipboard();
- temp_buff[strlen(buffer)] = '\0';
- if (buffer) {
- return (GHOST_TUns8*)temp_buff;
- } else {
- return NULL;
- }
+ return (GHOST_TUns8*)temp_buff;
} else {
return NULL;
}
Modified: branches/bmesh/blender/intern/iksolver/intern/IK_QSegment.cpp
===================================================================
--- branches/bmesh/blender/intern/iksolver/intern/IK_QSegment.cpp 2011-05-12 22:52:30 UTC (rev 36651)
+++ branches/bmesh/blender/intern/iksolver/intern/IK_QSegment.cpp 2011-05-13 04:04:53 UTC (rev 36652)
@@ -370,7 +370,7 @@
void IK_QSphericalSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
{
- if (lmin >= lmax)
+ if (lmin > lmax)
return;
if (axis == 1) {
@@ -613,7 +613,7 @@
void IK_QRevoluteSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
{
- if (lmin >= lmax || m_axis != axis)
+ if (lmin > lmax || m_axis != axis)
return;
// clamp and convert to axis angle parameters
@@ -752,7 +752,7 @@
void IK_QSwingSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
{
- if (lmin >= lmax)
+ if (lmin > lmax)
return;
// clamp and convert to axis angle parameters
@@ -898,7 +898,7 @@
void IK_QElbowSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
{
- if (lmin >= lmax)
+ if (lmin > lmax)
return;
// clamp and convert to axis angle parameters
Copied: branches/bmesh/blender/release/scripts/modules/view3d_utils.py (from rev 36651, trunk/blender/release/scripts/modules/view3d_utils.py)
===================================================================
--- branches/bmesh/blender/release/scripts/modules/view3d_utils.py (rev 0)
+++ branches/bmesh/blender/release/scripts/modules/view3d_utils.py 2011-05-13 04:04:53 UTC (rev 36652)
@@ -0,0 +1,93 @@
+# ##### 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+
+def region_2d_to_vector_3d(region, rv3d, coord):
+ """
+ Return a direction vector from the viewport at the spesific 2d region
+ coordinate.
+
+ :arg region: region of the 3D viewport, typically bpy.context.region.
+ :type region: :class:`Region`
+ :arg rv3d: 3D region data, typically bpy.context.space_data.region_3d.
+ :type rv3d: :class:`RegionView3D`
+ :arg coord: 2d coordinates relative to the region;
+ (event.mouse_region_x, event.mouse_region_y) for example.
+ :type coord: 2d vector
+ :return: normalized 3d vector.
+ :rtype: :class:`Vector`
+ """
+ from mathutils import Vector
+
+ dx = (2.0 * coord[0] / region.width) - 1.0
+ dy = (2.0 * coord[1] / region.height) - 1.0
+
+ viewvec = rv3d.view_matrix.inverted()[2].to_3d().normalized()
+ perspinv_x, perspinv_y = rv3d.perspective_matrix.inverted().to_3x3()[0:2]
+ return ((perspinv_x * dx + perspinv_y * dy) - viewvec).normalized()
+
+
+def region_2d_to_location_3d(region, rv3d, coord, depth_location):
+ """
+ Return a 3d location from the region relative 2d coords, aligned with
+ *depth_location*.
+
+ :arg region: region of the 3D viewport, typically bpy.context.region.
+ :type region: :class:`Region`
+ :arg rv3d: 3D region data, typically bpy.context.space_data.region_3d.
+ :type rv3d: :class:`RegionView3D`
+ :arg coord: 2d coordinates relative to the region;
+ (event.mouse_region_x, event.mouse_region_y) for example.
+ :type coord: 2d vector
+ :arg depth_location: the returned vectors depth is aligned with this since
+ there is no defined depth with a 2d region input.
+ :type depth_location: 3d vector
+ :return: normalized 3d vector.
+ :rtype: :class:`Vector`
+ """
+ from mathutils.geometry import intersect_point_line
+ origin_start = rv3d.view_matrix.inverted()[3].to_3d()
+ origin_end = origin_start + region_2d_to_vector_3d(region, rv3d, coord)
+ return intersect_point_line(depth_location, origin_start, origin_end)[0]
+
+
+def location_3d_to_region_2d(region, rv3d, coord):
+ """
+ Return the *region* relative 2d location of a 3d position.
+
+ :arg region: region of the 3D viewport, typically bpy.context.region.
+ :type region: :class:`Region`
+ :arg rv3d: 3D region data, typically bpy.context.space_data.region_3d.
+ :type rv3d: :class:`RegionView3D`
+ :arg coord: 3d worldspace location.
+ :type coord: 3d vector
+ :return: 2d location
+ :rtype: :class:`Vector`
+ """
+ prj = Vector((coord[0], coord[1], coord[2], 1.0)) * rv3d.perspective_matrix
+ if prj.w > 0.0:
+ width_half = region.width / 2.0
+ height_half = region.height / 2.0
+
+ return Vector((width_half + width_half * (prj.x / prj.w),
+ height_half + height_half * (prj.y / prj.w),
+ ))
+ else:
+ return None
Property changes on: branches/bmesh/blender/release/scripts/startup/bl_operators/add_mesh_torus.py
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/blender/release/scripts/startup/bl_operators/add_mesh_torus.py:36154-36628
+ /trunk/blender/release/scripts/startup/bl_operators/add_mesh_torus.py:36154-36651
Property changes on: branches/bmesh/blender/release/scripts/startup/bl_operators/uvcalc_smart_project.py
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/blender/release/scripts/startup/bl_operators/uvcalc_smart_project.py:36154-36628
+ /trunk/blender/release/scripts/startup/bl_operators/uvcalc_smart_project.py:36154-36651
Property changes on: branches/bmesh/blender/release/scripts/startup/bl_operators/vertexpaint_dirt.py
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/blender/release/scripts/startup/bl_operators/vertexpaint_dirt.py:36154-36628
+ /trunk/blender/release/scripts/startup/bl_operators/vertexpaint_dirt.py:36154-36651
Property changes on: branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_armature.py
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/blender/release/scripts/startup/bl_ui/properties_data_armature.py:36154-36628
+ /trunk/blender/release/scripts/startup/bl_ui/properties_data_armature.py:36154-36651
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list