Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GNUmakefile24
-rw-r--r--build_files/cmake/Modules/FindGLEW.cmake4
-rw-r--r--build_files/cmake/RpmBuild.cmake27
-rw-r--r--build_files/cmake/cmake_consistency_check_config.py8
-rw-r--r--build_files/scons/tools/Blender.py14
-rw-r--r--doc/manpage/blender.1.py12
-rw-r--r--doc/python_api/examples/mathutils.Color.py30
-rw-r--r--doc/python_api/examples/mathutils.Euler.py31
-rw-r--r--doc/python_api/examples/mathutils.Matrix.py27
-rw-r--r--doc/python_api/examples/mathutils.Quaternion.py22
-rw-r--r--doc/python_api/rst/bge.logic.rst2
-rw-r--r--doc/python_api/rst/bgl.rst2
-rw-r--r--intern/audaspace/FX/AUD_DynamicIIRFilterReader.cpp3
-rw-r--r--intern/audaspace/FX/AUD_IIRFilterReader.cpp15
-rw-r--r--intern/audaspace/intern/AUD_C-API.cpp63
-rw-r--r--po/update_msg.py8
-rw-r--r--release/scripts/startup/bl_ui/properties_particle.py33
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py8
-rw-r--r--release/scripts/templates/driver_functions.py34
-rw-r--r--source/blender/blenfont/intern/blf_font.c2
-rw-r--r--source/blender/blenkernel/BKE_paint.h2
-rw-r--r--source/blender/blenkernel/intern/anim.c12
-rw-r--r--source/blender/blenkernel/intern/constraint.c8
-rw-r--r--source/blender/blenkernel/intern/ipo.c4
-rw-r--r--source/blender/blenkernel/intern/particle.c65
-rw-r--r--source/blender/blenkernel/intern/particle_system.c4
-rw-r--r--source/blender/blenkernel/intern/pointcache.c2
-rw-r--r--source/blender/blenkernel/intern/sequencer.c4
-rw-r--r--source/blender/blenlib/BLI_path_util.h2
-rw-r--r--source/blender/blenlib/BLI_string.h4
-rw-r--r--source/blender/blenlib/intern/bpath.c4
-rw-r--r--source/blender/blenlib/intern/path_util.c19
-rw-r--r--source/blender/blenlib/intern/string_utf8.c80
-rw-r--r--source/blender/blenlib/intern/winstuff.c3
-rw-r--r--source/blender/blenloader/BLO_readfile.h2
-rw-r--r--source/blender/blenloader/intern/readfile.c16
-rw-r--r--source/blender/blenloader/intern/writefile.c4
-rw-r--r--source/blender/collada/DocumentImporter.cpp2
-rw-r--r--source/blender/collada/ImageExporter.cpp2
-rw-r--r--source/blender/editors/animation/anim_filter.c3
-rw-r--r--source/blender/editors/gpencil/editaction_gpencil.c2
-rw-r--r--source/blender/editors/include/ED_fileselect.h2
-rw-r--r--source/blender/editors/interface/interface.c27
-rw-r--r--source/blender/editors/interface/interface_anim.c1
-rw-r--r--source/blender/editors/interface/interface_handlers.c184
-rw-r--r--source/blender/editors/interface/interface_intern.h4
-rw-r--r--source/blender/editors/interface/interface_regions.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c2
-rw-r--r--source/blender/editors/space_file/file_draw.c4
-rw-r--r--source/blender/editors/space_file/file_ops.c4
-rw-r--r--source/blender/editors/space_file/filelist.c4
-rw-r--r--source/blender/editors/space_file/filesel.c6
-rw-r--r--source/blender/editors/space_graph/graph_draw.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c2
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c2
-rw-r--r--source/blender/editors/space_view3d/drawobject.c7
-rw-r--r--source/blender/editors/transform/transform.c2
-rw-r--r--source/blender/editors/util/crazyspace.c2
-rw-r--r--source/blender/makesdna/DNA_action_types.h8
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h2
-rw-r--r--source/blender/makesdna/DNA_ipo_types.h2
-rw-r--r--source/blender/makesdna/DNA_particle_types.h3
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c2
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c2
-rw-r--r--source/blender/makesrna/intern/rna_particle.c23
-rw-r--r--source/blender/makesrna/intern/rna_pose.c12
-rw-r--r--source/blender/makesrna/intern/rna_scene.c2
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c22
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c10
-rw-r--r--source/blender/nodes/intern/node_exec.c4
-rw-r--r--source/blender/nodes/intern/node_socket.c33
-rw-r--r--source/blender/python/intern/bpy_library.c2
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c6
-rw-r--r--source/creator/CMakeLists.txt10
-rw-r--r--source/darwin/blender.app/Contents/Info.plist65
-rw-r--r--source/darwin/set_simulation_threads.app/Contents/Info.plist44
-rwxr-xr-xsource/darwin/set_simulation_threads.app/Contents/MacOS/appletbin0 -> 34480 bytes
-rw-r--r--source/darwin/set_simulation_threads.app/Contents/PkgInfo1
-rw-r--r--source/darwin/set_simulation_threads.app/Contents/Resources/Scripts/main.scptbin0 -> 4696 bytes
-rw-r--r--source/darwin/set_simulation_threads.app/Contents/Resources/applet.icnsbin0 -> 40291 bytes
-rw-r--r--source/darwin/set_simulation_threads.app/Contents/Resources/applet.rsrcbin0 -> 362 bytes
-rw-r--r--source/darwin/set_simulation_threads.app/Contents/Resources/description.rtfd/TXT.rtf4
-rw-r--r--source/darwin/set_simulation_threads_applescript.scptbin0 -> 5140 bytes
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp4
86 files changed, 807 insertions, 328 deletions
diff --git a/GNUmakefile b/GNUmakefile
index f92b0093eae..af953143b82 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -34,10 +34,13 @@ OS_NCASE:=$(shell uname -s | tr '[A-Z]' '[a-z]')
# Source and Build DIR's
BLENDER_DIR:=$(shell pwd -P)
-BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build/$(OS_NCASE)
BUILD_TYPE:=Release
BUILD_CMAKE_ARGS:=
+ifndef BUILD_DIR
+ BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build/$(OS_NCASE)
+endif
+
# -----------------------------------------------------------------------------
# additional targets for the build configuration
@@ -120,6 +123,9 @@ help:
@echo " * headless - build without an interface (renderfarm or server automation)"
@echo " * bpy - build as a python module which can be loaded from python directly"
@echo ""
+ @echo " Note, passing the argument 'BUILD_DIR=path' when calling make will override the default build dir."
+ @echo ""
+ @echo ""
@echo "Project Files for IDE's"
@echo " * project_qtcreator - QtCreator Project Files"
@echo " * project_netbeans - NetBeans Project Files"
@@ -130,9 +136,8 @@ help:
@echo " * package_pacman - build an arch linux pacmanpackage"
@echo " * package_archive - build an archive package"
@echo ""
- @echo "Other Targets"
+ @echo "Other Targets (not assosiated with building blender)"
@echo " * translations - update blenders translation files in po/"
- # TODO, doxygen and sphinx docs
@echo ""
@echo "Testing Targets (not assosiated with building blender)"
@echo " * test - run ctest, currently tests import/export, operator execution and that python modules load"
@@ -145,8 +150,10 @@ help:
@echo " * check_splint - run blenders source through splint (C only)"
@echo " * check_sparse - run blenders source through sparse (C only)"
@echo ""
- @echo "Documentation Targets"
+ @echo "Documentation Targets (not assosiated with building blender)"
@echo " * doc_py - generate sphinx python api docs"
+ @echo " * doc_dna - generate blender file format reference"
+ @echo " * doc_man - generate manpage"
@echo ""
# -----------------------------------------------------------------------------
@@ -233,7 +240,14 @@ check_sparse:
doc_py:
$(BUILD_DIR)/bin/blender --background --factory-startup --python doc/python_api/sphinx_doc_gen.py
cd doc/python_api ; sphinx-build -n -b html sphinx-in sphinx-out
- @echo "docs written into: 'doc/python_api/sphinx-out/index.html'"
+ @echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
+
+doc_dna:
+ $(BUILD_DIR)/bin/blender --background --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
+ @echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
+
+doc_man:
+ python3 doc/manpage/blender.1.py $(BUILD_DIR)/bin/blender
clean:
diff --git a/build_files/cmake/Modules/FindGLEW.cmake b/build_files/cmake/Modules/FindGLEW.cmake
index c791327c8da..7e1b00d0923 100644
--- a/build_files/cmake/Modules/FindGLEW.cmake
+++ b/build_files/cmake/Modules/FindGLEW.cmake
@@ -51,9 +51,9 @@ ELSE (WIN32)
ENDIF (WIN32)
IF (GLEW_INCLUDE_PATH)
- SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
+ SET(GLEW_FOUND TRUE)
ELSE (GLEW_INCLUDE_PATH)
- SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
+ SET(GLEW_FOUND FALSE)
ENDIF (GLEW_INCLUDE_PATH)
MARK_AS_ADVANCED( GLEW_FOUND )
diff --git a/build_files/cmake/RpmBuild.cmake b/build_files/cmake/RpmBuild.cmake
index 2c821a9dd7a..2fdd0a72932 100644
--- a/build_files/cmake/RpmBuild.cmake
+++ b/build_files/cmake/RpmBuild.cmake
@@ -3,17 +3,24 @@
# Authors: Rohit Yadav <rohityadav89@gmail.com>
#
-find_program(RPMBUILD
- NAMES rpmbuild
- PATHS "/usr/bin")
+if(NOT DEFINED RPMBUILD)
-mark_as_advanced(RPMBUILD)
+ find_program(RPMBUILD
+ NAMES rpmbuild
+ PATHS "/usr/bin")
+
+ mark_as_advanced(RPMBUILD)
+
+ if(RPMBUILD)
+ message(STATUS "RPM Build Found: ${RPMBUILD}")
+ else(RPMBUILD)
+ message(STATUS "RPM Build Not Found (rpmbuild). RPM generation will not be available")
+ endif()
+
+endif()
if(RPMBUILD)
- get_filename_component(RPMBUILD_PATH ${RPMBUILD} ABSOLUTE)
- message(STATUS "Found rpmbuild : ${RPMBUILD_PATH}")
- set(RPMBUILD_FOUND "YES")
+ set(RPMBUILD_FOUND TRUE)
else(RPMBUILD)
- message(STATUS "rpmbuild NOT found. RPM generation will not be available")
- set(RPMBUILD_FOUND "NO")
-endif()
+ set(RPMBUILD_FOUND FALSE)
+endif() \ No newline at end of file
diff --git a/build_files/cmake/cmake_consistency_check_config.py b/build_files/cmake/cmake_consistency_check_config.py
index db2f38d6518..7a80e34ff7f 100644
--- a/build_files/cmake/cmake_consistency_check_config.py
+++ b/build_files/cmake/cmake_consistency_check_config.py
@@ -27,6 +27,10 @@ IGNORE = (
"extern/eltopo/common/openglutils.cpp",
"extern/eltopo/eltopo3d/broadphase_blenderbvh.cpp",
"source/blender/imbuf/intern/imbuf_cocoa.m",
+ "extern/recastnavigation/Recast/Source/RecastLog.cpp",
+ "extern/recastnavigation/Recast/Source/RecastTimer.cpp",
+ "entern/audaspace/SRC/AUD_SRCResampleFactory.cpp",
+ "entern/audaspace/SRC/AUD_SRCResampleReader.cpp",
"extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h",
"extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h",
@@ -50,6 +54,10 @@ IGNORE = (
"source/blender/bmesh/tools/BME_duplicate.c",
"source/blender/bmesh/tools/BME_extrude.c",
"source/blender/bmesh/tools/BME_weld.c",
+ "extern/recastnavigation/Recast/Include/RecastLog.h",
+ "extern/recastnavigation/Recast/Include/RecastTimer.h",
+ "intern/audaspace/SRC/AUD_SRCResampleFactory.h",
+ "intern/audaspace/SRC/AUD_SRCResampleReader.h",
)
UTF8_CHECK = True
diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py
index b9632bfffa7..147316c204a 100644
--- a/build_files/scons/tools/Blender.py
+++ b/build_files/scons/tools/Blender.py
@@ -582,6 +582,20 @@ def AppIt(target=None, source=None, env=None):
commands.getoutput(cmd)
cmd = 'find %s/%s.app -name __MACOSX -exec rm -rf {} \;'%(installdir, binary)
commands.getoutput(cmd)
+ if env['CC'].endswith('4.6.1'): # for correct errorhandling with gcc 4.6.1 we need the gcc.dylib to link, thus distribute in app-bundle
+ cmd = 'mkdir %s/%s.app/Contents/MacOS/lib'%(installdir, binary)
+ commands.getoutput(cmd)
+ instname = env['BF_CXX']
+ cmd = 'cp %s/lib/libgcc_s.1.dylib %s/%s.app/Contents/MacOS/lib/'%(instname, installdir, binary)
+ commands.getoutput(cmd)
+ cmd = 'install_name_tool -id @executable_path/lib/libgcc_s.1.dylib %s/%s.app/Contents/MacOS/lib/libgcc_s.1.dylib'%(installdir, binary)
+ commands.getoutput(cmd)
+ cmd = 'install_name_tool -change %s/lib/libgcc_s.1.dylib @executable_path/lib/libgcc_s.1.dylib %s/%s.app/Contents/MacOS/%s'%(instname, installdir, binary, binary)
+ commands.getoutput(cmd)
+ cmd = 'rm -rf %s/set_simulation_threads.app'%(installdir) # first clear omp_num_threads applescript
+ commands.getoutput(cmd)
+ cmd = 'cp -R %s/source/darwin/set_simulation_threads.app %s/'%(bldroot, installdir) # copy the omp_num_threads applescript
+ commands.getoutput(cmd)
# extract copy system python, be sure to update other build systems
# when making changes to the files that are copied.
diff --git a/doc/manpage/blender.1.py b/doc/manpage/blender.1.py
index 40234300994..21df42a4082 100644
--- a/doc/manpage/blender.1.py
+++ b/doc/manpage/blender.1.py
@@ -22,6 +22,7 @@
import subprocess
import os
+import sys
import time
import datetime
@@ -43,10 +44,15 @@ def man_format(data):
return data
+# allow passing blender as argument
+if sys.argv[-1].endswith(os.sep + "blender"):
+ blender_bin = sys.argv[-1]
+else:
+ blender_bin = os.path.join(os.path.dirname(__file__), "../../blender.bin")
-blender_bin = os.path.join(os.path.dirname(__file__), "../../blender.bin")
-
-blender_help = subprocess.Popen([blender_bin, "--help"], stdout=subprocess.PIPE).communicate()[0].decode()
+cmd = [blender_bin, "--help"]
+print(" executing:", " ".join(cmd))
+blender_help = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0].decode()
blender_version = subprocess.Popen([blender_bin, "--version"], stdout=subprocess.PIPE).communicate()[0].decode().strip()
blender_version = blender_version.split("Build")[0]
diff --git a/doc/python_api/examples/mathutils.Color.py b/doc/python_api/examples/mathutils.Color.py
new file mode 100644
index 00000000000..a55f1195bf6
--- /dev/null
+++ b/doc/python_api/examples/mathutils.Color.py
@@ -0,0 +1,30 @@
+import mathutils
+
+# color values are represented as RGB values from 0 - 1, this is blue
+col = mathutils.Color((0.0, 0.0, 1.0))
+
+# as well as r/g/b attribute access you can adjust them by h/s/v
+col.s *= 0.5
+
+# you can access its components by attribute or index
+print("Color R:", col.r)
+print("Color G:", col[1])
+print("Color B:", col[-1])
+print("Color HSV: %.2f, %.2f, %.2f", col[:])
+
+
+# components of an existing color can be set
+col[:] = 0.0, 0.5, 1.0
+
+# components of an existing color can use slice notation to get a tuple
+print("Values: %f, %f, %f" % col[:])
+
+# colors can be added and subtracted
+col += mathutils.Color((0.25, 0.0, 0.0))
+
+# Color can be multiplied, in this example color is scaled to 0-255
+# can printed as integers
+print("Color: %d, %d, %d" % (col * 255.0)[:])
+
+# This example prints the color as hexidecimal
+print("Hexidecimal: %.2x%.2x%.2x" % (col * 255.0)[:])
diff --git a/doc/python_api/examples/mathutils.Euler.py b/doc/python_api/examples/mathutils.Euler.py
index bc7702c1d53..3f87cc0ab04 100644
--- a/doc/python_api/examples/mathutils.Euler.py
+++ b/doc/python_api/examples/mathutils.Euler.py
@@ -1,3 +1,32 @@
import mathutils
+import math
-# todo
+# create a new euler with default axis rotation order
+eul = mathutils.Euler((0.0, math.radians(45.0), 0.0), 'XYZ')
+
+# rotate the euler
+eul.rotate_axis(math.radians(10.0), 'Z')
+
+# you can access its components by attribute or index
+print("Euler X", eul.x)
+print("Euler Y", eul[1])
+print("Euler Z", eul[-1])
+
+# components of an existing euler can be set
+eul[:] = 1.0, 2.0, 3.0
+
+# components of an existing euler can use slice notation to get a tuple
+print("Values: %f, %f, %f" % eul[:])
+
+# the order can be set at any time too
+eul.order = 'ZYX'
+
+# eulers can be used to rotate vectors
+vec = mathutils.Vector((0.0, 0.0, 1.0))
+vec.rotate(eul)
+
+# often its useful to convert the euler into a matrix so it can be used as
+# transformations with more flexibility
+mat_rot = eul.to_matrix()
+mat_loc = mathutils.Matrix.Translation((2.0, 3.0, 4.0))
+mat = mat_loc * mat_rot.to_4x4()
diff --git a/doc/python_api/examples/mathutils.Matrix.py b/doc/python_api/examples/mathutils.Matrix.py
index bc7702c1d53..079070a5ec7 100644
--- a/doc/python_api/examples/mathutils.Matrix.py
+++ b/doc/python_api/examples/mathutils.Matrix.py
@@ -1,3 +1,28 @@
import mathutils
+import math
-# todo
+# create a location matrix
+mat_loc = mathutils.Matrix.Translation((2.0, 3.0, 4.0))
+
+# create an identitiy matrix
+mat_sca = mathutils.Matrix.Scale(0.5, 4, (0.0, 0.0, 1.0))
+
+# create a rotation matrix
+mat_rot = mathutils.Matrix.Rotation(math.radians(45.0), 4, 'X')
+
+# combine transformations
+mat_out = mat_loc * mat_rot * mat_sca
+print(mat_out)
+
+# extract components back out of the matrix
+loc, rot, sca = mat_out.decompose()
+print(loc, rot, sca)
+
+# it can also be useful to access components of a matrix directly
+mat = mathutils.Matrix()
+mat[0][0], mat[1][0], mat[2][0] = 0.0, 1.0, 2.0
+
+mat[0][0:3] = 0.0, 1.0, 2.0
+
+# each item in a matrix is a vector so vector utility functions can be used
+mat[0].xyz = 0.0, 1.0, 2.0
diff --git a/doc/python_api/examples/mathutils.Quaternion.py b/doc/python_api/examples/mathutils.Quaternion.py
index bc7702c1d53..d8c696e6ba6 100644
--- a/doc/python_api/examples/mathutils.Quaternion.py
+++ b/doc/python_api/examples/mathutils.Quaternion.py
@@ -1,3 +1,23 @@
import mathutils
+import math
-# todo
+# a new rotation 90 degrees about the Y axis
+quat_a = mathutils.Quaternion((0.7071068, 0.0, 0.7071068, 0.0))
+
+# passing values to Quaternion's directly can be confusing so axis, angle
+# is supported for initializing too
+quat_b = mathutils.Quaternion((0.0, 1.0, 0.0), math.radians(90.0))
+
+print("Check quaternions match", quat_a == quat_b)
+
+# like matrices, quaternions can be multiplied to accumulate rotational values
+quat_a = mathutils.Quaternion((0.0, 1.0, 0.0), math.radians(90.0))
+quat_b = mathutils.Quaternion((0.0, 0.0, 1.0), math.radians(45.0))
+quat_out = quat_a * quat_b
+
+# print the quat, euler degrees for mear mortals and (axis, angle)
+print("Final Rotation:")
+print(quat_out)
+print("%.2f, %.2f, %.2f" % tuple(math.degrees(a) for a in quat_out.to_euler()))
+print("(%.2f, %.2f, %.2f), %.2f" % (quat_out.axis[:] +
+ (math.degrees(quat_out.angle), )))
diff --git a/doc/python_api/rst/bge.logic.rst b/doc/python_api/rst/bge.logic.rst
index 798491b4710..82e69965840 100644
--- a/doc/python_api/rst/bge.logic.rst
+++ b/doc/python_api/rst/bge.logic.rst
@@ -106,7 +106,7 @@ There are also methods to access the current :class:`bge.types.KX_Scene`
Matricies as used by the game engine are **row major**
``matrix[row][col] = float``
-:class:`bge.types.KX_Camera` has some examples using matricies.
+:class:`bge.types.KX_Camera` has some examples using matrices.
*********
Variables
diff --git a/doc/python_api/rst/bgl.rst b/doc/python_api/rst/bgl.rst
index 61400351d16..8fe765836a1 100644
--- a/doc/python_api/rst/bgl.rst
+++ b/doc/python_api/rst/bgl.rst
@@ -20,7 +20,7 @@ OpenGL}" and the online NeHe tutorials are two of the best resources.
See :class:`Image.gl_load` and :class:`Image.gl_load`,
for example.
`OpenGL.org <http://www.opengl.org>`_
- `NeHe GameDev <nehe.gamedev.net>`_
+ `NeHe GameDev <http://nehe.gamedev.net>`_
.. function:: glAccum(op, value):
diff --git a/intern/audaspace/FX/AUD_DynamicIIRFilterReader.cpp b/intern/audaspace/FX/AUD_DynamicIIRFilterReader.cpp
index ed9b2d3871d..f1edccb22fb 100644
--- a/intern/audaspace/FX/AUD_DynamicIIRFilterReader.cpp
+++ b/intern/audaspace/FX/AUD_DynamicIIRFilterReader.cpp
@@ -32,7 +32,8 @@
AUD_DynamicIIRFilterReader::AUD_DynamicIIRFilterReader(AUD_Reference<AUD_IReader> reader,
AUD_Reference<AUD_DynamicIIRFilterFactory> factory) :
- AUD_IIRFilterReader(reader, std::vector<float>(), std::vector<float>())
+ AUD_IIRFilterReader(reader, std::vector<float>(), std::vector<float>()),
+ m_factory(factory)
{
sampleRateChanged(reader->getSpecs().rate);
}
diff --git a/intern/audaspace/FX/AUD_IIRFilterReader.cpp b/intern/audaspace/FX/AUD_IIRFilterReader.cpp
index 1bfb9b97b62..90f7e1e3cb0 100644
--- a/intern/audaspace/FX/AUD_IIRFilterReader.cpp
+++ b/intern/audaspace/FX/AUD_IIRFilterReader.cpp
@@ -36,11 +36,14 @@ AUD_IIRFilterReader::AUD_IIRFilterReader(AUD_Reference<AUD_IReader> reader,
const std::vector<float>& a) :
AUD_BaseIIRFilterReader(reader, b.size(), a.size()), m_a(a), m_b(b)
{
- for(int i = 1; i < m_a.size(); i++)
- m_a[i] /= m_a[0];
- for(int i = 0; i < m_b.size(); i++)
- m_b[i] /= m_a[0];
- m_a[0] = 1;
+ if(m_a.size())
+ {
+ for(int i = 1; i < m_a.size(); i++)
+ m_a[i] /= m_a[0];
+ for(int i = 0; i < m_b.size(); i++)
+ m_b[i] /= m_a[0];
+ m_a[0] = 1;
+ }
}
sample_t AUD_IIRFilterReader::filter()
@@ -58,7 +61,7 @@ sample_t AUD_IIRFilterReader::filter()
void AUD_IIRFilterReader::setCoefficients(const std::vector<float>& b,
const std::vector<float>& a)
{
- setLengths(m_b.size(), m_a.size());
+ setLengths(b.size(), a.size());
m_a = a;
m_b = b;
}
diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp
index af053df9c50..66e3a0ed7e9 100644
--- a/intern/audaspace/intern/AUD_C-API.cpp
+++ b/intern/audaspace/intern/AUD_C-API.cpp
@@ -826,42 +826,51 @@ float* AUD_readSoundBuffer(const char* filename, float low, float high,
AUD_Reference<AUD_IFactory> file = new AUD_FileFactory(filename);
- AUD_Reference<AUD_IReader> reader = file->createReader();
- AUD_SampleRate rate = reader->getSpecs().rate;
+ int position = 0;
- sound = new AUD_ChannelMapperFactory(file, specs);
+ try
+ {
+ AUD_Reference<AUD_IReader> reader = file->createReader();
- if(high < rate)
- sound = new AUD_LowpassFactory(sound, high);
- if(low > 0)
- sound = new AUD_HighpassFactory(sound, low);
+ AUD_SampleRate rate = reader->getSpecs().rate;
- sound = new AUD_EnvelopeFactory(sound, attack, release, threshold, 0.1f);
- sound = new AUD_LinearResampleFactory(sound, specs);
+ sound = new AUD_ChannelMapperFactory(file, specs);
- if(square)
- sound = new AUD_SquareFactory(sound, sthreshold);
+ if(high < rate)
+ sound = new AUD_LowpassFactory(sound, high);
+ if(low > 0)
+ sound = new AUD_HighpassFactory(sound, low);
- if(accumulate)
- sound = new AUD_AccumulatorFactory(sound, additive);
- else if(additive)
- sound = new AUD_SumFactory(sound);
+ sound = new AUD_EnvelopeFactory(sound, attack, release, threshold, 0.1f);
+ sound = new AUD_LinearResampleFactory(sound, specs);
- reader = sound->createReader();
+ if(square)
+ sound = new AUD_SquareFactory(sound, sthreshold);
- if(reader.isNull())
- return NULL;
+ if(accumulate)
+ sound = new AUD_AccumulatorFactory(sound, additive);
+ else if(additive)
+ sound = new AUD_SumFactory(sound);
- int len;
- int position = 0;
- bool eos;
- do
+ reader = sound->createReader();
+
+ if(reader.isNull())
+ return NULL;
+
+ int len;
+ bool eos;
+ do
+ {
+ len = samplerate;
+ buffer.resize((position + len) * sizeof(float), true);
+ reader->read(len, eos, buffer.getBuffer() + position);
+ position += len;
+ } while(!eos);
+ }
+ catch(AUD_Exception&)
{
- len = samplerate;
- buffer.resize((position + len) * sizeof(float), true);
- reader->read(len, eos, buffer.getBuffer() + position);
- position += len;
- } while(!eos);
+ return NULL;
+ }
float* result = (float*)malloc(position * sizeof(float));
memcpy(result, buffer.getBuffer(), position * sizeof(float));
diff --git a/po/update_msg.py b/po/update_msg.py
index 5986d96f14b..7cc7ee50b63 100644
--- a/po/update_msg.py
+++ b/po/update_msg.py
@@ -135,10 +135,12 @@ def dump_messages_rna(messages):
item.identifier,
)
# Here identifier and name can be the same!
- if item.name: # and item.name != item.identifier:
- messages.setdefault(item.name, []).append(msgsrc)
+ if item.name: # and item.name != item.identifier:
+ messages.setdefault(item.name,
+ []).append(msgsrc)
if item.description:
- messages.setdefault(item.description, []).append(msgsrc)
+ messages.setdefault(item.description,
+ []).append(msgsrc)
def walkRNA(bl_rna):
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index eceefc70b5c..0e7fccae8df 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -405,9 +405,12 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel):
layout.enabled = particle_panel_enabled(context, psys)
- row = layout.row()
- row.label(text="Initial Rotation:")
- row.prop(part, "use_dynamic_rotation")
+ layout.prop(part, "use_dynamic_rotation")
+
+ if part.use_dynamic_rotation:
+ layout.label(text="Initial Rotation Axis:")
+ else:
+ layout.label(text="Rotation Axis:")
split = layout.split()
@@ -419,12 +422,17 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel):
col.prop(part, "phase_factor", slider=True)
col.prop(part, "phase_factor_random", text="Random", slider=True)
- col = layout.column()
- col.label(text="Angular Velocity:")
- col.row().prop(part, "angular_velocity_mode", expand=True)
-
- if part.angular_velocity_mode != 'NONE':
- col.prop(part, "angular_velocity_factor", text="")
+ if part.type != 'HAIR':
+ col = layout.column()
+ if part.use_dynamic_rotation:
+ col.label(text="Initial Angular Velocity:")
+ else:
+ col.label(text="Angular Velocity:")
+ sub = col.row(align=True)
+ sub.prop(part, "angular_velocity_mode", text="")
+ subsub = sub.column()
+ subsub.active = part.angular_velocity_mode != 'NONE'
+ subsub.prop(part, "angular_velocity_factor", text="")
class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
@@ -832,7 +840,9 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
elif part.render_type == 'OBJECT':
col.prop(part, "dupli_object")
- col.prop(part, "use_global_dupli")
+ sub = col.row()
+ sub.prop(part, "use_global_dupli")
+ sub.prop(part, "use_rotation_dupli")
elif part.render_type == 'GROUP':
col.prop(part, "dupli_group")
split = layout.split()
@@ -841,13 +851,14 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
col.prop(part, "use_whole_group")
sub = col.column()
sub.active = (part.use_whole_group is False)
+ sub.prop(part, "use_group_pick_random")
sub.prop(part, "use_group_count")
col = split.column()
sub = col.column()
sub.active = (part.use_whole_group is False)
sub.prop(part, "use_global_dupli")
- sub.prop(part, "use_group_pick_random")
+ sub.prop(part, "use_rotation_dupli")
if part.use_group_count and not part.use_whole_group:
row = layout.row()
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 5069449fc5b..25a6979f226 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -54,10 +54,11 @@ class VIEW3D_HT_header(Header):
else:
sub.menu("VIEW3D_MT_object")
- row = layout.row()
+
# Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
- row.template_header_3D()
-
+ layout.template_header_3D()
+
+ row = layout.row()
if obj:
# Particle edit
if obj.mode == 'PARTICLE_EDIT':
@@ -984,6 +985,7 @@ class VIEW3D_MT_make_links(Menu):
layout.operator("object.join_uvs") # stupid place to add this!
+
class VIEW3D_MT_object_game(Menu):
bl_label = "Game"
diff --git a/release/scripts/templates/driver_functions.py b/release/scripts/templates/driver_functions.py
new file mode 100644
index 00000000000..db9d4fb4678
--- /dev/null
+++ b/release/scripts/templates/driver_functions.py
@@ -0,0 +1,34 @@
+# This script defines functions to be used directly in drivers expressions to
+# extend the builtin set of python functions.
+#
+# This can be executed on manually or set to 'Register' to
+# initialize thefunctions on file load.
+
+
+# two sample functions
+def invert(f):
+ """ Simple function call:
+
+ invert(val)
+ """
+ return 1.0 - f
+
+
+uuid_store = {}
+
+def slow_value(value, fac, uuid):
+ """ Delay the value by a factor, use a unique string to allow
+ use in multiple drivers without conflict:
+
+ slow_value(val, 0.5, "my_value")
+ """
+ value_prev = uuid_store.get(uuid, value)
+ uuid_store[uuid] = value_new = (value_prev * fac) + (value * (1.0 - fac))
+ return value_new
+
+
+import bpy
+
+# Add variable defined in this script into the drivers namespace.
+bpy.app.driver_namespace["invert"] = invert
+bpy.app.driver_namespace["slow_value"] = slow_value
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 851c6542de0..5161761cf09 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -217,7 +217,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
unsigned int i= 0;
GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
- /* buffer spesific vars*/
+ /* buffer specific vars*/
const unsigned char b_col_char[4]= {font->b_col[0] * 255,
font->b_col[1] * 255,
font->b_col[2] * 255,
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 733ff3f357a..8a871b9ecf5 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -84,7 +84,7 @@ typedef struct SculptSession {
int modifiers_active; /* object is deformed with some modifiers */
float (*orig_cos)[3]; /* coords of undeformed mesh */
float (*deform_cos)[3]; /* coords of deformed mesh but without stroke displacement */
- float (*deform_imats)[3][3]; /* crazyspace deformation matricies */
+ float (*deform_imats)[3][3]; /* crazyspace deformation matrices */
/* Partial redraw */
int partial_redraw;
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 96d603875e4..89579affa99 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -1427,6 +1427,16 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
VECCOPY(vec, obmat[3]);
obmat[3][0] = obmat[3][1] = obmat[3][2] = 0.0f;
+
+ /* particle rotation uses x-axis as the aligned axis, so pre-rotate the object accordingly */
+ if((part->draw & PART_DRAW_ROTATE_OB) == 0) {
+ float xvec[3], q[4];
+ xvec[0] = -1.f;
+ xvec[1] = xvec[2] = 0;
+ vec_to_quat(q, xvec, ob->trackflag, ob->upflag);
+ quat_to_mat4(obmat, q);
+ obmat[3][3]= 1.0f;
+ }
/* Normal particles and cached hair live in global space so we need to
* remove the real emitter's transformation before 2nd order duplication.
@@ -1445,7 +1455,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
copy_m4_m4(mat, tmat);
if(part->draw & PART_DRAW_GLOBAL_OB)
- VECADD(mat[3], mat[3], vec);
+ add_v3_v3v3(mat[3], mat[3], vec);
dob= new_dupli_object(lb, ob, mat, ob->lay, counter, GS(id->name) == ID_GR ? OB_DUPLIGROUP : OB_DUPLIPARTS, animated);
copy_m4_m4(dob->omat, oldobmat);
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 5c39fbfb9bb..e6c0e55d350 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -1067,7 +1067,7 @@ static void trackto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
cob->matrix[2][2]=size[2];
/* targetmat[2] instead of ownermat[2] is passed to vectomat
- * for backwards compatability it seems... (Aligorith)
+ * for backwards compatibility it seems... (Aligorith)
*/
sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);
vectomat(vec, ct->matrix[2],
@@ -2104,7 +2104,7 @@ static void actcon_new_data (void *cdata)
{
bActionConstraint *data= (bActionConstraint *)cdata;
- /* set type to 20 (Loc X), as 0 is Rot X for backwards compatability */
+ /* set type to 20 (Loc X), as 0 is Rot X for backwards compatibility */
data->type = 20;
}
@@ -2161,7 +2161,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
constraint_target_to_mat4(ct->tar, ct->subtarget, tempmat, CONSTRAINT_SPACE_WORLD, ct->space, con->headtail);
/* determine where in transform range target is */
- /* data->type is mapped as follows for backwards compatability:
+ /* data->type is mapped as follows for backwards compatibility:
* 00,01,02 - rotation (it used to be like this)
* 10,11,12 - scaling
* 20,21,22 - location
@@ -4351,7 +4351,7 @@ short proxylocked_constraints_owner (Object *ob, bPoseChannel *pchan)
* constraints either had one or no targets. It used to be called during the main constraint solving
* loop, but is now only used for the remaining cases for a few constraints.
*
- * None of the actual calculations of the matricies should be done here! Also, this function is
+ * None of the actual calculations of the matrices should be done here! Also, this function is
* not to be used by any new constraints, particularly any that have multiple targets.
*/
void get_constraint_target_matrix (struct Scene *scene, bConstraint *con, int n, short ownertype, void *ownerdata, float mat[][4], float ctime)
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 91f3c7a22ba..609f6cd38f1 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -1034,12 +1034,14 @@ static ChannelDriver *idriver_to_cdriver (IpoDriver *idriver)
/* first bone target */
dtar= &dvar->targets[0];
dtar->id= (ID *)idriver->ob;
+ dtar->idtype= ID_OB;
if (idriver->name[0])
BLI_strncpy(dtar->pchan_name, idriver->name, sizeof(dtar->pchan_name));
/* second bone target (name was stored in same var as the first one) */
dtar= &dvar->targets[1];
dtar->id= (ID *)idriver->ob;
+ dtar->idtype= ID_OB;
if (idriver->name[0]) // xxx... for safety
BLI_strncpy(dtar->pchan_name, idriver->name+DRIVER_NAME_OFFS, sizeof(dtar->pchan_name));
}
@@ -1051,6 +1053,7 @@ static ChannelDriver *idriver_to_cdriver (IpoDriver *idriver)
/* only requires a single target */
dtar= &dvar->targets[0];
dtar->id= (ID *)idriver->ob;
+ dtar->idtype= ID_OB;
if (idriver->name[0])
BLI_strncpy(dtar->pchan_name, idriver->name, sizeof(dtar->pchan_name));
dtar->transChan= adrcode_to_dtar_transchan(idriver->adrcode);
@@ -1065,6 +1068,7 @@ static ChannelDriver *idriver_to_cdriver (IpoDriver *idriver)
/* only requires single target */
dtar= &dvar->targets[0];
dtar->id= (ID *)idriver->ob;
+ dtar->idtype= ID_OB;
dtar->transChan= adrcode_to_dtar_transchan(idriver->adrcode);
}
}
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index c6f526415c8..e8b76c214dc 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -4386,33 +4386,50 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
psys_particle_on_emitter(psmd,sim->psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,loc,nor,0,0,0,0);
else
psys_particle_on_emitter(psmd,PART_FROM_FACE,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,loc,nor,0,0,0,0);
-
- copy_m3_m4(nmat, ob->imat);
- transpose_m3(nmat);
- mul_m3_v3(nmat, nor);
- normalize_v3(nor);
-
- /* make sure that we get a proper side vector */
- if(fabs(dot_v3v3(nor,vec))>0.999999) {
- if(fabs(dot_v3v3(nor,xvec))>0.999999) {
- nor[0] = 0.0f;
- nor[1] = 1.0f;
- nor[2] = 0.0f;
+
+ if(psys->part->rotmode == PART_ROT_VEL) {
+ copy_m3_m4(nmat, ob->imat);
+ transpose_m3(nmat);
+ mul_m3_v3(nmat, nor);
+ normalize_v3(nor);
+
+ /* make sure that we get a proper side vector */
+ if(fabs(dot_v3v3(nor,vec))>0.999999) {
+ if(fabs(dot_v3v3(nor,xvec))>0.999999) {
+ nor[0] = 0.0f;
+ nor[1] = 1.0f;
+ nor[2] = 0.0f;
+ }
+ else {
+ nor[0] = 1.0f;
+ nor[1] = 0.0f;
+ nor[2] = 0.0f;
+ }
}
- else {
- nor[0] = 1.0f;
- nor[1] = 0.0f;
- nor[2] = 0.0f;
+ cross_v3_v3v3(side, nor, vec);
+ normalize_v3(side);
+
+ /* rotate side vector around vec */
+ if(psys->part->phasefac != 0) {
+ float q_phase[4];
+ float phasefac = psys->part->phasefac;
+ if(psys->part->randphasefac != 0.0f)
+ phasefac += psys->part->randphasefac * PSYS_FRAND((pa-psys->particles) + 20);
+ axis_angle_to_quat( q_phase, vec, phasefac*(float)M_PI);
+
+ mul_qt_v3(q_phase, side);
}
- }
- cross_v3_v3v3(side, nor, vec);
- normalize_v3(side);
- cross_v3_v3v3(nor, vec, side);
- unit_m4(mat);
- VECCOPY(mat[0], vec);
- VECCOPY(mat[1], side);
- VECCOPY(mat[2], nor);
+ cross_v3_v3v3(nor, vec, side);
+
+ unit_m4(mat);
+ VECCOPY(mat[0], vec);
+ VECCOPY(mat[1], side);
+ VECCOPY(mat[2], nor);
+ }
+ else {
+ quat_to_mat4(mat, pa->state.rot);
+ }
*scale= len;
}
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 6a2cef41262..54af061dedb 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -1607,8 +1607,8 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
}
- /* -velocity */
- if(part->randfac != 0.0f){
+ /* -velocity (boids need this even if there's no random velocity) */
+ if(part->randfac != 0.0f || (part->phystype==PART_PHYS_BOIDS && pa->boid)){
r_vel[0] = 2.0f * (PSYS_FRAND(p + 10) - 0.5f);
r_vel[1] = 2.0f * (PSYS_FRAND(p + 11) - 0.5f);
r_vel[2] = 2.0f * (PSYS_FRAND(p + 12) - 0.5f);
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index fb69db17b97..bc5bc87b1fa 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -910,7 +910,7 @@ static int ptcache_path(PTCacheID *pid, char *filename)
else if (G.relbase_valid || lib) {
char file[MAX_PTCACHE_PATH]; /* we dont want the dir, only the file */
- BLI_split_dirfile(blendfilename, NULL, file);
+ BLI_split_dirfile(blendfilename, NULL, file, 0, sizeof(file));
i = strlen(file);
/* remove .blend */
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 5a2c53f5b9b..00534400cf1 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -3647,7 +3647,7 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
/* we only need 1 element to store the filename */
strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
- BLI_split_dirfile(seq_load->path, strip->dir, se->name);
+ BLI_split_dirfile(seq_load->path, strip->dir, se->name, sizeof(strip->dir), sizeof(se->name));
seq->scene_sound = sound_add_scene_sound(scene, seq, seq_load->start_frame, seq_load->start_frame + strip->len, 0);
@@ -3706,7 +3706,7 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
/* we only need 1 element for MOVIE strips */
strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
- BLI_split_dirfile(seq_load->path, strip->dir, se->name);
+ BLI_split_dirfile(seq_load->path, strip->dir, se->name, sizeof(strip->dir), sizeof(se->name));
calc_sequence_disp(scene, seq);
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index 81fc8a50db6..4f7f7b482b5 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -103,7 +103,7 @@ void BLI_setenv_if_new(const char *env, const char* val);
void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file);
void BLI_make_exist(char *dir);
void BLI_make_existing_file(const char *name);
-void BLI_split_dirfile(const char *string, char *dir, char *file);
+void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen);
void BLI_join_dirfile(char *string, const size_t maxlen, const char *dir, const char *file);
char *BLI_path_basename(char *path);
int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const char *base_dir, const char *src_dir, const char *dest_dir);
diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h
index c53ce9dced5..3ac8dba106a 100644
--- a/source/blender/blenlib/BLI_string.h
+++ b/source/blender/blenlib/BLI_string.h
@@ -147,6 +147,10 @@ void BLI_ascii_strtoupper(char *str, int len);
char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy);
int BLI_utf8_invalid_byte(const char *str, int length);
int BLI_utf8_invalid_strip(char *str, int length);
+ /* copied from glib */
+char *BLI_str_find_prev_char_utf8(const char *str, const char *p);
+char *BLI_str_find_next_char_utf8(const char *p, const char *end);
+char *BLI_str_prev_char_utf8(const char *p);
#ifdef __cplusplus
}
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 485b8137a02..4e4f8b3cade 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -400,7 +400,7 @@ static void seq_setpath(struct BPathIterator *bpi, const char *path)
if (SEQ_HAS_PATH(seq)) {
if (ELEM3(seq->type, SEQ_IMAGE, SEQ_MOVIE, SEQ_SOUND)) {
- BLI_split_dirfile(path, seq->strip->dir, seq->strip->stripdata->name);
+ BLI_split_dirfile(path, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name));
}
else {
/* simple case */
@@ -903,7 +903,7 @@ void findMissingFiles(Main *bmain, const char *str)
//XXX waitcursor( 1 );
- BLI_split_dirfile(str, dirname, NULL);
+ BLI_split_dirfile(str, dirname, NULL, sizeof(dirname), 0);
BLI_bpathIterator_init(&bpi, bmain, bmain->name, 0);
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 1c71f1e1f27..e3b7b8198b6 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -895,7 +895,7 @@ static int get_path_local(char *targetpath, const char *folder_name, const char
}
/* use argv[0] (bprogname) to get the path to the executable */
- BLI_split_dirfile(bprogname, bprogdir, NULL);
+ BLI_split_dirfile(bprogname, bprogdir, NULL, sizeof(bprogdir), 0);
/* try EXECUTABLE_DIR/2.5x/folder_name - new default directory for local blender installed files */
if(test_path(targetpath, bprogdir, blender_version_decimal(ver), relfolder))
@@ -967,7 +967,7 @@ static int get_path_system(char *targetpath, const char *folder_name, const char
char bprogdir[FILE_MAX];
/* use argv[0] (bprogname) to get the path to the executable */
- BLI_split_dirfile(bprogname, bprogdir, NULL);
+ BLI_split_dirfile(bprogname, bprogdir, NULL, sizeof(bprogdir), 0);
if(folder_name) {
if (subfolder_name) {
@@ -1412,21 +1412,22 @@ int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
* - dosnt use CWD, or deal with relative paths.
* - Only fill's in *dir and *file when they are non NULL
* */
-void BLI_split_dirfile(const char *string, char *dir, char *file)
+void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen)
{
char *lslash_str = BLI_last_slash(string);
- int lslash= lslash_str ? (int)(lslash_str - string) + 1 : 0;
+ size_t lslash= lslash_str ? (size_t)(lslash_str - string) + 1 : 0;
if (dir) {
if (lslash) {
- BLI_strncpy( dir, string, lslash + 1); /* +1 to include the slash and the last char */
- } else {
+ BLI_strncpy( dir, string, MIN2(dirlen, lslash + 1)); /* +1 to include the slash and the last char */
+ }
+ else {
dir[0] = '\0';
}
}
if (file) {
- strcpy( file, string+lslash);
+ BLI_strncpy(file, string+lslash, filelen);
}
}
@@ -1516,7 +1517,7 @@ int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const
if (rel)
rel[0]= 0;
- BLI_split_dirfile(base_dir, blend_dir, NULL);
+ BLI_split_dirfile(base_dir, blend_dir, NULL, sizeof(blend_dir), 0);
if (src_dir[0]=='\0')
return 0;
@@ -1527,7 +1528,7 @@ int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const
BLI_path_abs(path, base_dir);
/* get the directory part */
- BLI_split_dirfile(path, dir, base);
+ BLI_split_dirfile(path, dir, base, sizeof(dir), sizeof(base));
len= strlen(blend_dir);
diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c
index 961a41690f7..dc6cb0ef228 100644
--- a/source/blender/blenlib/intern/string_utf8.c
+++ b/source/blender/blenlib/intern/string_utf8.c
@@ -183,3 +183,83 @@ char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy)
return dst_r;
}
+/* copied from glib */
+/**
+ * g_utf8_find_prev_char:
+ * @str: pointer to the beginning of a UTF-8 encoded string
+ * @p: pointer to some position within @str
+ *
+ * Given a position @p with a UTF-8 encoded string @str, find the start
+ * of the previous UTF-8 character starting before @p. Returns %NULL if no
+ * UTF-8 characters are present in @str before @p.
+ *
+ * @p does not have to be at the beginning of a UTF-8 character. No check
+ * is made to see if the character found is actually valid other than
+ * it starts with an appropriate byte.
+ *
+ * Return value: a pointer to the found character or %NULL.
+ **/
+char * BLI_str_find_prev_char_utf8(const char *str, const char *p)
+{
+ for (--p; p >= str; --p) {
+ if ((*p & 0xc0) != 0x80) {
+ return (char *)p;
+ }
+ }
+ return NULL;
+}
+
+/**
+ * g_utf8_find_next_char:
+ * @p: a pointer to a position within a UTF-8 encoded string
+ * @end: a pointer to the byte following the end of the string,
+ * or %NULL to indicate that the string is nul-terminated.
+ *
+ * Finds the start of the next UTF-8 character in the string after @p.
+ *
+ * @p does not have to be at the beginning of a UTF-8 character. No check
+ * is made to see if the character found is actually valid other than
+ * it starts with an appropriate byte.
+ *
+ * Return value: a pointer to the found character or %NULL
+ **/
+char *BLI_str_find_next_char_utf8(const char *p, const char *end)
+{
+ if (*p) {
+ if (end) {
+ for (++p; p < end && (*p & 0xc0) == 0x80; ++p) {
+ /* do nothing */
+ }
+ }
+ else {
+ for (++p; (*p & 0xc0) == 0x80; ++p) {
+ /* do nothing */
+ }
+ }
+ }
+ return (p == end) ? NULL : (char *)p;
+}
+
+/**
+ * g_utf8_prev_char:
+ * @p: a pointer to a position within a UTF-8 encoded string
+ *
+ * Finds the previous UTF-8 character in the string before @p.
+ *
+ * @p does not have to be at the beginning of a UTF-8 character. No check
+ * is made to see if the character found is actually valid other than
+ * it starts with an appropriate byte. If @p might be the first
+ * character of the string, you must use g_utf8_find_prev_char() instead.
+ *
+ * Return value: a pointer to the found character.
+ **/
+char *BLI_str_prev_char_utf8(const char *p)
+{
+ while (1) {
+ p--;
+ if ((*p & 0xc0) != 0x80) {
+ return (char *)p;
+ }
+ }
+}
+/* end glib copy */
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c
index 3b14abb0bee..9594197ef90 100644
--- a/source/blender/blenlib/intern/winstuff.c
+++ b/source/blender/blenlib/intern/winstuff.c
@@ -53,11 +53,10 @@
int BLI_getInstallationDir( char * str ) {
char dir[FILE_MAXDIR];
- char file[FILE_MAXFILE];
int a;
GetModuleFileName(NULL,str,FILE_MAXDIR+FILE_MAXFILE);
- BLI_split_dirfile(str,dir,file); /* shouldn't be relative */
+ BLI_split_dirfile(str, dir, NULL, sizeof(dir), 0); /* shouldn't be relative */
a = strlen(dir);
if(dir[a-1] == '\\') dir[a-1]=0;
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index 47931477728..e7be98d955d 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -204,7 +204,7 @@ BLO_blendhandle_close(
#define GROUP_MAX 32
-int BLO_has_bfile_extension(char *str);
+int BLO_has_bfile_extension(const char *str);
/* return ok when a blenderfile, in dir is the filename,
* in group the type of libdata
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d52856a27cb..4441bf46c03 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1050,7 +1050,7 @@ void blo_freefiledata(FileData *fd)
/* ************ DIV ****************** */
-int BLO_has_bfile_extension(char *str)
+int BLO_has_bfile_extension(const char *str)
{
return (BLI_testextensie(str, ".ble") || BLI_testextensie(str, ".blend") || BLI_testextensie(str, ".blend.gz"));
}
@@ -12242,6 +12242,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
do_versions_nodetree_image_default_alpha_output(ntree);
}
+
+ {
+ /* support old particle dupliobject rotation settings */
+ ParticleSettings *part;
+
+ for (part=main->particle.first; part; part=part->id.next) {
+ if(ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
+ part->draw |= PART_DRAW_ROTATE_OB;
+
+ if(part->rotmode == 0)
+ part->rotmode = PART_ROT_VEL;
+ }
+ }
+ }
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 18e7c0f2fa7..181b2e3dd26 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2681,8 +2681,8 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
if(write_flags & G_FILE_RELATIVE_REMAP) {
char dir1[FILE_MAXDIR+FILE_MAXFILE];
char dir2[FILE_MAXDIR+FILE_MAXFILE];
- BLI_split_dirfile(filepath, dir1, NULL);
- BLI_split_dirfile(mainvar->name, dir2, NULL);
+ BLI_split_dirfile(filepath, dir1, NULL, sizeof(dir1), 0);
+ BLI_split_dirfile(mainvar->name, dir2, NULL, sizeof(dir2), 0);
/* just incase there is some subtle difference */
BLI_cleanup_dir(mainvar->name, dir1);
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index e98f551a097..056d74aabfb 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -884,7 +884,7 @@ bool DocumentImporter::writeImage( const COLLADAFW::Image* image )
char dir[FILE_MAX];
char full_path[FILE_MAX];
- BLI_split_dirfile(filename, dir, NULL);
+ BLI_split_dirfile(filename, dir, NULL, sizeof(dir), 0);
BLI_join_dirfile(full_path, sizeof(full_path), dir, filepath.c_str());
Image *ima = BKE_add_image_file(full_path);
if (!ima) {
diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp
index 747f3c783d7..53c43677c18 100644
--- a/source/blender/collada/ImageExporter.cpp
+++ b/source/blender/collada/ImageExporter.cpp
@@ -97,7 +97,7 @@ void ImagesExporter::operator()(Material *ma, Object *ob)
char src[FILE_MAX];
char dir[FILE_MAX];
- BLI_split_dirfile(this->export_settings->filepath, dir, NULL);
+ BLI_split_dirfile(this->export_settings->filepath, dir, NULL, sizeof(dir), 0);
BKE_rebase_path(abs, sizeof(abs), rel, sizeof(rel), G.main->name, image->name, dir);
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index c982a1d7f86..fe6aed77462 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -361,7 +361,8 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac)
_doSubChannels=2; \
else {\
filter_mode |= ANIMFILTER_TMP_PEEK; \
- }
+ } \
+ (void) _doSubChannels;
/* ... standard sub-channel filtering can go on here now ... */
#define END_ANIMFILTER_SUBCHANNELS \
filter_mode = _filter; \
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index 937d24eed04..b6398c6a2f5 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -259,7 +259,7 @@ void duplicate_gplayer_frames (bGPDlayer *gpl)
/* Copy and Paste Tools */
/* - The copy/paste buffer currently stores a set of GP_Layers, with temporary
* GP_Frames with the necessary strokes
- * - Unless there is only one element in the buffer, names are also tested to check for compatability.
+ * - Unless there is only one element in the buffer, names are also tested to check for compatibility.
* - All pasted frames are offset by the same amount. This is calculated as the difference in the times of
* the current frame and the 'first keyframe' (i.e. the earliest one in all channels).
* - The earliest frame is calculated per copy operation.
diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h
index 1eedd7ec782..df4113ca07a 100644
--- a/source/blender/editors/include/ED_fileselect.h
+++ b/source/blender/editors/include/ED_fileselect.h
@@ -106,7 +106,7 @@ void ED_fileselect_clear(struct bContext *C, struct SpaceFile *sfile);
void ED_fileselect_exit(struct bContext *C, struct SpaceFile *sfile);
-int ED_file_extension_icon(char *relname);
+int ED_file_extension_icon(const char *relname);
#endif /* ED_FILES_H */
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index a816c1612a1..b6c72c2e96f 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -575,7 +575,7 @@ static void ui_draw_links(uiBlock *block)
/* NOTE: if but->poin is allocated memory for every defbut, things fail... */
static int ui_but_equals_old(uiBut *but, uiBut *oldbut)
{
- /* various properties are being compared here, hopfully sufficient
+ /* various properties are being compared here, hopefully sufficient
* to catch all cases, but it is simple to add more checks later */
if(but->retval != oldbut->retval) return 0;
if(but->rnapoin.data != oldbut->rnapoin.data) return 0;
@@ -640,7 +640,7 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
// but->flag= oldbut->flag;
#else
/* exception! redalert flag can't be update from old button.
- * perhaps it should only copy spesific flags rather than all. */
+ * perhaps it should only copy specific flags rather than all. */
// but->flag= (oldbut->flag & ~UI_BUT_REDALERT) | (but->flag & UI_BUT_REDALERT);
#endif
// but->active= oldbut->active;
@@ -748,7 +748,7 @@ static int ui_but_is_rna_undo(uiBut *but)
if(but->rnapoin.id.data) {
/* avoid undo push for buttons who's ID are screen or wm level
* we could disable undo for buttons with no ID too but may have
- * unforseen conciquences, so best check for ID's we _know_ are not
+ * unforeseen consequences, so best check for ID's we _know_ are not
* handled by undo - campbell */
ID *id= but->rnapoin.id.data;
if(ID_CHECK_UNDO(id) == FALSE) {
@@ -865,7 +865,7 @@ void uiEndBlock(const bContext *C, uiBlock *block)
/* inherit flags from 'old' buttons that was drawn here previous, based
* on matching buttons, we need this to make button event handling non
- * blocking, while still alowing buttons to be remade each redraw as it
+ * blocking, while still allowing buttons to be remade each redraw as it
* is expected by blender code */
for(but=block->buttons.first; but; but=but->next) {
if(ui_but_update_from_old_block(C, block, &but))
@@ -1211,7 +1211,7 @@ void ui_delete_linkline(uiLinkLine *line, uiBut *but)
* an edit override pointer while dragging for example */
/* for buttons pointing to color for example */
-void ui_get_but_vectorf(uiBut *but, float *vec)
+void ui_get_but_vectorf(uiBut *but, float vec[3])
{
PropertyRNA *prop;
int a, tot;
@@ -1249,27 +1249,34 @@ void ui_get_but_vectorf(uiBut *but, float *vec)
vec[0]= vec[1]= vec[2]= 0.0f;
}
}
+
+ if (but->type == BUT_NORMAL) {
+ normalize_v3(vec);
+ }
}
/* for buttons pointing to color for example */
-void ui_set_but_vectorf(uiBut *but, float *vec)
+void ui_set_but_vectorf(uiBut *but, const float vec[3])
{
PropertyRNA *prop;
- int a, tot;
if(but->editvec) {
- VECCOPY(but->editvec, vec);
+ copy_v3_v3(but->editvec, vec);
}
if(but->rnaprop) {
prop= but->rnaprop;
if(RNA_property_type(prop) == PROP_FLOAT) {
+ int tot;
+ int a;
+
tot= RNA_property_array_length(&but->rnapoin, prop);
tot= MIN2(tot, 3);
- for(a=0; a<tot; a++)
+ for (a=0; a<tot; a++) {
RNA_property_float_set_index(&but->rnapoin, prop, a, vec[a]);
+ }
}
}
else if(but->pointype == CHA) {
@@ -1280,7 +1287,7 @@ void ui_set_but_vectorf(uiBut *but, float *vec)
}
else if(but->pointype == FLO) {
float *fp= (float *)but->poin;
- VECCOPY(fp, vec);
+ copy_v3_v3(fp, vec);
}
}
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index c35996701ee..6c661ba014e 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -179,6 +179,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
dtar = &dvar->targets[0];
dtar->id = (ID *)CTX_data_scene(C); // XXX: should we check that C is valid first?
+ dtar->idtype= ID_SCE;
dtar->rna_path = BLI_sprintfN("frame_current");
}
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 9af9b2f55ad..f4400d2d7db 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1252,6 +1252,86 @@ static short test_special_char(char ch)
return 0;
}
+static int ui_textedit_step_next_utf8(const char *str, size_t maxlen, short *pos)
+{
+ const char *str_end= str + (maxlen + 1);
+ const char *str_pos= str + (*pos);
+ const char *str_next= BLI_str_find_next_char_utf8(str_pos, str_end);
+ if (str_next) {
+ (*pos) += (str_next - str_pos);
+ if((*pos) > maxlen) (*pos)= maxlen;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static int ui_textedit_step_prev_utf8(const char *str, size_t UNUSED(maxlen), short *pos)
+{
+ if((*pos) > 0) {
+ const char *str_pos= str + (*pos);
+ const char *str_prev= BLI_str_find_prev_char_utf8(str, str_pos);
+ if (str_prev) {
+ (*pos) -= (str_pos - str_prev);
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+static void ui_textedit_step_utf8(const char *str, size_t maxlen,
+ short *pos, const char direction,
+ const short do_jump, const short do_all)
+{
+ const short pos_prev= *pos;
+
+ if(direction) { /* right*/
+ if(do_jump) {
+ /* jump between special characters (/,\,_,-, etc.),
+ * look at function test_special_char() for complete
+ * list of special character, ctr -> */
+ while((*pos) < maxlen) {
+ if (ui_textedit_step_next_utf8(str, maxlen, pos)) {
+ if(!do_all && test_special_char(str[(*pos)])) break;
+ }
+ else {
+ break; /* unlikely but just incase */
+ }
+ }
+ }
+ else {
+ ui_textedit_step_next_utf8(str, maxlen, pos);
+ }
+ }
+ else { /* left */
+ if(do_jump) {
+ /* left only: compensate for index/change in direction */
+ ui_textedit_step_prev_utf8(str, maxlen, pos);
+
+ /* jump between special characters (/,\,_,-, etc.),
+ * look at function test_special_char() for complete
+ * list of special character, ctr -> */
+ while ((*pos) > 0) {
+ if (ui_textedit_step_prev_utf8(str, maxlen, pos)) {
+ if(!do_all && test_special_char(str[(*pos)])) break;
+ }
+ else {
+ break;
+ }
+ }
+
+ /* left only: compensate for index/change in direction */
+ if(((*pos) != 0) && ABS(pos_prev - (*pos)) > 1) {
+ ui_textedit_step_next_utf8(str, maxlen, pos);
+ }
+ }
+ else {
+ ui_textedit_step_prev_utf8(str, maxlen, pos);
+ }
+ }
+}
+
static int ui_textedit_delete_selection(uiBut *but, uiHandleButtonData *data)
{
char *str= data->str;
@@ -1294,13 +1374,17 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho
/* mouse dragged outside the widget to the left */
if (x < startx && but->ofs > 0) {
- int i= but->ofs;
+ short i= but->ofs;
origstr[but->ofs] = 0;
while (i > 0) {
- i--;
- if (BLF_width(fstyle->uifont_id, origstr+i) > (startx - x)*0.25f) break; // 0.25 == scale factor for less sensitivity
+ if (ui_textedit_step_prev_utf8(origstr, but->ofs, &i)) {
+ if (BLF_width(fstyle->uifont_id, origstr+i) > (startx - x)*0.25f) break; // 0.25 == scale factor for less sensitivity
+ }
+ else {
+ break; /* unlikely but possible */
+ }
}
but->ofs = i;
but->pos = but->ofs;
@@ -1314,9 +1398,13 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho
/* XXX does not take zoom level into account */
while (startx + aspect_sqrt * BLF_width(fstyle->uifont_id, origstr+but->ofs) > x) {
if (but->pos <= 0) break;
- but->pos--;
- origstr[but->pos+but->ofs] = 0;
- }
+ if (ui_textedit_step_prev_utf8(origstr, but->ofs, &but->pos)) {
+ origstr[but->pos+but->ofs] = 0;
+ }
+ else {
+ break; /* unlikely but possible */
+ }
+ }
but->pos += but->ofs;
if(but->pos<0) but->pos= 0;
}
@@ -1391,48 +1479,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction
data->selextend = 0;
}
else {
- if(direction) { /* right*/
- if(jump) {
- /* jump between special characters (/,\,_,-, etc.),
- * look at function test_special_char() for complete
- * list of special character, ctr -> */
- while(but->pos < len) {
- but->pos++;
- if(!jump_all && test_special_char(str[but->pos])) break;
- }
- }
- else {
- but->pos++;
- if(but->pos > len) but->pos= len;
- }
- }
- else { /* left */
- if(jump) {
-
- /* left only: compensate for index/change in direction */
- if(but->pos > 0) {
- but->pos--;
- }
-
- /* jump between special characters (/,\,_,-, etc.),
- * look at function test_special_char() for complete
- * list of special character, ctr -> */
- while(but->pos > 0){
- but->pos--;
- if(!jump_all && test_special_char(str[but->pos])) break;
- }
-
- /* left only: compensate for index/change in direction */
- if((but->pos != 0) && ABS(pos_prev - but->pos) > 1) {
- but->pos++;
- }
-
- }
- else {
- if(but->pos>0) but->pos--;
- }
- }
-
+ ui_textedit_step_utf8(str, len, &but->pos, direction, jump, jump_all);
if(select) {
/* existing selection */
@@ -1498,21 +1545,10 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
changed= ui_textedit_delete_selection(but, data);
}
else if(but->pos>=0 && but->pos<len) {
+ short pos= but->pos;
int step;
-
- if (jump) {
- x = but->pos;
- step= 0;
- while(x < len) {
- x++;
- step++;
- if(test_special_char(str[x])) break;
- }
- }
- else {
- step= 1;
- }
-
+ ui_textedit_step_utf8(str, len, &pos, direction, jump, all);
+ step= pos - but->pos;
for(x=but->pos; x<len; x++)
str[x]= str[x+step];
str[len-step]='\0';
@@ -1525,20 +1561,11 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
changed= ui_textedit_delete_selection(but, data);
}
else if(but->pos>0) {
+ short pos= but->pos;
int step;
- if (jump) {
- x = but->pos;
- step= 0;
- while(x > 0) {
- x--;
- step++;
- if((step > 1) && test_special_char(str[x])) break;
- }
- }
- else {
- step= 1;
- }
+ ui_textedit_step_utf8(str, len, &pos, direction, jump, all);
+ step= but->pos - pos;
for(x=but->pos; x<len; x++)
str[x-step]= str[x];
@@ -1966,8 +1993,6 @@ static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, u
static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data)
{
- float softrange, softmin, softmax;
-
if(but->type == BUT_CURVE) {
but->editcumap= (CurveMapping*)but->poin;
}
@@ -1977,10 +2002,12 @@ static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data)
}
else if(ELEM3(but->type, BUT_NORMAL, HSVCUBE, HSVCIRCLE)) {
ui_get_but_vectorf(but, data->origvec);
- VECCOPY(data->vec, data->origvec);
+ copy_v3_v3(data->vec, data->origvec);
but->editvec= data->vec;
}
else {
+ float softrange, softmin, softmax;
+
data->startvalue= ui_get_but_val(but);
data->origvalue= data->startvalue;
data->value= data->origvalue;
@@ -3004,6 +3031,9 @@ static int ui_numedit_but_NORMAL(uiBut *but, uiHandleButtonData *data, int mx, i
/* button is presumed square */
/* if mouse moves outside of sphere, it does negative normal */
+ /* note that both data->vec and data->origvec should be normalized
+ * else we'll get a hamrless but annoying jump when first clicking */
+
fp= data->origvec;
rad= (but->x2 - but->x1);
radsq= rad*rad;
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 6fb7677da6e..12e9d39e896 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -350,8 +350,8 @@ extern void ui_window_to_region(const ARegion *ar, int *x, int *y);
extern double ui_get_but_val(uiBut *but);
extern void ui_set_but_val(uiBut *but, double value);
extern void ui_set_but_hsv(uiBut *but);
-extern void ui_get_but_vectorf(uiBut *but, float *vec);
-extern void ui_set_but_vectorf(uiBut *but, float *vec);
+extern void ui_get_but_vectorf(uiBut *but, float vec[3]);
+extern void ui_set_but_vectorf(uiBut *but, const float vec[3]);
extern void ui_hsvcircle_vals_from_pos(float *valrad, float *valdist, rcti *rect, float mx, float my);
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 622d50752fa..028ab05464b 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -368,7 +368,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
/* create tooltip data */
data= MEM_callocN(sizeof(uiTooltipData), "uiTooltipData");
- /* special case, enum rna buttons only have enum item description, use general enum description too before the spesific one */
+ /* special case, enum rna buttons only have enum item description, use general enum description too before the specific one */
if(but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) {
const char *descr= RNA_property_description(but->rnaprop);
if(descr && descr[0]) {
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 556876c4d8d..de7c6b1a65e 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -3970,7 +3970,7 @@ static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), float *lastpos, f
copy_v2_v2(handles[a].mval, pos);
copy_v2_v2(handles[a].prevmval, lastpos);
- /* thread spesific */
+ /* thread specific */
handles[a].thread_index = a;
handles[a].projImages = (ProjPaintImage *)BLI_memarena_alloc(ps->arena_mt[a], ps->image_tot * sizeof(ProjPaintImage));
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index ecab180822b..ca4ab3fd7ad 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1699,7 +1699,7 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert
}
}
- /* important to normalize after mirror, otherwise mirror gets wight
+ /* important to normalize after mirror, otherwise mirror gets weight
* which has already been scaled down in relation to other weights,
* then scales a second time [#26193]. Tricky multi-paint code doesn't
* suffer from this problem - campbell */
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 611bf79603e..85edcce35ca 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -181,7 +181,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
but = uiDefButTextO(block, TEX, "FILE_OT_directory", 0, "",
min_x, line1_y, line1_w-chan_offs, btn_h,
- params->dir, 0.0, (float)FILE_MAX-1, 0, 0,
+ params->dir, 0.0, (float)FILE_MAX, 0, 0,
UI_translate_do_tooltip(N_("File path")));
uiButSetCompleteFunc(but, autocomplete_directory, NULL);
uiButSetFlag(but, UI_BUT_NO_UTF8);
@@ -189,7 +189,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
if((params->flag & FILE_DIRSEL_ONLY) == 0) {
but = uiDefBut(block, TEX, B_FS_FILENAME, "",
min_x, line2_y, line2_w-chan_offs, btn_h,
- params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0,
+ params->file, 0.0, (float)FILE_MAXFILE, 0, 0,
UI_translate_do_tooltip(overwrite_alert ?N_("File name, overwrite existing") : N_("File name")));
uiButSetCompleteFunc(but, autocomplete_file, NULL);
uiButSetFlag(but, UI_BUT_NO_UTF8);
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 0955d264ca8..559873bd601 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -666,7 +666,7 @@ void file_operator_to_sfile(SpaceFile *sfile, wmOperator *op)
if((prop= RNA_struct_find_property(op->ptr, "filepath"))) {
char filepath[FILE_MAX];
RNA_property_string_get(op->ptr, prop, filepath);
- BLI_split_dirfile(filepath, sfile->params->dir, sfile->params->file);
+ BLI_split_dirfile(filepath, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
}
else {
if((prop= RNA_struct_find_property(op->ptr, "filename"))) {
@@ -1143,7 +1143,7 @@ int file_directory_exec(bContext *C, wmOperator *UNUSED(unused))
if(BLI_exists(sfile->params->dir) && BLI_is_dir(sfile->params->dir) == 0) {
char path[sizeof(sfile->params->dir)];
BLI_strncpy(path, sfile->params->dir, sizeof(path));
- BLI_split_dirfile(path, sfile->params->dir, sfile->params->file);
+ BLI_split_dirfile(path, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
}
BLI_cleanup_dir(G.main->name, sfile->params->dir);
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index c2e45c5ad8a..b478976d027 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -736,7 +736,7 @@ static int file_is_blend_backup(const char *str)
}
-static int file_extension_type(char *relname)
+static int file_extension_type(const char *relname)
{
if(BLO_has_bfile_extension(relname)) {
return BLENDERFILE;
@@ -769,7 +769,7 @@ static int file_extension_type(char *relname)
return 0;
}
-int ED_file_extension_icon(char *relname)
+int ED_file_extension_icon(const char *relname)
{
int type= file_extension_type(relname);
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 6cc42b2a751..f36145aaba0 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -113,7 +113,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
if (!sfile->params) {
sfile->params= MEM_callocN(sizeof(FileSelectParams), "fileselparams");
/* set path to most recently opened .blend */
- BLI_split_dirfile(G.main->name, sfile->params->dir, sfile->params->file);
+ BLI_split_dirfile(G.main->name, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
sfile->params->filter_glob[0] = '\0';
}
@@ -142,7 +142,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
sfile->params->file[0]= '\0';
}
else {
- BLI_split_dirfile(name, sfile->params->dir, sfile->params->file);
+ BLI_split_dirfile(name, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
}
}
else {
@@ -613,7 +613,7 @@ void autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v))
DIR *dir;
struct dirent *de;
- BLI_split_dirfile(str, dirname, NULL);
+ BLI_split_dirfile(str, dirname, NULL, sizeof(dirname), 0);
dir = opendir(dirname);
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index dc5e71f0406..37e6c0b73c9 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -340,7 +340,7 @@ static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu)
int sel, b;
/* a single call to GL_LINES here around these calls should be sufficient to still
- * get separate line segments, but which aren't wrapped with GL_LINE_STRIP everytime we
+ * get separate line segments, but which aren't wrapped with GL_LINE_STRIP every time we
* want a single line
*/
glBegin(GL_LINES);
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 1c4b0130897..7fa4e62359a 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -321,7 +321,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
char dir_only[FILE_MAX];
char file_only[FILE_MAX];
- BLI_split_dirfile(seq_load.path, dir_only, NULL);
+ BLI_split_dirfile(seq_load.path, dir_only, NULL, sizeof(dir_only), 0);
RNA_BEGIN(op->ptr, itemptr, "files") {
RNA_string_get(&itemptr, "name", file_only);
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index da785430d43..45543a9313e 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -2977,7 +2977,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "directory", directory);
if (is_relative_path) {
- /* TODO, shouldnt this already be relative from the filesel?
+ /* TODO, shouldn't this already be relative from the filesel?
* (as the 'filepath' is) for now just make relative here,
* but look into changing after 2.60 - campbell */
BLI_path_rel(directory, bmain->name);
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 5c2013ee863..45908801147 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -362,7 +362,7 @@ static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop)
PointerRNA itemptr;
char dir[FILE_MAX], file[FILE_MAX];
- BLI_split_dirfile(drag->path, dir, file);
+ BLI_split_dirfile(drag->path, dir, file, sizeof(dir), sizeof(file));
RNA_string_set(drop->ptr, "directory", dir);
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index b38071c29da..e5832e96c1c 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -768,7 +768,7 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa
else glDepthMask(0);
for(vos= strings->first; vos; vos= vos->next) {
-#if 0 // too slow, reading opengl info while drawing is very bad, better to see if we cn use the zbuffer while in pixel space - campbell
+#if 0 // too slow, reading opengl info while drawing is very bad, better to see if we can use the zbuffer while in pixel space - campbell
if(v3d->zbuf && (vos->flag & V3D_CACHE_TEXT_ZBUF)) {
gluProject(vos->vec[0], vos->vec[1], vos->vec[2], mats.modelview, mats.projection, (GLint *)mats.viewport, &ux, &uy, &uz);
glReadPixels(ar->winrct.xmin+vos->mval[0]+vos->xoffs, ar->winrct.ymin+vos->mval[1], 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
@@ -6816,7 +6816,10 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
}
else {
Mesh *me= ob->data;
- if(me->editflag & ME_EDIT_VERT_SEL) {
+ if( (me->editflag & ME_EDIT_VERT_SEL) &&
+ /* currently vertex select only supports weight paint */
+ (ob->mode & OB_MODE_WEIGHT_PAINT))
+ {
DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
glColor3ub(0, 0, 0);
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 8f3b394abe8..f48e1b1c2d0 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1926,7 +1926,7 @@ static void protectedQuaternionBits(short protectflag, float *quat, float *oldqu
quat[3]= oldquat[3];
}
else {
- /* quaternions get limited with euler... (compatability mode) */
+ /* quaternions get limited with euler... (compatibility mode) */
float eul[3], oldeul[3], nquat[4], noldquat[4];
float qlen;
diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c
index 6d524a59b40..f33ee744caa 100644
--- a/source/blender/editors/util/crazyspace.c
+++ b/source/blender/editors/util/crazyspace.c
@@ -438,7 +438,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
int totleft= sculpt_get_first_deform_matrices(scene, ob, deformmats, deformcos);
if(totleft) {
- /* there are deformation modifier which doesn't support deformation matricies
+ /* there are deformation modifier which doesn't support deformation matrices
calculation. Need additional crazyspace correction */
float (*deformedVerts)[3]= *deformcos;
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 492dd34caa6..db574160771 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -340,8 +340,8 @@ typedef struct bPose {
void *ikdata; /* temporary IK data, depends on the IK solver. Not saved in file */
void *ikparam; /* IK solver parameters, structure depends on iksolver */
- bAnimVizSettings avs; /* settings for visualisation of bone animation */
- char proxy_act_bone[32]; /*proxy active bone name*/
+ bAnimVizSettings avs; /* settings for visualization of bone animation */
+ char proxy_act_bone[32]; /* proxy active bone name*/
} bPose;
@@ -423,6 +423,8 @@ typedef enum eItasc_Solver {
* This is also exploited for bone-groups. Bone-Groups are stored per bPose, and are used
* primarily to color bones in the 3d-view. There are other benefits too, but those are mostly related
* to Action-Groups.
+ *
+ * Note that these two uses each have their own RNA 'ActionGroup' and 'BoneGroup'.
*/
typedef struct bActionGroup {
struct bActionGroup *next, *prev;
@@ -651,7 +653,7 @@ typedef enum eAnimEdit_AutoSnap {
* Constraint Channels in certain situations.
*
* Action-Channels can only belong to one group at a time, but they still live the Action's
- * list of achans (to preserve backwards compatability, and also minimise the code
+ * list of achans (to preserve backwards compatibility, and also minimize the code
* that would need to be recoded). Grouped achans are stored at the start of the list, according
* to the position of the group in the list, and their position within the group.
*/
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index e04bdd4ec45..00f6f2433af 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -228,7 +228,7 @@ typedef struct bMinMaxConstraint {
int minmaxflag;
float offset;
int flag;
- short sticky, stuck, pad1, pad2; /* for backward compatability */
+ short sticky, stuck, pad1, pad2; /* for backward compatibility */
float cache[3];
char subtarget[32];
} bMinMaxConstraint;
diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h
index 8fe8b3bcf70..201ea8994ca 100644
--- a/source/blender/makesdna/DNA_ipo_types.h
+++ b/source/blender/makesdna/DNA_ipo_types.h
@@ -30,7 +30,7 @@
* \deprecated
* The contents of this file are now officially depreceated. They were used for the 'old' animation system,
* which has (as of 2.50) been replaced with a completely new system by Joshua Leung (aligorith). All defines,
- * etc. are only still maintained to provide backwards compatability for old files.
+ * etc. are only still maintained to provide backwards compatibility for old files.
*/
#ifndef DNA_IPO_TYPES_H
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index 9fec5207dbb..da2fce4da82 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -386,7 +386,8 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in
#define PART_DRAW_HEALTH 16
#define PART_ABS_PATH_TIME 32
#define PART_DRAW_COUNT_GR 64
-#define PART_DRAW_BB_LOCK 128
+#define PART_DRAW_BB_LOCK 128 /* used with billboards */
+#define PART_DRAW_ROTATE_OB 128 /* used with dupliobjects/groups */
#define PART_DRAW_PARENT 256
#define PART_DRAW_NUM 512
#define PART_DRAW_RAND_GR 1024
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 813375a3549..061a21056d0 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1871,7 +1871,7 @@ static void def_cmp_id_mask(StructRNA *srna)
prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom1");
- RNA_def_property_range(prop, 0, 10000);
+ RNA_def_property_range(prop, 0, 32767);
RNA_def_property_ui_text(prop, "Index", "Pass index number to convert to alpha");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index a6e0e9f3331..c36dca22731 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -53,7 +53,7 @@ static EnumPropertyItem effector_shape_items[] = {
#ifdef RNA_RUNTIME
-/* type spesific return values only used from functions */
+/* type specific return values only used from functions */
static EnumPropertyItem curve_shape_items[] = {
{PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""},
{PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""},
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index f0f782fede2..43d5f87f0d5 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -505,6 +505,17 @@ static int rna_PartSettings_is_fluid_get(PointerRNA *ptr)
return part->type == PART_FLUID;
}
+void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value)
+{
+ Object *ob= ptr->id.data;
+ ParticleSystem *part= (ParticleSystem*)ptr->data;
+
+ /* copy the new name into the name slot */
+ BLI_strncpy_utf8(part->name, value, sizeof(part->name));
+
+ BLI_uniquename(&ob->particlesystem, part, "ParticleSystem", '.', offsetof(ParticleSystem, name), sizeof(part->name));
+}
+
static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr)
{
ParticleSystem *psys= (ParticleSystem*)ptr->data;
@@ -1467,7 +1478,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
static EnumPropertyItem rot_mode_items[] = {
{0, "NONE", 0, "None", ""},
{PART_ROT_NOR, "NOR", 0, "Normal", ""},
- {PART_ROT_VEL, "VEL", 0, "Velocity", ""},
+ {PART_ROT_VEL, "VEL", 0, "Velocity / Hair", ""},
{PART_ROT_GLOB_X, "GLOB_X", 0, "Global X", ""},
{PART_ROT_GLOB_Y, "GLOB_Y", 0, "Global Y", ""},
{PART_ROT_GLOB_Z, "GLOB_Z", 0, "Global Z", ""},
@@ -1722,7 +1733,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "rotmode");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, rot_mode_items);
- RNA_def_property_ui_text(prop, "Rotation", "Particles initial rotation");
+ RNA_def_property_ui_text(prop, "Rotation", "Particle rotation axis");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
prop= RNA_def_property(srna, "angular_velocity_mode", PROP_ENUM, PROP_NONE);
@@ -1787,7 +1798,12 @@ static void rna_def_particle_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_global_dupli", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_GLOBAL_OB);
- RNA_def_property_ui_text(prop, "Use Global", "Use object's global coordinates for duplication");
+ RNA_def_property_ui_text(prop, "Global", "Use object's global coordinates for duplication");
+ RNA_def_property_update(prop, 0, "rna_Particle_redo");
+
+ prop= RNA_def_property(srna, "use_rotation_dupli", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_ROTATE_OB);
+ RNA_def_property_ui_text(prop, "Rotation", "Use object's rotation for duplication (global x-axis is aligned particle rotation axis)");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
prop= RNA_def_property(srna, "use_render_adaptive", PROP_BOOLEAN, PROP_NONE);
@@ -2617,6 +2633,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Particle system name");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL);
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ParticleSystem_name_set");
RNA_def_struct_name_property(srna, prop);
/* access to particle settings is redirected through functions */
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index b61495edc94..e3a3f93b5f3 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -139,6 +139,17 @@ static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
}
}
+void rna_BoneGroup_name_set(PointerRNA *ptr, const char *value)
+{
+ Object *ob= ptr->id.data;
+ bActionGroup *agrp= ptr->data;
+
+ /* copy the new name into the name slot */
+ BLI_strncpy_utf8(agrp->name, value, sizeof(agrp->name));
+
+ BLI_uniquename(&ob->pose->agroups, agrp, "Group", '.', offsetof(bActionGroup, name), sizeof(agrp->name));
+}
+
static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, int create)
{
bPoseChannel *pchan= ptr->data;
@@ -657,6 +668,7 @@ static void rna_def_bone_group(BlenderRNA *brna)
/* name */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_BoneGroup_name_set");
RNA_def_struct_name_property(srna, prop);
// TODO: add some runtime-collections stuff to access grouped bones
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 2cbe51d30e8..143d082a45e 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -814,8 +814,8 @@ static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
{
Scene *scene= (Scene*)ptr->id.data;
SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
-
BLI_strncpy_utf8(rl->name, value, sizeof(rl->name));
+ BLI_uniquename(&scene->r.layers, rl, "RenderLayer", '.', offsetof(SceneRenderLayer, name), sizeof(rl->name));
if(scene->nodetree) {
bNode *node;
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 92739148b99..b90f10693ac 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -443,7 +443,6 @@ static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *
static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
{
Sequence *seq= (Sequence*)(ptr->data);
- char dir[FILE_MAX], name[FILE_MAX];
if(seq->type == SEQ_SOUND && seq->sound) {
/* for sound strips we need to update the sound as well.
@@ -457,9 +456,7 @@ static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
sound_update_scene_sound(seq->scene_sound, seq->sound);
}
- BLI_split_dirfile(value, dir, name);
- BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
- BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
+ BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name));
}
static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value)
@@ -481,11 +478,7 @@ static int rna_Sequence_filepath_length(PointerRNA *ptr)
static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value)
{
StripProxy *proxy= (StripProxy*)(ptr->data);
- char dir[FILE_MAX], name[FILE_MAX];
-
- BLI_split_dirfile(value, dir, name);
- BLI_strncpy(proxy->dir, dir, sizeof(proxy->dir));
- BLI_strncpy(proxy->file, name, sizeof(proxy->file));
+ BLI_split_dirfile(value, proxy->dir, proxy->file, sizeof(proxy->dir), sizeof(proxy->file));
}
static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value)
@@ -541,20 +534,13 @@ static int rna_Sequence_input_count_get(PointerRNA *ptr)
/*static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
{
Sequence *seq= (Sequence*)(ptr->data);
- char dir[FILE_MAX], name[FILE_MAX];
-
- BLI_split_dirfile(value, dir, name);
- BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
- BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
+ BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name));
}
static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
{
StripElem *elem= (StripElem*)(ptr->data);
- char name[FILE_MAX];
-
- BLI_split_dirfile(value, NULL, name);
- BLI_strncpy(elem->name, name, sizeof(elem->name));
+ BLI_split_dirfile(value, NULL, elem->name, 0, sizeof(elem->name));
}*/
static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 11157e67741..e2f0f4dab1f 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -2511,20 +2511,22 @@ static void rna_def_userdef_system(BlenderRNA *brna)
/* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */
/* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */
static EnumPropertyItem language_items[] = {
+ {0, "", 0, "Nearly done", ""},
{0, "DEFAULT", 0, N_("Default (Default)"), ""},
{1, "ENGLISH", 0, N_("English (English)"), "en_US"},
+ {8, "FRENCH", 0, N_("French (Français)"), "fr_FR"},
+ {9, "SPANISH", 0, N_("Spanish (Español)"), "es_ES"},
+ {13, "SIMPLIFIED_CHINESE", 0, N_("Simplified Chinese (简体中文)"), "zh_CN"},
+ {0, "", 0, "In progress", ""},
{2, "JAPANESE", 0, N_("Japanese (日本語)"), "ja_JP"},
{3, "DUTCH", 0, N_("Dutch (Nederlandse taal)"), "nl_NL"},
{4, "ITALIAN", 0, N_("Italian (Italiano)"), "it_IT"},
{5, "GERMAN", 0, N_("German (Deutsch)"), "de_DE"},
{6, "FINNISH", 0, N_("Finnish (Suomi)"), "fi_FI"},
{7, "SWEDISH", 0, N_("Swedish (Svenska)"), "sv_SE"},
- {8, "FRENCH", 0, N_("French (Française)"), "fr_FR"},
- {9, "SPANISH", 0, N_("Spanish (Español)"), "es_ES"},
{10, "CATALAN", 0, N_("Catalan (Català)"), "ca_AD"},
{11, "CZECH", 0, N_("Czech (Český)"), "cs_CZ"},
{12, "BRAZILIAN_PORTUGUESE", 0, N_("Brazilian Portuguese (Português do Brasil)"), "pt_BR"},
- {13, "SIMPLIFIED_CHINESE", 0, N_("Simplified Chinese (简体中文)"), "zh_CN"},
{14, "TRADITIONAL_CHINESE", 0, N_("Traditional Chinese (繁體中文)"), "zh_TW"},
{15, "RUSSIAN", 0, N_("Russian (Русский)"), "ru_RU"},
{16, "CROATIAN", 0, N_("Croatian (Hrvatski)"), "hr_HR"},
@@ -2539,7 +2541,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{24, "KOREAN", 0, N_("Korean (한국 언어)"), "ko_KR"},
/*{25, "NEPALI", 0, N_("Nepali (नेपाली)"), "ne_NP"},*/
/* using the utf8 flipped form of Persian (فارسی) */
- {26, "PERSIAN", 0, N_("Persian (ﺱﺭﺎﻓ)"), "fa_PE"},
+ {26, "PERSIAN", 0, N_("Persian (ﯽﺳﺭﺎﻓ)"), "fa_PE"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c
index 53bbb27f9b0..154f7613223 100644
--- a/source/blender/nodes/intern/node_exec.c
+++ b/source/blender/nodes/intern/node_exec.c
@@ -180,7 +180,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree)
/* prepare group tree inputs */
for (sock=ntree->inputs.first; sock; sock=sock->next) {
- ns = setup_stack(exec->stack, sock);
+ /* ns = */ setup_stack(exec->stack, sock);
}
/* prepare all internal nodes for execution */
for(n=0, nodeexec= exec->nodeexec; n < totnodes; ++n, ++nodeexec) {
@@ -198,7 +198,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree)
/* tag all outputs */
for (sock=node->outputs.first; sock; sock=sock->next) {
- ns = setup_stack(exec->stack, sock);
+ /* ns = */ setup_stack(exec->stack, sock);
}
if(node->typeinfo->initexecfunc)
diff --git a/source/blender/nodes/intern/node_socket.c b/source/blender/nodes/intern/node_socket.c
index aabaf5b86de..51e48b84383 100644
--- a/source/blender/nodes/intern/node_socket.c
+++ b/source/blender/nodes/intern/node_socket.c
@@ -128,6 +128,21 @@ static bNodeSocketType node_socket_type_boolean = {
/* buttonfunc */ NULL,
};
+/****************** SHADER ******************/
+
+static bNodeSocketType node_socket_type_shader = {
+ /* type */ SOCK_SHADER,
+ /* ui_name */ "Shader",
+ /* ui_description */ "Shader",
+ /* ui_icon */ 0,
+ /* ui_color */ {100,200,100,255},
+
+ /* value_structname */ NULL,
+ /* value_structsize */ 0,
+
+ /* buttonfunc */ NULL,
+};
+
/****************** MESH ******************/
static bNodeSocketType node_socket_type_mesh = {
@@ -153,6 +168,7 @@ void node_socket_type_init(bNodeSocketType *types[])
INIT_TYPE(rgba);
INIT_TYPE(int);
INIT_TYPE(boolean);
+ INIT_TYPE(shader);
INIT_TYPE(mesh);
#undef INIT_TYPE
@@ -241,6 +257,17 @@ struct bNodeSocket *nodeAddOutputRGBA(struct bNodeTree *ntree, struct bNode *nod
return sock;
}
+struct bNodeSocket *nodeAddInputShader(struct bNodeTree *ntree, struct bNode *node, const char *name)
+{
+ bNodeSocket *sock= nodeAddSocket(ntree, node, SOCK_IN, name, SOCK_SHADER);
+ return sock;
+}
+struct bNodeSocket *nodeAddOutputShader(struct bNodeTree *ntree, struct bNode *node, const char *name)
+{
+ bNodeSocket *sock= nodeAddSocket(ntree, node, SOCK_OUT, name, SOCK_SHADER);
+ return sock;
+}
+
struct bNodeSocket *nodeAddInputMesh(struct bNodeTree *ntree, struct bNode *node, const char *name)
{
bNodeSocket *sock= nodeAddSocket(ntree, node, SOCK_IN, name, SOCK_MESH);
@@ -271,6 +298,9 @@ struct bNodeSocket *node_add_input_from_template(struct bNodeTree *ntree, struct
case SOCK_RGBA:
sock = nodeAddInputRGBA(ntree, node, stemp->name, stemp->val1, stemp->val2, stemp->val3, stemp->val4);
break;
+ case SOCK_SHADER:
+ sock = nodeAddInputShader(ntree, node, stemp->name);
+ break;
case SOCK_MESH:
sock = nodeAddInputMesh(ntree, node, stemp->name);
break;
@@ -299,6 +329,9 @@ struct bNodeSocket *node_add_output_from_template(struct bNodeTree *ntree, struc
case SOCK_RGBA:
sock = nodeAddOutputRGBA(ntree, node, stemp->name);
break;
+ case SOCK_SHADER:
+ sock = nodeAddOutputShader(ntree, node, stemp->name);
+ break;
case SOCK_MESH:
sock = nodeAddOutputMesh(ntree, node, stemp->name);
break;
diff --git a/source/blender/python/intern/bpy_library.c b/source/blender/python/intern/bpy_library.c
index 603bb0ed0ac..3b0c6a9ff25 100644
--- a/source/blender/python/intern/bpy_library.c
+++ b/source/blender/python/intern/bpy_library.c
@@ -58,7 +58,7 @@
typedef struct {
PyObject_HEAD /* required python macro */
- /* collection iterator spesific parts */
+ /* collection iterator specific parts */
char relpath[FILE_MAX];
char abspath[FILE_MAX]; /* absolute path */
BlendHandle *blo_handle;
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index b1700aa53c6..7570b5642ef 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -1089,7 +1089,7 @@ static PyObject *Matrix_decompose(MatrixObject *self)
PyDoc_STRVAR(Matrix_lerp_doc,
".. function:: lerp(other, factor)\n"
"\n"
-" Returns the interpolation of two matricies.\n"
+" Returns the interpolation of two matrices.\n"
"\n"
" :arg other: value to interpolate with.\n"
" :type other: :class:`Matrix`\n"
@@ -1669,7 +1669,7 @@ static PyObject *Matrix_subscript(MatrixObject* self, PyObject* item)
}
else {
PyErr_SetString(PyExc_IndexError,
- "slice steps not supported with matricies");
+ "slice steps not supported with matrices");
return NULL;
}
}
@@ -1701,7 +1701,7 @@ static int Matrix_ass_subscript(MatrixObject* self, PyObject* item, PyObject* va
return Matrix_ass_slice(self, start, stop, value);
else {
PyErr_SetString(PyExc_IndexError,
- "slice steps not supported with matricies");
+ "slice steps not supported with matrices");
return -1;
}
}
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 70e90164e81..56e9494a43e 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -443,14 +443,6 @@ elseif(WIN32)
endif()
endif()
- install( # same as linux!, deduplicate
- DIRECTORY
- ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
- ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
- DESTINATION ${TARGETDIR_VER}/datafiles
- PATTERN ".svn" EXCLUDE
- )
-
# plugins in blender 2.5 don't work at the moment.
#
# install(
@@ -656,8 +648,8 @@ elseif(APPLE)
if(WITH_INTERNATIONAL)
install(
DIRECTORY
- ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
+ ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
DESTINATION ${TARGETDIR_VER}/datafiles
PATTERN ".svn" EXCLUDE
)
diff --git a/source/darwin/blender.app/Contents/Info.plist b/source/darwin/blender.app/Contents/Info.plist
index 23941d91075..7fab4a98c4b 100644
--- a/source/darwin/blender.app/Contents/Info.plist
+++ b/source/darwin/blender.app/Contents/Info.plist
@@ -1,36 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
-<plist version="0.9">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
<dict>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
-
- <key>CFBundleExecutable</key>
- <string>blender</string>
-
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
-
- <key>CFBundleIconFile</key>
- <string>blender icon.icns</string>
-
- <key>CFBundleName</key>
- <string>Blender</string>
- <key>CFBundleIdentifier</key>
- <string>org.blenderfoundation.blender</string>
-
- <key>CFBundleVersion</key>
- <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}, Blender Foundation</string>
- <key>CFBundleShortVersionString</key>
- <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
- <key>CFBundleGetInfoString</key>
- <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}, Blender Foundation</string>
-
<key>CFBundleDocumentTypes</key>
<array>
<dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>blend</string>
+ </array>
<key>CFBundleTypeIconFile</key>
<string>blender file icon.icns</string>
<key>CFBundleTypeName</key>
@@ -39,15 +17,36 @@
<array>
<string>BLND</string>
</array>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>blend</string>
- </array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSIsAppleDefaultForType</key>
- <true/>
+ <true/>
</dict>
</array>
+ <key>CFBundleExecutable</key>
+ <string>blender</string>
+ <key>CFBundleGetInfoString</key>
+ <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}, Blender Foundation</string>
+ <key>CFBundleIconFile</key>
+ <string>blender icon.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.blenderfoundation.blender</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Blender</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}, Blender Foundation</string>
+ <key>LSEnvironment</key>
+ <dict>
+ <key>OMP_NUM_THREADS</key>
+ <string>2</string>
+ </dict>
</dict>
</plist>
diff --git a/source/darwin/set_simulation_threads.app/Contents/Info.plist b/source/darwin/set_simulation_threads.app/Contents/Info.plist
new file mode 100644
index 00000000000..71ec4a4d0c1
--- /dev/null
+++ b/source/darwin/set_simulation_threads.app/Contents/Info.plist
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleAllowMixedLocalizations</key>
+ <true/>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>applet</string>
+ <key>CFBundleIconFile</key>
+ <string>applet</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>set_simulation_threads</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>aplt</string>
+ <key>LSMinimumSystemVersionByArchitecture</key>
+ <dict>
+ <key>x86_64</key>
+ <string>10.6</string>
+ </dict>
+ <key>LSRequiresCarbon</key>
+ <true/>
+ <key>WindowState</key>
+ <dict>
+ <key>dividerCollapsed</key>
+ <false/>
+ <key>eventLogLevel</key>
+ <integer>-1</integer>
+ <key>name</key>
+ <string>ScriptWindowState</string>
+ <key>positionOfDivider</key>
+ <real>400</real>
+ <key>savedFrame</key>
+ <string>424 473 1435 704 0 0 1920 1178 </string>
+ <key>selectedTabView</key>
+ <string>result</string>
+ </dict>
+</dict>
+</plist>
diff --git a/source/darwin/set_simulation_threads.app/Contents/MacOS/applet b/source/darwin/set_simulation_threads.app/Contents/MacOS/applet
new file mode 100755
index 00000000000..0079f4b19d4
--- /dev/null
+++ b/source/darwin/set_simulation_threads.app/Contents/MacOS/applet
Binary files differ
diff --git a/source/darwin/set_simulation_threads.app/Contents/PkgInfo b/source/darwin/set_simulation_threads.app/Contents/PkgInfo
new file mode 100644
index 00000000000..3253614c402
--- /dev/null
+++ b/source/darwin/set_simulation_threads.app/Contents/PkgInfo
@@ -0,0 +1 @@
+APPLaplt \ No newline at end of file
diff --git a/source/darwin/set_simulation_threads.app/Contents/Resources/Scripts/main.scpt b/source/darwin/set_simulation_threads.app/Contents/Resources/Scripts/main.scpt
new file mode 100644
index 00000000000..7a0e345348c
--- /dev/null
+++ b/source/darwin/set_simulation_threads.app/Contents/Resources/Scripts/main.scpt
Binary files differ
diff --git a/source/darwin/set_simulation_threads.app/Contents/Resources/applet.icns b/source/darwin/set_simulation_threads.app/Contents/Resources/applet.icns
new file mode 100644
index 00000000000..fcc1f09273d
--- /dev/null
+++ b/source/darwin/set_simulation_threads.app/Contents/Resources/applet.icns
Binary files differ
diff --git a/source/darwin/set_simulation_threads.app/Contents/Resources/applet.rsrc b/source/darwin/set_simulation_threads.app/Contents/Resources/applet.rsrc
new file mode 100644
index 00000000000..44dcf1a9f60
--- /dev/null
+++ b/source/darwin/set_simulation_threads.app/Contents/Resources/applet.rsrc
Binary files differ
diff --git a/source/darwin/set_simulation_threads.app/Contents/Resources/description.rtfd/TXT.rtf b/source/darwin/set_simulation_threads.app/Contents/Resources/description.rtfd/TXT.rtf
new file mode 100644
index 00000000000..0d0a60c08b5
--- /dev/null
+++ b/source/darwin/set_simulation_threads.app/Contents/Resources/description.rtfd/TXT.rtf
@@ -0,0 +1,4 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230
+{\fonttbl}
+{\colortbl;\red255\green255\blue255;}
+} \ No newline at end of file
diff --git a/source/darwin/set_simulation_threads_applescript.scpt b/source/darwin/set_simulation_threads_applescript.scpt
new file mode 100644
index 00000000000..ba05af64178
--- /dev/null
+++ b/source/darwin/set_simulation_threads_applescript.scpt
Binary files differ
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 62ca2910c60..40917a67c2f 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -502,7 +502,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
BLI_path_abs(cpath, gp_GamePythonPath);
} else {
/* Get the dir only */
- BLI_split_dirfile(gp_GamePythonPath, cpath, NULL);
+ BLI_split_dirfile(gp_GamePythonPath, cpath, NULL, sizeof(cpath), 0);
}
if((dp = opendir(cpath)) == NULL) {
@@ -1732,7 +1732,7 @@ static void initPySysObjects__append(PyObject *sys_path, char *filename)
PyObject *item;
char expanded[FILE_MAXDIR + FILE_MAXFILE];
- BLI_split_dirfile(filename, expanded, NULL); /* get the dir part of filename only */
+ BLI_split_dirfile(filename, expanded, NULL, sizeof(expanded), 0); /* get the dir part of filename only */
BLI_path_abs(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */
BLI_cleanup_file(gp_GamePythonPath, expanded); /* Dont use BLI_cleanup_dir because it adds a slash - BREAKS WIN32 ONLY */
item= PyUnicode_DecodeFSDefault(expanded);