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:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-10-20 13:49:39 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-10-20 13:49:39 +0400
commit3dfd4808c3d9376e25a9c43a9e1be993226ac379 (patch)
tree98ae4a9d7f32f2494a303b25d114241cf770c95a
parentbb9b29bd79faa4c2af36afadf4de5d59817f6999 (diff)
parente02dfe4a79b3632b3143d5d45e0dee1463ff7aa6 (diff)
Merging r41120 through from trunk r41139 into soc-2011-tomato
-rw-r--r--CMakeLists.txt8
-rw-r--r--GNUmakefile6
-rw-r--r--build_files/scons/tools/Blender.py4
-rwxr-xr-xdoc/blender_file_format/BlendFileDnaExporter_25.py6
-rw-r--r--doc/blender_file_format/README6
-rw-r--r--doc/python_api/sphinx_doc_gen.py4
-rwxr-xr-xdoc/python_api/sphinx_doc_gen.sh2
-rw-r--r--intern/audaspace/intern/AUD_ChannelMapperReader.cpp2
-rw-r--r--intern/ghost/GHOST_Types.h1
-rw-r--r--intern/ghost/intern/GHOST_EventKey.h5
-rw-r--r--intern/ghost/intern/GHOST_SystemCarbon.cpp2
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm6
-rw-r--r--intern/ghost/intern/GHOST_SystemSDL.cpp2
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp3
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp55
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.h17
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp14
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.h8
-rw-r--r--release/scripts/presets/interaction/blender.py2
-rw-r--r--release/scripts/startup/bl_operators/anim.py2
-rw-r--r--release/scripts/startup/bl_operators/object.py2
-rw-r--r--release/scripts/startup/bl_operators/presets.py2
-rw-r--r--release/scripts/startup/bl_operators/screen_play_rendered_anim.py2
-rw-r--r--release/scripts/startup/bl_operators/vertexpaint_dirt.py2
-rw-r--r--source/blender/blenkernel/BKE_packedFile.h2
-rw-r--r--source/blender/blenkernel/SConscript3
-rw-r--r--source/blender/blenkernel/intern/image.c6
-rw-r--r--source/blender/blenkernel/intern/modifier.c4
-rw-r--r--source/blender/blenkernel/intern/node.c2
-rw-r--r--source/blender/blenkernel/intern/packedFile.c53
-rw-r--r--source/blender/blenkernel/intern/pointcache.c10
-rw-r--r--source/blender/blenkernel/intern/property.c6
-rw-r--r--source/blender/blenkernel/intern/sequencer.c14
-rw-r--r--source/blender/blenkernel/intern/sound.c4
-rw-r--r--source/blender/blenkernel/intern/texture.c2
-rw-r--r--source/blender/blenlib/BLI_utildefines.h2
-rw-r--r--source/blender/blenlib/intern/fileops.c8
-rw-r--r--source/blender/blenlib/intern/freetypefont.c2
-rw-r--r--source/blender/blenlib/intern/storage.c12
-rw-r--r--source/blender/blenloader/BLO_readfile.h2
-rw-r--r--source/blender/blenloader/BLO_runtime.h4
-rw-r--r--source/blender/blenloader/intern/readblenentry.c2
-rw-r--r--source/blender/blenloader/intern/readfile.c16
-rw-r--r--source/blender/blenloader/intern/runtime.c4
-rw-r--r--source/blender/collada/AnimationImporter.cpp4
-rw-r--r--source/blender/editors/armature/editarmature.c6
-rw-r--r--source/blender/editors/armature/poselib.c9
-rw-r--r--source/blender/editors/armature/poseobject.c2
-rw-r--r--source/blender/editors/curve/editfont.c2
-rw-r--r--source/blender/editors/gpencil/editaction_gpencil.c2
-rw-r--r--source/blender/editors/interface/interface.c22
-rw-r--r--source/blender/editors/interface/interface_anim.c4
-rw-r--r--source/blender/editors/interface/interface_handlers.c134
-rw-r--r--source/blender/editors/interface/interface_intern.h6
-rw-r--r--source/blender/editors/interface/interface_templates.c32
-rw-r--r--source/blender/editors/interface/resources.c2
-rw-r--r--source/blender/editors/object/object_constraint.c2
-rw-r--r--source/blender/editors/object/object_edit.c2
-rw-r--r--source/blender/editors/object/object_hook.c2
-rw-r--r--source/blender/editors/object/object_relations.c10
-rw-r--r--source/blender/editors/object/object_vgroup.c2
-rw-r--r--source/blender/editors/render/render_preview.c2
-rw-r--r--source/blender/editors/screen/screen_ops.c2
-rw-r--r--source/blender/editors/screen/screendump.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c4
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c2
-rw-r--r--source/blender/editors/space_image/image_buttons.c4
-rw-r--r--source/blender/editors/space_info/info_report.c2
-rw-r--r--source/blender/editors/space_logic/logic_ops.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c4
-rw-r--r--source/blender/editors/space_text/space_text.c5
-rw-r--r--source/blender/editors/space_text/text_ops.c3
-rw-r--r--source/blender/editors/transform/transform_conversions.c2
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c2
-rw-r--r--source/blender/imbuf/intern/anim_movie.c2
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp56
-rw-r--r--source/blender/makesdna/DNA_space_types.h3
-rw-r--r--source/blender/makesrna/intern/rna_action.c3
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c2
-rw-r--r--source/blender/makesrna/intern/rna_animation.c12
-rw-r--r--source/blender/makesrna/intern/rna_boid.c2
-rw-r--r--source/blender/makesrna/intern/rna_curve.c10
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c5
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c3
-rw-r--r--source/blender/makesrna/intern/rna_image.c8
-rw-r--r--source/blender/makesrna/intern/rna_lattice.c7
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c21
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c6
-rw-r--r--source/blender/makesrna/intern/rna_object.c16
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c40
-rw-r--r--source/blender/makesrna/intern/rna_pose.c68
-rw-r--r--source/blender/makesrna/intern/rna_render.c4
-rw-r--r--source/blender/makesrna/intern/rna_rna.c6
-rw-r--r--source/blender/makesrna/intern/rna_scene.c22
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c19
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c2
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c8
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
-rw-r--r--source/blender/makesrna/intern/rna_texture.c22
-rw-r--r--source/blender/makesrna/intern/rna_ui.c24
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c16
-rw-r--r--source/blender/makesrna/intern/rna_wm.c30
-rw-r--r--source/blender/makesrna/intern/rna_world.c4
-rwxr-xr-xsource/blender/makesrna/rna_cleanup/rna_cleaner.py2
-rwxr-xr-xsource/blender/makesrna/rna_cleanup/rna_update.sh2
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c3
-rw-r--r--source/blender/nodes/intern/node_common.c4
-rw-r--r--source/blender/python/generic/py_capi_utils.c9
-rw-r--r--source/blender/python/generic/py_capi_utils.h1
-rw-r--r--source/blender/render/intern/source/pipeline.c2
-rw-r--r--source/blender/render/intern/source/renderdatabase.c4
-rw-r--r--source/blender/windowmanager/WM_types.h4
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c1
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c82
-rw-r--r--source/creator/CMakeLists.txt4
-rw-r--r--source/creator/creator.c4
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp9
-rw-r--r--source/gameengine/GameLogic/CMakeLists.txt4
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp44
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_Joystick.h12
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp8
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h4
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickManager.cpp2
-rw-r--r--source/gameengine/GameLogic/SConscript3
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp6
-rw-r--r--source/gameengine/Ketsji/BL_Action.cpp5
-rw-r--r--source/gameengine/Ketsji/CMakeLists.txt3
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp10
-rw-r--r--source/gameengine/Ketsji/KX_MouseFocusSensor.cpp18
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp2
-rw-r--r--source/gameengine/Ketsji/SConscript3
-rw-r--r--source/gameengine/Rasterizer/RAS_FramingManager.cpp2
-rw-r--r--source/tests/CMakeLists.txt2
-rw-r--r--source/tests/rna_info_dump.py2
135 files changed, 827 insertions, 461 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3331606b68..361b9404bec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -216,6 +216,10 @@ mark_as_advanced(WITH_CXX_GUARDEDALLOC)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
mark_as_advanced(WITH_ASSERT_ABORT)
+option(WITH_PYTHON_UI_INFO "Allow navigating to UI source from the context menu" OFF)
+mark_as_advanced(WITH_PYTHON_UI_INFO)
+
+
if(APPLE)
if(NOT CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
@@ -1329,6 +1333,10 @@ if(WITH_ASSERT_ABORT)
add_definitions(-DWITH_ASSERT_ABORT)
endif()
+if(WITH_PYTHON_UI_INFO)
+ add_definitions(-DWITH_PYTHON_UI_INFO)
+endif()
+
# message(STATUS "Using CFLAGS: ${CMAKE_C_FLAGS}")
# message(STATUS "Using CXXFLAGS: ${CMAKE_CXX_FLAGS}")
diff --git a/GNUmakefile b/GNUmakefile
index af953143b82..c68c8684687 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -174,7 +174,7 @@ package_archive:
# Other Targets
#
translations:
- $(BUILD_DIR)/bin/blender --background --factory-startup --python po/update_msg.py
+ $(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python po/update_msg.py
python3 po/update_pot.py
python3 po/update_po.py
python3 po/update_mo.py
@@ -238,12 +238,12 @@ check_sparse:
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py:
- $(BUILD_DIR)/bin/blender --background --factory-startup --python doc/python_api/sphinx_doc_gen.py
+ $(BUILD_DIR)/bin/blender --background -noaudio --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: '$(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
+ $(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man:
diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py
index 9c60cbf6a3a..46f07b93fb9 100644
--- a/build_files/scons/tools/Blender.py
+++ b/build_files/scons/tools/Blender.py
@@ -316,8 +316,8 @@ def creator(env):
if env['WITH_BF_TIFF']:
defs.append('WITH_TIFF')
- if not env['WITH_BF_SDL']:
- defs.append('DISABLE_SDL')
+ if env['WITH_BF_SDL']:
+ defs.append('WITH_SDL')
if env['WITH_BF_LIBMV']:
incs.append('#/extern/libmv')
diff --git a/doc/blender_file_format/BlendFileDnaExporter_25.py b/doc/blender_file_format/BlendFileDnaExporter_25.py
index 988c992fd78..bc5b2e73c7e 100755
--- a/doc/blender_file_format/BlendFileDnaExporter_25.py
+++ b/doc/blender_file_format/BlendFileDnaExporter_25.py
@@ -379,15 +379,15 @@ class DNACatalogHTML:
def usage():
- print("\nUsage: \n\tblender2.5 -b -P BlendFileDnaExporter_25.py [-- [options]]")
+ print("\nUsage: \n\tblender2.5 --background -noaudio --python BlendFileDnaExporter_25.py [-- [options]]")
print("Options:")
print("\t--dna-keep-blend: doesn't delete the produced blend file DNA export to html")
print("\t--dna-debug: sets the logging level to DEBUG (lots of additional info)")
print("\t--dna-versioned saves version informations in the html and blend filenames")
print("\t--dna-overwrite-css overwrite dna.css, useful when modifying css in the script")
print("Examples:")
- print("\tdefault: % blender2.5 -b -P BlendFileDnaExporter_25.py")
- print("\twith options: % blender2.5 -b -P BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug\n")
+ print("\tdefault: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py")
+ print("\twith options: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug\n")
######################################################
diff --git a/doc/blender_file_format/README b/doc/blender_file_format/README
index 55dc3b83e49..f28d4b3f6b6 100644
--- a/doc/blender_file_format/README
+++ b/doc/blender_file_format/README
@@ -16,14 +16,14 @@ Below you have the help message with a list of options you can use.
Usage:
- blender2.5 -b -P BlendFileDnaExporter_25.py [-- [options]]
+ blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py [-- [options]]
Options:
--dna-keep-blend: doesn't delete the produced blend file DNA export to html
--dna-debug: sets the logging level to DEBUG (lots of additional info)
--dna-versioned saves version informations in the html and blend filenames
--dna-overwrite-css overwrite dna.css, useful when modifying css in the script
Examples:
- default: % blender2.5 -b -P BlendFileDnaExporter_25.py
- with options: % blender2.5 -b -P BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug
+ default: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py
+ with options: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 2ccf67e2db4..017c2acc363 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -27,7 +27,7 @@ For HTML generation
-------------------
- Run this script from blenders root path once you have compiled blender
- ./blender.bin --background --python doc/python_api/sphinx_doc_gen.py
+ ./blender.bin --background -noaudio --python doc/python_api/sphinx_doc_gen.py
This will generate python files in doc/python_api/sphinx-in/
providing ./blender.bin is or links to the blender executable
@@ -94,7 +94,7 @@ else:
# for quick rebuilds
"""
rm -rf /b/doc/python_api/sphinx-* && \
-./blender.bin --background --factory-startup --python doc/python_api/sphinx_doc_gen.py && \
+./blender.bin --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py && \
sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
"""
diff --git a/doc/python_api/sphinx_doc_gen.sh b/doc/python_api/sphinx_doc_gen.sh
index 307476d9a92..fad9bfbbf90 100755
--- a/doc/python_api/sphinx_doc_gen.sh
+++ b/doc/python_api/sphinx_doc_gen.sh
@@ -48,7 +48,7 @@ SPHINXBASE=doc/python_api
if $DO_EXE_BLENDER ; then
# dont delete existing docs, now partial updates are used for quick builds.
- $BLENDER --background --factory-startup --python $SPHINXBASE/sphinx_doc_gen.py
+ $BLENDER --background -noaudio --factory-startup --python $SPHINXBASE/sphinx_doc_gen.py
fi
diff --git a/intern/audaspace/intern/AUD_ChannelMapperReader.cpp b/intern/audaspace/intern/AUD_ChannelMapperReader.cpp
index 27d10ce6dc8..7764164a9b0 100644
--- a/intern/audaspace/intern/AUD_ChannelMapperReader.cpp
+++ b/intern/audaspace/intern/AUD_ChannelMapperReader.cpp
@@ -352,7 +352,7 @@ const float AUD_ChannelMapperReader::SURROUND71_ANGLES[] =
0.0f * M_PI / 180.0f,
0.0f * M_PI / 180.0f,
-110.0f * M_PI / 180.0f,
- 110.0f * M_PI / 180.0f
+ 110.0f * M_PI / 180.0f,
-150.0f * M_PI / 180.0f,
150.0f * M_PI / 180.0f
};
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index dd399a7aa95..78fc3f69c7a 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -468,6 +468,7 @@ typedef struct {
GHOST_TKey key;
/** The ascii code for the key event ('\0' if none). */
char ascii;
+ char utf8_buf[6];
} GHOST_TEventKeyData;
typedef struct {
diff --git a/intern/ghost/intern/GHOST_EventKey.h b/intern/ghost/intern/GHOST_EventKey.h
index 3581cd86b20..a8fca1e8f2d 100644
--- a/intern/ghost/intern/GHOST_EventKey.h
+++ b/intern/ghost/intern/GHOST_EventKey.h
@@ -55,6 +55,7 @@ public:
{
m_keyEventData.key = key;
m_keyEventData.ascii = '\0';
+ m_keyEventData.utf8_buf[0]= '\0';
m_data = &m_keyEventData;
}
@@ -65,11 +66,13 @@ public:
* @param key The key code of the key.
* @param ascii The ascii code for the key event.
*/
- GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key, char ascii)
+ GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key, char ascii, const char utf8_buf[6])
: GHOST_Event(msec, type, window)
{
m_keyEventData.key = key;
m_keyEventData.ascii = ascii;
+ if (utf8_buf) memcpy(m_keyEventData.utf8_buf, utf8_buf, sizeof(m_keyEventData.utf8_buf));
+ else m_keyEventData.utf8_buf[0]= '\0';
m_data = &m_keyEventData;
}
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp
index 02ff5c0f559..762966c9b9e 100644
--- a/intern/ghost/intern/GHOST_SystemCarbon.cpp
+++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp
@@ -931,7 +931,7 @@ OSStatus GHOST_SystemCarbon::handleKeyEvent(EventRef event)
} else {
type = GHOST_kEventKeyUp;
}
- pushEvent( new GHOST_EventKey( getMilliSeconds(), type, window, key, ascii) );
+ pushEvent( new GHOST_EventKey( getMilliSeconds(), type, window, key, ascii, NULL) );
// }
break;
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 303c2b24497..58a856375bb 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1655,7 +1655,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
return GHOST_kFailure;
}
+ char utf8_buf[6]= {'\0'}; /* TODO, unicode input */
switch ([event type]) {
+
case NSKeyDown:
case NSKeyUp:
charsIgnoringModifiers = [event charactersIgnoringModifiers];
@@ -1684,10 +1686,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
break; //Cmd-Q is directly handled by Cocoa
if ([event type] == NSKeyDown) {
- pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii) );
+ pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii, utf8_buf) );
//printf("\nKey down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii);
} else {
- pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, ascii) );
+ pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, ascii, utf8_buf) );
//printf("\nKey up rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii);
}
break;
diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp
index f2cc45731fa..11bd562f767 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.cpp
+++ b/intern/ghost/intern/GHOST_SystemSDL.cpp
@@ -441,7 +441,7 @@ GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
}
}
- g_event= new GHOST_EventKey(getMilliSeconds(), type, window, gkey, sym);
+ g_event= new GHOST_EventKey(getMilliSeconds(), type, window, gkey, sym, NULL);
}
break;
}
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 38f3985b139..24b6474732e 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -725,7 +725,8 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP
(LPSTR) &ascii, 1,
NULL,NULL);
- event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, ascii);
+ /* TODO, last arg is utf8, need to pass utf8 arg */
+ event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, ascii, NULL);
#ifdef GHOST_DEBUG
std::cout << ascii << std::endl;
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 27a61cf57fc..209ffe501f4 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -89,6 +89,11 @@ GHOST_SystemX11(
abort(); //was return before, but this would just mean it will crash later
}
+ /* Open a connection to the X input manager */
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+ m_xim = XOpenIM(m_display, NULL, (char *)GHOST_X11_RES_NAME, (char *)GHOST_X11_RES_CLASS);
+#endif
+
m_delete_window_atom
= XInternAtom(m_display, "WM_DELETE_WINDOW", True);
@@ -141,6 +146,10 @@ GHOST_SystemX11(
GHOST_SystemX11::
~GHOST_SystemX11()
{
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+ XCloseIM(m_xim);
+#endif
+
XCloseDisplay(m_display);
}
@@ -500,9 +509,9 @@ GHOST_SystemX11::processEvent(XEvent *xe)
case KeyRelease:
{
XKeyEvent *xke = &(xe->xkey);
-
KeySym key_sym = XLookupKeysym(xke,0);
char ascii;
+ char utf8_buf[6]; /* 6 is enough for a utf8 char */
GHOST_TKey gkey = convertXKey(key_sym);
GHOST_TEventType type = (xke->type == KeyPress) ?
@@ -512,13 +521,55 @@ GHOST_SystemX11::processEvent(XEvent *xe)
ascii = '\0';
}
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+ /* getting unicode on key-up events gives XLookupNone status */
+ if (xke->type == KeyPress) {
+ Status status;
+ int len;
+
+ /* use utf8 because its not locale depentant, from xorg docs */
+ if (!(len= Xutf8LookupString(window->getX11_XIC(), xke, utf8_buf, sizeof(utf8_buf), &key_sym, &status))) {
+ utf8_buf[0]= '\0';
+ }
+
+ if ((status == XLookupChars || status == XLookupBoth)) {
+ if ((unsigned char)utf8_buf[0] >= 32) { /* not an ascii control character */
+ /* do nothing for now, this is valid utf8 */
+ }
+ else {
+ utf8_buf[0]= '\0';
+ }
+ }
+ else if (status == XLookupKeySym) {
+ /* this key doesn't have a text representation, it is a command
+ key of some sort */;
+ }
+ else {
+ printf("Bad keycode lookup. Keysym 0x%x Status: %s\n",
+ (unsigned int) key_sym,
+ (status == XBufferOverflow ? "BufferOverflow" :
+ status == XLookupNone ? "XLookupNone" :
+ status == XLookupKeySym ? "XLookupKeySym" :
+ "Unknown status"));
+
+ printf("'%.*s' %p %p\n", len, utf8_buf, window->getX11_XIC(), m_xim);
+ }
+ }
+ else {
+ utf8_buf[0]= '\0';
+ }
+#else
+ utf8_buf[0]= '\0';
+#endif
+
g_event = new
GHOST_EventKey(
getMilliSeconds(),
type,
window,
gkey,
- ascii
+ ascii,
+ utf8_buf
);
break;
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index b43d955d156..af45d68450f 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -40,6 +40,12 @@
#include "GHOST_System.h"
#include "../GHOST_Types.h"
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+# define GHOST_X11_RES_NAME "Blender" /* res_name */
+# define GHOST_X11_RES_CLASS "Blender" /* res_class */
+#endif
+
+
class GHOST_WindowX11;
/**
@@ -203,6 +209,14 @@ public:
return m_display;
}
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+ XIM
+ getX11_XIM(
+ ) {
+ return m_xim;
+ }
+#endif
+
/* Helped function for get data from the clipboard. */
void getClipboard_xcout(XEvent evt, Atom sel, Atom target,
unsigned char **txt, unsigned long *len,
@@ -258,6 +272,9 @@ public:
private :
Display * m_display;
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+ XIM m_xim;
+#endif
/// The vector of windows that need to be updated.
std::vector<GHOST_WindowX11 *> m_dirty_windows;
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 160980b6331..d26224d956a 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -392,6 +392,13 @@ GHOST_WindowX11(
}
}
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+ m_xic = XCreateIC(m_system->getX11_XIM(), XNClientWindow, m_window, XNFocusWindow, m_window,
+ XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
+ XNResourceName, GHOST_X11_RES_NAME, XNResourceClass,
+ GHOST_X11_RES_CLASS, NULL);
+#endif
+
// Set the window icon
XWMHints *xwmhints = XAllocWMHints();
XImage *x_image, *mask_image;
@@ -1304,6 +1311,13 @@ GHOST_WindowX11::
XSetSelectionOwner(m_display, Clipboard_atom, None, CurrentTime);
}
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+ if (m_xic) {
+ XDestroyIC(m_xic);
+ }
+#endif
+
+
XDestroyWindow(m_display, m_window);
XFree(m_visual);
}
diff --git a/intern/ghost/intern/GHOST_WindowX11.h b/intern/ghost/intern/GHOST_WindowX11.h
index 2cb269ea919..ee662945eaa 100644
--- a/intern/ghost/intern/GHOST_WindowX11.h
+++ b/intern/ghost/intern/GHOST_WindowX11.h
@@ -221,6 +221,10 @@ public:
{ return NULL; }
#endif // WITH_X11_XINPUT
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+ XIC getX11_XIC() { return m_xic; }
+#endif
+
/*
* Need this in case that we want start the window
* in FullScree or Maximized state.
@@ -363,6 +367,10 @@ private :
XTablet m_xtablet;
#endif
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+ XIC m_xic;
+#endif
+
void icccmSetState(int state);
int icccmGetState() const;
diff --git a/release/scripts/presets/interaction/blender.py b/release/scripts/presets/interaction/blender.py
index 3b6ce13d7e0..c5454e479a3 100644
--- a/release/scripts/presets/interaction/blender.py
+++ b/release/scripts/presets/interaction/blender.py
@@ -9,5 +9,5 @@ bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False
bpy.context.user_preferences.inputs.select_mouse = 'RIGHT'
bpy.context.user_preferences.inputs.view_zoom_method = 'DOLLY'
bpy.context.user_preferences.inputs.view_zoom_axis = 'VERTICAL'
-bpy.context.user_preferences.inputs.view_rotate_method = 'TRACKBALL'
+bpy.context.user_preferences.inputs.view_rotate_method = 'TURNTABLE'
bpy.context.user_preferences.inputs.invert_mouse_zoom = False
diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py
index 3051914cf00..e1d33198142 100644
--- a/release/scripts/startup/bl_operators/anim.py
+++ b/release/scripts/startup/bl_operators/anim.py
@@ -228,7 +228,7 @@ class BakeAction(Operator):
class ClearUselessActions(Operator):
"""Mark actions with no F-Curves for deletion after save+reload of """ \
- """file preserving "action libraries"""
+ """file preserving \"action libraries\""""
bl_idname = "anim.clear_useless_actions"
bl_label = "Clear Useless Actions"
bl_options = {'REGISTER', 'UNDO'}
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py
index 51c530db672..738cc7b24e0 100644
--- a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -122,7 +122,7 @@ class SelectCamera(Operator):
class SelectHierarchy(Operator):
- '''Select object relative to the active objects position''' \
+ '''Select object relative to the active object's position''' \
'''in the hierarchy'''
bl_idname = "object.select_hierarchy"
bl_label = "Select Hierarchy"
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index 3fc1f7f5695..c2fe18fc5c7 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -142,7 +142,7 @@ class AddPresetBase():
class ExecutePreset(Operator):
- ''' Executes a preset '''
+ '''Execute a preset'''
bl_idname = "script.execute_preset"
bl_label = "Execute a Python Preset"
diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
index 3479a3f9e53..5ee7cf86142 100644
--- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
+++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
@@ -66,7 +66,7 @@ def guess_player_path(preset):
class PlayRenderedAnim(Operator):
- '''Plays back rendered frames/movies using an external player'''
+ '''Play back rendered frames/movies using an external player'''
bl_idname = "render.play_rendered_anim"
bl_label = "Play Rendered Animation"
bl_options = {'REGISTER'}
diff --git a/release/scripts/startup/bl_operators/vertexpaint_dirt.py b/release/scripts/startup/bl_operators/vertexpaint_dirt.py
index ce4942ae238..5fb5c7f39cf 100644
--- a/release/scripts/startup/bl_operators/vertexpaint_dirt.py
+++ b/release/scripts/startup/bl_operators/vertexpaint_dirt.py
@@ -159,7 +159,7 @@ class VertexPaintDirt(Operator):
)
blur_iterations = IntProperty(
name="Blur Iterations",
- description="Number times to blur the colors. (higher blurs more)",
+ description="Number times to blur the colors (higher blurs more)",
min=0, max=40,
default=1,
)
diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h
index 556ff26e621..f1c7356e6b0 100644
--- a/source/blender/blenkernel/BKE_packedFile.h
+++ b/source/blender/blenkernel/BKE_packedFile.h
@@ -51,7 +51,7 @@ struct PackedFile *newPackedFileMemory(void *mem, int memlen);
void packAll(struct Main *bmain, struct ReportList *reports);
/* unpack */
-char *unpackFile(struct ReportList *reports, char *abs_name, char *local_name, struct PackedFile *pf, int how);
+char *unpackFile(struct ReportList *reports, const char *abs_name, const char *local_name, struct PackedFile *pf, int how);
int unpackVFont(struct ReportList *reports, struct VFont *vfont, int how);
int unpackSound(struct Main *bmain, struct ReportList *reports, struct bSound *sound, int how);
int unpackImage(struct ReportList *reports, struct Image *ima, int how);
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index f5f0bccc280..e48f17e4efd 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -41,8 +41,7 @@ if env['WITH_BF_QUICKTIME']:
if env['WITH_BF_SDL']:
incs += ' ' + env['BF_SDL_INC']
-else:
- defs.append('DISABLE_SDL')
+ defs.append('WITH_SDL')
if env['WITH_BF_OPENEXR']:
defs.append('WITH_OPENEXR')
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 1de581034a4..37982e7fec9 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -906,8 +906,8 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (scene->r.stamp & R_STAMP_MARKER) {
char *name = scene_find_last_marker_name(scene, CFRA);
-
- if (name) strcpy(text, name);
+
+ if (name) BLI_strncpy(text, name, sizeof(text));
else strcpy(text, "<none>");
BLI_snprintf(stamp_data->marker, sizeof(stamp_data->marker), do_prefix ? "Marker %s":"%s", text);
@@ -980,7 +980,7 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (scene->r.stamp & R_STAMP_SEQSTRIP) {
Sequence *seq= seq_foreground_frame_get(scene, scene->r.cfra);
- if (seq) strcpy(text, seq->name+2);
+ if (seq) BLI_strncpy(text, seq->name+2, sizeof(text));
else strcpy(text, "<none>");
BLI_snprintf(stamp_data->strip, sizeof(stamp_data->strip), do_prefix ? "Strip %s":"%s", text);
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 9de75a49998..2cee9676e5e 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -86,8 +86,8 @@ ModifierData *modifier_new(int type)
ModifierTypeInfo *mti = modifierType_getInfo(type);
ModifierData *md = MEM_callocN(mti->structSize, mti->structName);
- // FIXME: we need to make the name always be unique somehow...
- strcpy(md->name, mti->name);
+ /* note, this name must be made unique later */
+ BLI_strncpy(md->name, mti->name, sizeof(md->name));
md->type = type;
md->mode = eModifierMode_Realtime
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 7093e2e0b5c..be6168941d3 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -374,7 +374,7 @@ void nodeMakeDynamicType(bNode *node)
/*node->typeinfo= MEM_dupallocN(ntype);*/
bNodeType *newtype= MEM_callocN(sizeof(bNodeType), "dynamic bNodeType");
*newtype= *ntype;
- strcpy(newtype->name, ntype->name);
+ BLI_strncpy(newtype->name, ntype->name, sizeof(newtype->name));
node->typeinfo= newtype;
}
}
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index 2c8975e9cb4..0041cd33c14 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -182,7 +182,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename, const char
// convert relative filenames to absolute filenames
- strcpy(name, filename);
+ BLI_strncpy(name, filename, sizeof(name));
BLI_path_abs(name, basepath);
// open the file
@@ -240,7 +240,7 @@ void packAll(Main *bmain, ReportList *reports)
}
-/*
+#if 0
// attempt to create a function that generates an unique filename
// this will work when all funtions in fileops.c understand relative filenames...
@@ -249,6 +249,7 @@ static char *find_new_name(char *name)
{
char tempname[FILE_MAXDIR + FILE_MAXFILE];
char *newname;
+ size_t len;
if (fop_exists(name)) {
for (number = 1; number <= 999; number++) {
@@ -258,14 +259,12 @@ static char *find_new_name(char *name)
}
}
}
-
- newname = mallocN(strlen(tempname) + 1, "find_new_name");
- strcpy(newname, tempname);
-
- return(newname);
+ len= strlen(tempname) + 1;
+ newname = MEM_mallocN(len, "find_new_name");
+ memcpy(newname, tempname, len * sizeof(char));
+ return newname;
}
-
-*/
+#endif
int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, int guimode)
{
@@ -277,12 +276,12 @@ int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, i
if (guimode) {} //XXX waitcursor(1);
- strcpy(name, filename);
+ BLI_strncpy(name, filename, sizeof(name));
BLI_path_abs(name, G.main->name);
if (BLI_exists(name)) {
for (number = 1; number <= 999; number++) {
- sprintf(tempname, "%s.%03d_", name, number);
+ BLI_snprintf(tempname, sizeof(tempname), "%s.%03d_", name, number);
if (! BLI_exists(tempname)) {
if (BLI_copy_fileops(name, tempname) == RET_OK) {
remove_tmp = TRUE;
@@ -342,7 +341,7 @@ int checkPackedFile(const char *filename, PackedFile *pf)
char buf[4096];
char name[FILE_MAXDIR + FILE_MAXFILE];
- strcpy(name, filename);
+ BLI_strncpy(name, filename, sizeof(name));
BLI_path_abs(name, G.main->name);
if (stat(name, &st)) {
@@ -392,9 +391,10 @@ there was an error or when the user desides to cancel the operation.
*/
-char *unpackFile(ReportList *reports, char *abs_name, char *local_name, PackedFile *pf, int how)
+char *unpackFile(ReportList *reports, const char *abs_name, const char *local_name, PackedFile *pf, int how)
{
- char *newname = NULL, *temp = NULL;
+ char *newname = NULL;
+ const char *temp = NULL;
// char newabs[FILE_MAXDIR + FILE_MAXFILE];
// char newlocal[FILE_MAXDIR + FILE_MAXFILE];
@@ -437,12 +437,11 @@ char *unpackFile(ReportList *reports, char *abs_name, char *local_name, PackedFi
}
if (temp) {
- newname = MEM_mallocN(strlen(temp) + 1, "unpack_file newname");
- strcpy(newname, temp);
+ newname= BLI_strdup(temp);
}
}
- return (newname);
+ return newname;
}
@@ -453,17 +452,17 @@ int unpackVFont(ReportList *reports, VFont *vfont, int how)
int ret_value = RET_ERROR;
if (vfont != NULL) {
- strcpy(localname, vfont->name);
+ BLI_strncpy(localname, vfont->name, sizeof(localname));
BLI_splitdirstring(localname, fi);
- sprintf(localname, "//fonts/%s", fi);
+ BLI_snprintf(localname, sizeof(localname), "//fonts/%s", fi);
newname = unpackFile(reports, vfont->name, localname, vfont->packedfile, how);
if (newname != NULL) {
ret_value = RET_OK;
freePackedFile(vfont->packedfile);
vfont->packedfile = NULL;
- strcpy(vfont->name, newname);
+ BLI_strncpy(vfont->name, newname, sizeof(vfont->name));
MEM_freeN(newname);
}
}
@@ -478,13 +477,13 @@ int unpackSound(Main *bmain, ReportList *reports, bSound *sound, int how)
int ret_value = RET_ERROR;
if (sound != NULL) {
- strcpy(localname, sound->name);
+ BLI_strncpy(localname, sound->name, sizeof(localname));
BLI_splitdirstring(localname, fi);
- sprintf(localname, "//sounds/%s", fi);
+ BLI_snprintf(localname, sizeof(localname), "//sounds/%s", fi);
newname = unpackFile(reports, sound->name, localname, sound->packedfile, how);
if (newname != NULL) {
- strcpy(sound->name, newname);
+ BLI_strncpy(sound->name, newname, sizeof(sound->name));
MEM_freeN(newname);
freePackedFile(sound->packedfile);
@@ -506,16 +505,16 @@ int unpackImage(ReportList *reports, Image *ima, int how)
int ret_value = RET_ERROR;
if (ima != NULL) {
- strcpy(localname, ima->name);
+ BLI_strncpy(localname, ima->name, sizeof(localname));
BLI_splitdirstring(localname, fi);
- sprintf(localname, "//textures/%s", fi);
-
+ BLI_snprintf(localname, sizeof(localname), "//textures/%s", fi);
+
newname = unpackFile(reports, ima->name, localname, ima->packedfile, how);
if (newname != NULL) {
ret_value = RET_OK;
freePackedFile(ima->packedfile);
ima->packedfile = NULL;
- strcpy(ima->name, newname);
+ BLI_strncpy(ima->name, newname, sizeof(ima->name));
MEM_freeN(newname);
BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
}
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index bc5bc87b1fa..8e5452e2704 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -2891,24 +2891,24 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, char *from, char *to)
char ext[MAX_PTCACHE_PATH];
/* save old name */
- strcpy(old_name, pid->cache->name);
+ BLI_strncpy(old_name, pid->cache->name, sizeof(old_name));
/* get "from" filename */
- strcpy(pid->cache->name, from);
+ BLI_strncpy(pid->cache->name, from, sizeof(pid->cache->name));
len = ptcache_filename(pid, old_filename, 0, 0, 0); /* no path */
ptcache_path(pid, path);
dir = opendir(path);
if(dir==NULL) {
- strcpy(pid->cache->name, old_name);
+ BLI_strncpy(pid->cache->name, old_name, sizeof(pid->cache->name));
return;
}
BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
/* put new name into cache */
- strcpy(pid->cache->name, to);
+ BLI_strncpy(pid->cache->name, to, sizeof(pid->cache->name));
while ((de = readdir(dir)) != NULL) {
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
@@ -2963,7 +2963,7 @@ void BKE_ptcache_load_external(PTCacheID *pid)
if(cache->index >= 0)
BLI_snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, cache->index);
else
- strcpy(ext, PTCACHE_EXT);
+ BLI_strncpy(ext, PTCACHE_EXT, sizeof(ext));
while ((de = readdir(dir)) != NULL) {
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c
index cdf2e39a4dd..e0e2876f79e 100644
--- a/source/blender/blenkernel/intern/property.c
+++ b/source/blender/blenkernel/intern/property.c
@@ -166,7 +166,7 @@ void unique_property(bProperty *first, bProperty *prop, int force)
int i= 0;
/* strip numbers */
- strcpy(base_name, prop->name);
+ BLI_strncpy(base_name, prop->name, sizeof(base_name));
for(i= strlen(base_name)-1; (i>=0 && isdigit(base_name[i])); i--) {
base_name[i]= '\0';
}
@@ -178,7 +178,7 @@ void unique_property(bProperty *first, bProperty *prop, int force)
strcat(new_name, num);
} while(get_property__internal(first, prop, new_name));
- strcpy(prop->name, new_name);
+ BLI_strncpy(prop->name, new_name, sizeof(prop->name));
}
}
}
@@ -257,7 +257,7 @@ void set_property(bProperty *prop, char *str)
*((float *)&prop->data)= (float)atof(str);
break;
case GPROP_STRING:
- strcpy(prop->poin, str);
+ strcpy(prop->poin, str); /* TODO - check size? */
break;
}
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index afad0f1c3df..f908f40087e 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -866,8 +866,8 @@ void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq)
SeqUniqueInfo sui;
char *dot;
sui.seq= seq;
- strcpy(sui.name_src, seq->name+2);
- strcpy(sui.name_dest, seq->name+2);
+ BLI_strncpy(sui.name_src, seq->name+2, sizeof(sui.name_src));
+ BLI_strncpy(sui.name_dest, seq->name+2, sizeof(sui.name_dest));
sui.count= 1;
sui.match= 1; /* assume the worst to start the loop */
@@ -887,7 +887,7 @@ void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq)
seqbase_recursive_apply(seqbasep, seqbase_unique_name_recursive_cb, &sui);
}
- strcpy(seq->name+2, sui.name_dest);
+ BLI_strncpy(seq->name+2, sui.name_dest, sizeof(seq->name)-2);
}
static const char *give_seqname_by_type(int type)
@@ -1204,7 +1204,7 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra,
sorry folks, please rebuild your proxies... */
if (seq->flag & (SEQ_USE_PROXY_CUSTOM_DIR|SEQ_USE_PROXY_CUSTOM_FILE)) {
- strcpy(dir, seq->strip->proxy->dir);
+ BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir));
} else if (seq->type == SEQ_IMAGE) {
BLI_snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir);
} else {
@@ -3364,9 +3364,9 @@ int seq_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str)
SWAP(Sequence, *seq_a, *seq_b);
/* swap back names so animation fcurves dont get swapped */
- strcpy(name, seq_a->name+2);
- strcpy(seq_a->name+2, seq_b->name+2);
- strcpy(seq_b->name+2, name);
+ BLI_strncpy(name, seq_a->name+2, sizeof(name));
+ BLI_strncpy(seq_a->name+2, seq_b->name+2, sizeof(seq_b->name)-2);
+ BLI_strncpy(seq_b->name+2, name, sizeof(seq_b->name)-2);
/* swap back opacity, and overlay mode */
SWAP(int, seq_a->blend_mode, seq_b->blend_mode);
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 07df12d5468..02e381fe9b4 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -79,9 +79,9 @@ struct bSound* sound_new_file(struct Main *bmain, const char *filename)
char str[FILE_MAX];
char *path;
- int len;
+ size_t len;
- strcpy(str, filename);
+ BLI_strncpy(str, filename, sizeof(str));
path = /*bmain ? bmain->name :*/ G.main->name;
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index d344f79bb6c..7d720aed62c 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -992,7 +992,7 @@ void autotexname(Tex *tex)
if(tex->type==TEX_IMAGE) {
ima= tex->ima;
if(ima) {
- strcpy(di, ima->name);
+ BLI_strncpy(di, ima->name, sizeof(di));
BLI_splitdirstring(di, fi);
strcpy(di, "I.");
strcat(di, fi);
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 456ee72c4e0..b2b3e7381c6 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -221,7 +221,7 @@
# else
# define _dummy_abort() (void)0
# endif
-# ifdef __GNUC__ /* just want to check if __func__ is available */
+# if defined(__GNUC__) || defined(_MSC_VER) /* just want to check if __func__ is available */
# define BLI_assert(a) \
do { \
if (!(a)) { \
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 9ccd7fbe121..e848ad8d0d3 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -227,7 +227,7 @@ int BLI_move(const char *file, const char *to) {
// it has to be 'mv filename filename' and not
// 'mv filename destdir'
- strcpy(str, to);
+ BLI_strncpy(str, to, sizeof(str));
// points 'to' to a directory ?
if (BLI_last_slash(str) == (str + strlen(str) - 1)) {
if (BLI_last_slash(file) != NULL) {
@@ -252,7 +252,7 @@ int BLI_copy_fileops(const char *file, const char *to) {
// it has to be 'cp filename filename' and not
// 'cp filename destdir'
- strcpy(str, to);
+ BLI_strncpy(str, to, sizeof(str));
// points 'to' to a directory ?
if (BLI_last_slash(str) == (str + strlen(str) - 1)) {
if (BLI_last_slash(file) != NULL) {
@@ -286,7 +286,7 @@ void BLI_recurdir_fileops(const char *dirname) {
// blah1/blah2/ (with slash) after creating
// blah1/blah2 (without slash)
- strcpy(tmp, dirname);
+ BLI_strncpy(tmp, dirname, sizeof(tmp));
lslash= BLI_last_slash(tmp);
if (lslash == tmp + strlen(tmp) - 1) {
@@ -371,7 +371,7 @@ void BLI_recurdir_fileops(const char *dirname) {
if (BLI_exists(dirname)) return;
- strcpy(tmp, dirname);
+ BLI_strncpy(tmp, dirname, sizeof(tmp));
lslash= BLI_last_slash(tmp);
if (lslash) {
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index 0fe028eb3c0..7e5d03423e5 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -364,7 +364,7 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
// get the name
fontname = FT_Get_Postscript_Name(face);
- strcpy(vfd->name, (fontname == NULL) ? "" : fontname);
+ BLI_strncpy(vfd->name, (fontname == NULL) ? "" : fontname, sizeof(vfd->name));
// Extract the first 256 character from TTF
lcode= charcode= FT_Get_First_Char(face, &glyph_index);
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index e336b914ffa..7638e95b4ec 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -304,15 +304,15 @@ void BLI_adddirstrings(void)
for(num=0, file= files; num<actnum; num++, file++){
#ifdef WIN32
mode = 0;
- strcpy(file->mode1, types[0]);
- strcpy(file->mode2, types[0]);
- strcpy(file->mode3, types[0]);
+ BLI_strncpy(file->mode1, types[0], sizeof(file->mode1));
+ BLI_strncpy(file->mode2, types[0], sizeof(file->mode2));
+ BLI_strncpy(file->mode3, types[0], sizeof(file->mode3));
#else
mode = file->s.st_mode;
- strcpy(file->mode1, types[(mode & 0700) >> 6]);
- strcpy(file->mode2, types[(mode & 0070) >> 3]);
- strcpy(file->mode3, types[(mode & 0007)]);
+ BLI_strncpy(file->mode1, types[(mode & 0700) >> 6], sizeof(file->mode1));
+ BLI_strncpy(file->mode2, types[(mode & 0070) >> 3], sizeof(file->mode2));
+ BLI_strncpy(file->mode3, types[(mode & 0007)], sizeof(file->mode3));
if (((mode & S_ISGID) == S_ISGID) && (file->mode2[2]=='-'))file->mode2[2]='l';
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index e7be98d955d..2799b2165f0 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -252,7 +252,7 @@ void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendH
void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname);
-BlendFileData* blo_read_blendafterruntime(int file, char *name, int actualsize, struct ReportList *reports);
+BlendFileData* blo_read_blendafterruntime(int file, const char *name, int actualsize, struct ReportList *reports);
#ifdef __cplusplus
}
diff --git a/source/blender/blenloader/BLO_runtime.h b/source/blender/blenloader/BLO_runtime.h
index 920b14e92fa..0a3ceeefa78 100644
--- a/source/blender/blenloader/BLO_runtime.h
+++ b/source/blender/blenloader/BLO_runtime.h
@@ -42,8 +42,8 @@ extern "C" {
struct BlendFileData;
struct ReportList;
-int BLO_is_a_runtime(char *file);
-struct BlendFileData *BLO_read_runtime(char *file, struct ReportList *reports);
+int BLO_is_a_runtime(const char *file);
+struct BlendFileData *BLO_read_runtime(const char *file, struct ReportList *reports);
#ifdef __cplusplus
}
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 1a7096e5aa3..c6716746981 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -288,7 +288,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
fd = blo_openblendermemfile(memfile, reports);
if (fd) {
fd->reports= reports;
- strcpy(fd->relabase, filename);
+ BLI_strncpy(fd->relabase, filename, sizeof(fd->relabase));
/* clear ob->proxy_from pointers in old main */
blo_clear_proxy_pointers_from_lib(oldmain);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 916069a7381..dbef9810226 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9416,7 +9416,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
simasel->prv_h = 96;
simasel->prv_w = 96;
simasel->flag = 7; /* ??? elubie */
- strcpy (simasel->dir, U.textudir); /* TON */
+ BLI_strncpy (simasel->dir, U.textudir, sizeof(simasel->dir)); /* TON */
simasel->file[0]= '\0';
simasel->returnfunc = NULL;
@@ -9639,7 +9639,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ct= MEM_callocN(sizeof(bConstraintTarget), "PyConTarget");
ct->tar = data->tar;
- strcpy(ct->subtarget, data->subtarget);
+ BLI_strncpy(ct->subtarget, data->subtarget, sizeof(ct->subtarget));
ct->space = con->tarspace;
BLI_addtail(&data->targets, ct);
@@ -9669,7 +9669,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ct= MEM_callocN(sizeof(bConstraintTarget), "PyConTarget");
ct->tar = data->tar;
- strcpy(ct->subtarget, data->subtarget);
+ BLI_strncpy(ct->subtarget, data->subtarget, sizeof(ct->subtarget));
ct->space = con->tarspace;
BLI_addtail(&data->targets, ct);
@@ -12149,8 +12149,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
aa->flag = ia->flag;
aa->sta = ia->sta;
aa->end = ia->end;
- strcpy(aa->name, ia->name);
- strcpy(aa->frameProp, ia->frameProp);
+ BLI_strncpy(aa->name, ia->name, sizeof(aa->name));
+ BLI_strncpy(aa->frameProp, ia->frameProp, sizeof(aa->frameProp));
if (ob->adt)
aa->act = ob->adt->action;
@@ -13847,8 +13847,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
printf(" enter a new path:\n");
if(scanf("%s", newlib_path) > 0) {
- strcpy(mainptr->curlib->name, newlib_path);
- strcpy(mainptr->curlib->filepath, newlib_path);
+ BLI_strncpy(mainptr->curlib->name, newlib_path, sizeof(mainptr->curlib->name));
+ BLI_strncpy(mainptr->curlib->filepath, newlib_path, sizeof(mainptr->curlib->filepath));
cleanup_path(G.main->name, mainptr->curlib->filepath);
fd= blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
@@ -13964,7 +13964,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
/* reading runtime */
-BlendFileData *blo_read_blendafterruntime(int file, char *name, int actualsize, ReportList *reports)
+BlendFileData *blo_read_blendafterruntime(int file, const char *name, int actualsize, ReportList *reports)
{
BlendFileData *bfd = NULL;
FileData *fd = filedata_new();
diff --git a/source/blender/blenloader/intern/runtime.c b/source/blender/blenloader/intern/runtime.c
index f5308b5ea5c..7a241e007f2 100644
--- a/source/blender/blenloader/intern/runtime.c
+++ b/source/blender/blenloader/intern/runtime.c
@@ -68,7 +68,7 @@ static int handle_read_msb_int(int handle)
return (buf[0]<<24) + (buf[1]<<16) + (buf[2]<<8) + (buf[3]<<0);
}
-int BLO_is_a_runtime(char *path)
+int BLO_is_a_runtime(const char *path)
{
int res= 0, fd= open(path, O_BINARY|O_RDONLY, 0);
int datastart;
@@ -97,7 +97,7 @@ cleanup:
return res;
}
-BlendFileData *BLO_read_runtime(char *path, ReportList *reports)
+BlendFileData *BLO_read_runtime(const char *path, ReportList *reports)
{
BlendFileData *bfd= NULL;
size_t actualsize;
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index f3a6e2371bb..dec93c0ff63 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -691,7 +691,7 @@ void AnimationImporter::apply_matrix_curves( Object * ob, std::vector<FCurve*>&
if (is_joint)
BLI_snprintf(rna_path, sizeof(rna_path), "%s.%s", joint_path, tm_str);
else
- strcpy(rna_path, tm_str);
+ BLI_strncpy(rna_path, tm_str, sizeof(rna_path));
newcu[i] = create_fcurve(axis, rna_path);
newcu[i]->totvert = frames.size();
}
@@ -1246,7 +1246,7 @@ Object *AnimationImporter::translate_animation_OLD(COLLADAFW::Node *node,
if (is_joint)
BLI_snprintf(rna_path, sizeof(rna_path), "%s.%s", joint_path, tm_str);
else
- strcpy(rna_path, tm_str);
+ BLI_strncpy(rna_path, tm_str, sizeof(rna_path));
newcu[i] = create_fcurve(axis, rna_path);
#ifdef ARMATURE_TEST
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 20368bbf57b..11fd932eed6 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -824,7 +824,7 @@ static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChann
}
else if (strcmp(ct->subtarget, pchan->name)==0) {
ct->tar = tarArm;
- strcpy(ct->subtarget, curbone->name);
+ BLI_strncpy(ct->subtarget, curbone->name, sizeof(ct->subtarget));
}
}
}
@@ -871,7 +871,7 @@ static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChann
}
else if (strcmp(ct->subtarget, pchan->name)==0) {
ct->tar = tarArm;
- strcpy(ct->subtarget, curbone->name);
+ BLI_strncpy(ct->subtarget, curbone->name, sizeof(ct->subtarget));
}
}
}
@@ -2503,7 +2503,7 @@ void updateDuplicateSubtargetObjects(EditBone *dupBone, ListBase *editbones, Obj
*/
if (oldtarget->temp) {
newtarget = (EditBone *) oldtarget->temp;
- strcpy(ct->subtarget, newtarget->name);
+ BLI_strncpy(ct->subtarget, newtarget->name, sizeof(ct->subtarget));
}
}
}
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index bf2e17c4e87..e7c7ebf3ece 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -997,11 +997,8 @@ static void poselib_preview_apply (bContext *C, wmOperator *op)
}
/* get marker name */
- if (pld->marker)
- strcpy(markern, pld->marker->name);
- else
- strcpy(markern, "No Matches");
-
+ BLI_strncpy(markern, pld->marker ? pld->marker->name : "No Matches", sizeof(markern));
+
sprintf(pld->headerstr, "PoseLib Previewing Pose: Filter - [%s] | Current Pose - \"%s\" | Use ScrollWheel or PageUp/Down to change", tempstr, markern);
ED_area_headerprint(pld->sa, pld->headerstr);
}
@@ -1186,7 +1183,7 @@ static int poselib_preview_handle_event (bContext *UNUSED(C), wmOperator *op, wm
/* backup stuff that needs to occur before every operation
* - make a copy of searchstr, so that we know if cache needs to be rebuilt
*/
- strcpy(pld->searchold, pld->searchstr);
+ BLI_strncpy(pld->searchold, pld->searchstr, sizeof(pld->searchold));
/* if we're currently showing the original pose, only certain events are handled */
if (pld->flag & PL_PREVIEW_SHOWORIGINAL) {
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 61935aa72ca..a978f327993 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -1197,7 +1197,7 @@ void POSE_OT_paste (wmOperatorType *ot)
/* identifiers */
ot->name= "Paste Pose";
ot->idname= "POSE_OT_paste";
- ot->description= "Pastes the stored pose on to the current pose";
+ ot->description= "Paste the stored pose on to the current pose";
/* api callbacks */
ot->exec= pose_paste_exec;
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index 1f2ef79e091..60b1cc8f5cd 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -1046,7 +1046,7 @@ void FONT_OT_change_spacing(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_int(ot->srna, "delta", 1, -20, 20, "Delta", "Amount to decrease or increasing character spacing with", -20, 20);
+ RNA_def_int(ot->srna, "delta", 1, -20, 20, "Delta", "Amount to decrease or increase character spacing with", -20, 20);
}
/************************* change character **********************/
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index 542781ac995..81a5f6777e7 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -311,7 +311,7 @@ void copy_gpdata ()
gpln= MEM_callocN(sizeof(bGPDlayer), "GPCopyPasteLayer");
gpln->frames.first= gpln->frames.last= NULL;
- strcpy(gpln->info, gpls->info);
+ BLI_strncpy(gpln->info, gpls->info, sizeof(gpln->info));
BLI_addtail(&gpcopybuf, gpln);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index b6c72c2e96f..16edd0a1a9e 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1747,7 +1747,9 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str)
}
else if(but->type == TEX) {
/* string */
- BLI_strncpy(but->poin, str, but->hardmax);
+ if(ui_is_but_utf8(but)) BLI_strncpy_utf8(but->poin, str, but->hardmax);
+ else BLI_strncpy(but->poin, str, but->hardmax);
+
return 1;
}
else if(but->type == SEARCH_MENU) {
@@ -2559,6 +2561,24 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
if(block->curlayout)
ui_layout_add_but(block->curlayout, but);
+#ifdef WITH_PYTHON_UI_INFO
+ {
+ extern void PyC_FileAndNum_Safe(const char **filename, int *lineno);
+
+ const char *fn;
+ int lineno= -1;
+ PyC_FileAndNum_Safe(&fn, &lineno);
+ if (lineno != -1) {
+ BLI_strncpy(but->py_dbg_fn, fn, sizeof(but->py_dbg_fn));
+ but->py_dbg_ln= lineno;
+ }
+ else {
+ but->py_dbg_fn[0]= '\0';
+ but->py_dbg_ln= -1;
+ }
+ }
+#endif /* WITH_PYTHON_UI_INFO */
+
return but;
}
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 6c661ba014e..545d60bfcb9 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -115,7 +115,7 @@ int ui_but_anim_expression_set(uiBut *but, const char *str)
driver= fcu->driver;
if(driver && driver->type == DRIVER_TYPE_PYTHON) {
- BLI_strncpy(driver->expression, str, sizeof(driver->expression));
+ BLI_strncpy_utf8(driver->expression, str, sizeof(driver->expression));
driver->flag |= DRIVER_FLAG_RECOMPILE;
WM_event_add_notifier(but->block->evil_C, NC_ANIMATION|ND_KEYFRAME, NULL);
return 1;
@@ -164,7 +164,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
/* set the expression */
// TODO: need some way of identifying variables used
- BLI_strncpy(driver->expression, str, sizeof(driver->expression));
+ BLI_strncpy_utf8(driver->expression, str, sizeof(driver->expression));
/* FIXME: for now, assume that
* - for expressions, users are likely to be using "frame" -> current frame" as a variable
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index d649a5e920b..47f971c0fdb 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -108,6 +108,12 @@ typedef enum uiHandleButtonState {
BUTTON_STATE_EXIT
} uiHandleButtonState;
+typedef enum uiButtonJumpType {
+ BUTTON_EDIT_JUMP_NONE,
+ BUTTON_EDIT_JUMP_DELIM,
+ BUTTON_EDIT_JUMP_ALL
+} uiButtonJumpType;
+
typedef struct uiHandleButtonData {
wmWindowManager *wm;
wmWindow *window;
@@ -261,7 +267,7 @@ static int ui_is_a_warp_but(uiBut *but)
}
/* file selectors are exempt from utf-8 checks */
-static int ui_is_utf8_but(uiBut *but)
+int ui_is_but_utf8(uiBut *but)
{
if (but->rnaprop) {
const int subtype= RNA_property_subtype(but->rnaprop);
@@ -1174,7 +1180,10 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
}
else {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
- BLI_strncpy(active_data->str, buf, active_data->maxlen);
+
+ if(ui_is_but_utf8(but)) BLI_strncpy_utf8(active_data->str, buf, active_data->maxlen);
+ else BLI_strncpy(active_data->str, buf, active_data->maxlen);
+
if(but->type == SEARCH_MENU) {
/* else uiSearchboxData.active member is not updated [#26856] */
ui_searchbox_update(C, data->searchbox, but, 1);
@@ -1293,18 +1302,18 @@ static int ui_textedit_step_prev_utf8(const char *str, size_t UNUSED(maxlen), sh
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)
+ uiButtonJumpType jump)
{
const short pos_prev= *pos;
if(direction) { /* right*/
- if(do_jump) {
+ if(jump != BUTTON_EDIT_JUMP_NONE) {
/* 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;
+ if((jump != BUTTON_EDIT_JUMP_ALL) && test_special_char(str[(*pos)])) break;
}
else {
break; /* unlikely but just incase */
@@ -1316,7 +1325,7 @@ static void ui_textedit_step_utf8(const char *str, size_t maxlen,
}
}
else { /* left */
- if(do_jump) {
+ if(jump != BUTTON_EDIT_JUMP_NONE) {
/* left only: compensate for index/change in direction */
ui_textedit_step_prev_utf8(str, maxlen, pos);
@@ -1325,7 +1334,7 @@ static void ui_textedit_step_utf8(const char *str, size_t maxlen,
* 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;
+ if((jump != BUTTON_EDIT_JUMP_ALL) && test_special_char(str[(*pos)])) break;
}
else {
break;
@@ -1439,27 +1448,28 @@ static void ui_textedit_set_cursor_select(uiBut *but, uiHandleButtonData *data,
ui_check_but(but);
}
-static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char ascii)
+/* note: utf8 & ascii funcs should be merged */
+static int ui_textedit_type_utf8(uiBut *but, uiHandleButtonData *data, const char utf8_buf[6])
{
char *str;
- int len, x, changed= 0;
+ int len, changed= 0;
str= data->str;
len= strlen(str);
if(len-(but->selend - but->selsta)+1 <= data->maxlen) {
+ int step= BLI_strnlen(utf8_buf, sizeof(utf8_buf));
+
/* type over the current selection */
- if ((but->selend - but->selsta) > 0)
+ if ((but->selend - but->selsta) > 0) {
changed= ui_textedit_delete_selection(but, data);
+ len= strlen(str);
+ }
- len= strlen(str);
- if(len+1 < data->maxlen) {
- for(x= data->maxlen; x>but->pos; x--)
- str[x]= str[x-1];
- str[but->pos]= ascii;
- str[len+1]= '\0';
-
- but->pos++;
+ if(len + step < data->maxlen) {
+ memmove(&str[but->pos + step], &str[but->pos], (len + 1) - but->pos);
+ memcpy(&str[but->pos], utf8_buf, step * sizeof(char));
+ but->pos += step;
changed= 1;
}
}
@@ -1467,7 +1477,13 @@ static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char asc
return changed;
}
-static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump, int jump_all)
+static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char ascii)
+{
+ char utf8_buf[6]= {ascii, '\0'};
+ return ui_textedit_type_utf8(but, data, utf8_buf);
+}
+
+static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, uiButtonJumpType jump)
{
const char *str= data->str;
const int len= strlen(str);
@@ -1476,7 +1492,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction
/* special case, quit selection and set cursor */
if (has_sel && !select) {
- if (jump_all) {
+ if (jump == BUTTON_EDIT_JUMP_ALL) {
but->selsta = but->selend= but->pos = direction ? len : 0;
}
else {
@@ -1490,7 +1506,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction
data->selextend = 0;
}
else {
- ui_textedit_step_utf8(str, len, &but->pos, direction, jump, jump_all);
+ ui_textedit_step_utf8(str, len, &but->pos, direction, jump);
if(select) {
/* existing selection */
@@ -1539,35 +1555,33 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction
}
}
-static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int direction, const int all, const int jump)
+static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int direction, uiButtonJumpType jump)
{
char *str= data->str;
const int len= strlen(str);
- int x, changed= 0;
+ int changed= 0;
- if(all) {
+ if(jump == BUTTON_EDIT_JUMP_ALL) {
if(len) changed=1;
- str[0]= 0;
+ str[0]= '\0';
but->pos= 0;
}
else if(direction) { /* delete */
if ((but->selend - but->selsta) > 0) {
changed= ui_textedit_delete_selection(but, data);
}
- else if(but->pos>=0 && but->pos<len) {
+ else if (but->pos>=0 && but->pos<len) {
short pos= but->pos;
int step;
- ui_textedit_step_utf8(str, len, &pos, direction, jump, all);
+ ui_textedit_step_utf8(str, len, &pos, direction, jump);
step= pos - but->pos;
- for(x=but->pos; x<len; x++)
- str[x]= str[x+step];
- str[len-step]='\0';
+ memmove(&str[but->pos], &str[but->pos + step], (len + 1) - but->pos);
changed= 1;
}
}
else { /* backspace */
- if(len!=0) {
+ if (len != 0) {
if ((but->selend - but->selsta) > 0) {
changed= ui_textedit_delete_selection(but, data);
}
@@ -1575,13 +1589,9 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
short pos= but->pos;
int step;
- ui_textedit_step_utf8(str, len, &pos, direction, jump, all);
+ ui_textedit_step_utf8(str, len, &pos, direction, jump);
step= but->pos - pos;
-
- for(x=but->pos; x<len; x++)
- str[x-step]= str[x];
- str[len-step]='\0';
-
+ memmove(&str[but->pos - step], &str[but->pos], (len + 1) - but->pos);
but->pos -= step;
changed= 1;
}
@@ -1691,19 +1701,9 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
ui_get_but_string(but, data->str, data->maxlen);
if(ELEM3(but->type, NUM, NUMABS, NUMSLI)) {
- /* XXX: we dont have utf editing yet so for numbers its best to strip out utf chars
- * this is so the deg' synbol isnt included in number editing fields: bug 22274 */
- int i;
- for(i=0; data->str[i]; i++) {
- if(!isascii(data->str[i])) {
- /* no stripping actually: just convert to alt name */
- ui_convert_to_unit_alt_name(but, data->str, data->maxlen);
- break;
- }
- }
+ ui_convert_to_unit_alt_name(but, data->str, data->maxlen);
}
-
-
+
data->origstr= BLI_strdup(data->str);
data->selextend= 0;
data->selstartx= 0;
@@ -1728,7 +1728,7 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_textedit_end(bContext *C, uiBut *but, uiHandleButtonData *data)
{
if(but) {
- if(ui_is_utf8_but(but)) {
+ if(ui_is_but_utf8(but)) {
int strip= BLI_utf8_invalid_strip(but->editstr, strlen(but->editstr));
/* not a file?, strip non utf-8 chars */
if(strip) {
@@ -1880,11 +1880,11 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
break;
case RIGHTARROWKEY:
- ui_textedit_move(but, data, 1, event->shift, event->ctrl, FALSE);
+ ui_textedit_move(but, data, 1, event->shift, event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE);
retval= WM_UI_HANDLER_BREAK;
break;
case LEFTARROWKEY:
- ui_textedit_move(but, data, 0, event->shift, event->ctrl, FALSE);
+ ui_textedit_move(but, data, 0, event->shift, event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE);
retval= WM_UI_HANDLER_BREAK;
break;
case DOWNARROWKEY:
@@ -1894,7 +1894,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
/* pass on purposedly */
case ENDKEY:
- ui_textedit_move(but, data, 1, event->shift, TRUE, TRUE);
+ ui_textedit_move(but, data, 1, event->shift, BUTTON_EDIT_JUMP_ALL);
retval= WM_UI_HANDLER_BREAK;
break;
case UPARROWKEY:
@@ -1904,7 +1904,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
/* pass on purposedly */
case HOMEKEY:
- ui_textedit_move(but, data, 0, event->shift, TRUE, TRUE);
+ ui_textedit_move(but, data, 0, event->shift, BUTTON_EDIT_JUMP_ALL);
retval= WM_UI_HANDLER_BREAK;
break;
case PADENTER:
@@ -1913,12 +1913,12 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
retval= WM_UI_HANDLER_BREAK;
break;
case DELKEY:
- changed= ui_textedit_delete(but, data, 1, 0, event->ctrl);
+ changed= ui_textedit_delete(but, data, 1, event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE);
retval= WM_UI_HANDLER_BREAK;
break;
case BACKSPACEKEY:
- changed= ui_textedit_delete(but, data, 0, event->shift, event->ctrl);
+ changed= ui_textedit_delete(but, data, 0, event->shift ? BUTTON_EDIT_JUMP_ALL : (event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE));
retval= WM_UI_HANDLER_BREAK;
break;
@@ -1950,7 +1950,16 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
if(event->type == PADPERIOD && ascii == ',')
ascii = '.';
- changed= ui_textedit_type_ascii(but, data, ascii);
+ if(event->utf8_buf[0] || 1) {
+ /* keep this printf until utf8 is well tested */
+ printf("%s: utf8 char '%s'\n", __func__, event->utf8_buf);
+ // strcpy(event->utf8_buf, "12345");
+ changed= ui_textedit_type_utf8(but, data, event->utf8_buf);
+ }
+ else {
+ changed= ui_textedit_type_ascii(but, data, ascii);
+ }
+
retval= WM_UI_HANDLER_BREAK;
}
@@ -4531,6 +4540,17 @@ static int ui_but_menu(bContext *C, uiBut *but)
}
}
+#ifdef WITH_PYTHON_UI_INFO
+ if (but->py_dbg_ln != -1) {
+ PointerRNA ptr_props;
+
+ WM_operator_properties_create(&ptr_props, "WM_OT_text_edit");
+ RNA_string_set(&ptr_props, "filepath", but->py_dbg_fn);
+ RNA_int_set(&ptr_props, "line", but->py_dbg_ln);
+ uiItemFullO(layout, "WM_OT_text_edit", "Edit Source", ICON_NONE, ptr_props.data, WM_OP_EXEC_DEFAULT, 0);
+ }
+#endif /* WITH_PYTHON_UI_INFO */
+
uiPupMenuEnd(C, pup);
return 1;
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 18989e03147..ff5b7e5399d 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -252,6 +252,11 @@ struct uiBut {
/* pointer back */
uiBlock *block;
+
+#ifdef WITH_PYTHON_UI_INFO
+ char py_dbg_fn[240];
+ int py_dbg_ln;
+#endif
};
struct uiBlock {
@@ -368,6 +373,7 @@ extern void ui_check_but(uiBut *but);
extern int ui_is_but_float(uiBut *but);
extern int ui_is_but_unit(uiBut *but);
extern int ui_is_but_rna_valid(uiBut *but);
+extern int ui_is_but_utf8(uiBut *but);
extern void ui_bounds_block(uiBlock *block);
extern void ui_block_translate(uiBlock *block, int x, int y);
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index fa1b3ce5a1c..67425f5a194 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -759,18 +759,28 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
if (mti->flags & eModifierTypeFlag_SupportsEditmode)
uiItemR(row, &ptr, "show_in_editmode", 0, "", ICON_NONE);
}
- if ((ob->type==OB_MESH) && modifier_couldBeCage(scene, md) && (index <= lastCageIndex))
- {
- /* -- convert to rna ? */
- but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0,
- UI_translate_do_tooltip(N_("Apply modifier to editing cage during Editmode")));
- if (index < cageIndex)
- uiButSetFlag(but, UI_BUT_DISABLED);
- uiButSetFunc(but, modifiers_setOnCage, ob, md);
- }
- /* tesselation point for curve-typed objects */
- if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+ if (ob->type==OB_MESH) {
+ if (modifier_couldBeCage(scene, md) && (index <= lastCageIndex))
+ {
+ /* -- convert to rna ? */
+ but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0,
+ UI_translate_do_tooltip(N_("Apply modifier to editing cage during Editmode")));
+ if (index < cageIndex)
+ uiButSetFlag(but, UI_BUT_DISABLED);
+ uiButSetFunc(but, modifiers_setOnCage, ob, md);
+ }
+ else {
+ uiBlockEndAlign(block);
+
+ /* place holder button */
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ but= uiDefIconBut(block, BUT, 0, ICON_NONE, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, NULL);
+ uiButSetFlag(but, UI_BUT_DISABLED);
+ uiBlockSetEmboss(block, UI_EMBOSS);
+ }
+ } /* tesselation point for curve-typed objects */
+ else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
/* some modifiers could work with pre-tesselated curves only */
if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
/* add disabled pre-tesselated button, so users could have
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 309ea28c400..3776d57f953 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1191,7 +1191,7 @@ void init_userdef_do_versions(void)
vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
if (bmain->versionfile <= 191) {
- strcpy(U.plugtexdir, U.textudir);
+ BLI_strncpy(U.plugtexdir, U.textudir, sizeof(U.plugtexdir));
strcpy(U.sounddir, "/");
}
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 53ddaa41a89..3d0ba2aed2a 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -246,7 +246,7 @@ static void set_constraint_nth_target (bConstraint *con, Object *target, const c
for (ct=targets.first, i=0; ct; ct= ct->next, i++) {
if (i == index) {
ct->tar= target;
- strcpy(ct->subtarget, subtarget);
+ BLI_strncpy(ct->subtarget, subtarget, sizeof(ct->subtarget));
break;
}
}
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 76cbfdc88e7..0ad11d1a997 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -585,7 +585,7 @@ void OBJECT_OT_posemode_toggle(wmOperatorType *ot)
/* identifiers */
ot->name= "Toggle Pose Mode";
ot->idname= "OBJECT_OT_posemode_toggle";
- ot->description= "Enables or disables posing/selecting bones";
+ ot->description= "Enable or disable posing/selecting bones";
/* api callbacks */
ot->exec= posemode_exec;
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index ce01bef34f6..9f1ad8e4c3c 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -837,7 +837,7 @@ void OBJECT_OT_hook_select(wmOperatorType *ot)
/* identifiers */
ot->name= "Select Hook";
- ot->description= "Selects effected vertices on mesh";
+ ot->description= "Select affected vertices on mesh";
ot->idname= "OBJECT_OT_hook_select";
/* callbacks */
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 389c0941cc2..49a71018719 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -334,11 +334,9 @@ static int make_proxy_exec (bContext *C, wmOperator *op)
/* Add new object for the proxy */
newob= add_object(scene, OB_EMPTY);
- if (gob)
- strcpy(name, gob->id.name+2);
- else
- strcpy(name, ob->id.name+2);
- strcat(name, "_proxy");
+
+ BLI_snprintf(name, sizeof(name), "%s_proxy", ((ID *)(gob ? gob : ob))->name);
+
rename_id(&newob->id, name);
/* set layers OK */
@@ -605,7 +603,7 @@ static int parent_set_exec(bContext *C, wmOperator *op)
/* handle types */
if (pchan)
- strcpy(ob->parsubstr, pchan->name);
+ BLI_strncpy(ob->parsubstr, pchan->name, sizeof(ob->parsubstr));
else
ob->parsubstr[0]= 0;
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 7b4db347315..c1b21865504 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -669,7 +669,7 @@ static void vgroup_duplicate(Object *ob)
}
cdg = defgroup_duplicate(dg);
- strcpy(cdg->name, name);
+ BLI_strncpy(cdg->name, name, sizeof(cdg->name));
defgroup_unique_name(cdg, ob);
BLI_addtail(&ob->defbase, cdg);
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 70709a22d3d..697cddfcee0 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -261,7 +261,7 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
sce->r.alphamode= R_ADDSKY;
sce->r.cfra= scene->r.cfra;
- strcpy(sce->r.engine, scene->r.engine);
+ BLI_strncpy(sce->r.engine, scene->r.engine, sizeof(sce->r.engine));
if(id_type==ID_MA) {
Material *mat= NULL, *origmat= (Material *)id;
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 09329b6b98d..52e6c99e35e 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -649,7 +649,7 @@ static void SCREEN_OT_actionzone(wmOperatorType *ot)
ot->flag= OPTYPE_BLOCKING;
- RNA_def_int(ot->srna, "modifier", 0, 0, 2, "modifier", "modifier state", 0, 2);
+ RNA_def_int(ot->srna, "modifier", 0, 0, 2, "Modifier", "Modifier state", 0, 2);
}
/* ************** swap area operator *********************************** */
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 3010adafe20..27c311aa04f 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -157,7 +157,7 @@ static int screenshot_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", path);
- strcpy(G.ima, path);
+ BLI_strncpy(G.ima, path, sizeof(G.ima));
BLI_path_abs(path, G.main->name);
/* BKE_add_image_extension() checks for if extension was already set */
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 1dca08baacb..4c770729294 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -401,7 +401,7 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int
*tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat|IB_rect);
tile= MEM_callocN(sizeof(UndoImageTile), "UndoImageTile");
- strcpy(tile->idname, ima->id.name);
+ BLI_strncpy(tile->idname, ima->id.name, sizeof(tile->idname));
tile->x= x_tile;
tile->y= y_tile;
@@ -409,7 +409,7 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int
allocsize *= (ibuf->rect_float)? sizeof(float): sizeof(char);
tile->rect= MEM_mapallocN(allocsize, "UndeImageTile.rect");
- strcpy(tile->ibufname, ibuf->name);
+ BLI_strncpy(tile->ibufname, ibuf->name, sizeof(tile->ibufname));
tile->gen_type= ima->gen_type;
tile->source= ima->source;
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 13b6fef3004..a32487e7117 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -262,7 +262,7 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node)
}
unode= MEM_callocN(sizeof(SculptUndoNode), "SculptUndoNode");
- strcpy(unode->idname, ob->id.name);
+ BLI_strncpy(unode->idname, ob->id.name, sizeof(unode->idname));
unode->node= node;
BLI_pbvh_node_num_verts(ss->pbvh, node, &totvert, &allvert);
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index 71d9dd3adcb..beeb5e3532f 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -704,8 +704,8 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
sprintf(str, "(%d) Frames:", iuser->framenr);
else strcpy(str, "Frames:");
uiBlockBeginAlign(block);
- uiDefButI(block, NUM, imagechanged, str, 10, 90,150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Sets the number of images of a movie to use");
- uiDefButI(block, NUM, imagechanged, "StartFr:", 160,90,150,20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Sets the global starting frame of the movie");
+ uiDefButI(block, NUM, imagechanged, str, 10, 90,150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Number of images of a movie to use");
+ uiDefButI(block, NUM, imagechanged, "StartFr:", 160,90,150,20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Global starting frame of the movie");
}
#endif
}
diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c
index d0a80cddf56..52930626964 100644
--- a/source/blender/editors/space_info/info_report.c
+++ b/source/blender/editors/space_info/info_report.c
@@ -160,7 +160,7 @@ void INFO_OT_select_pick(wmOperatorType *ot)
/* ot->flag= OPTYPE_REGISTER; */
/* properties */
- RNA_def_int(ot->srna, "report_index", 0, 0, INT_MAX, "Report", "The index of the report", 0, INT_MAX);
+ RNA_def_int(ot->srna, "report_index", 0, 0, INT_MAX, "Report", "Index of the report", 0, INT_MAX);
}
diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c
index b7f9af09348..b1c0dd02e4b 100644
--- a/source/blender/editors/space_logic/logic_ops.c
+++ b/source/blender/editors/space_logic/logic_ops.c
@@ -478,7 +478,7 @@ static int actuator_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
static void LOGIC_OT_actuator_remove(wmOperatorType *ot)
{
ot->name= "Remove Actuator";
- ot->description= "Remove a actuator from the active object";
+ ot->description= "Remove an actuator from the active object";
ot->idname= "LOGIC_OT_actuator_remove";
ot->invoke= actuator_remove_invoke;
@@ -533,7 +533,7 @@ static void LOGIC_OT_actuator_add(wmOperatorType *ot)
/* identifiers */
ot->name= "Add Actuator";
- ot->description = "Add a actuator to the active object";
+ ot->description = "Add an actuator to the active object";
ot->idname= "LOGIC_OT_actuator_add";
/* api callbacks */
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 7fa4e62359a..7e4d02036ef 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -235,7 +235,7 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
- strcpy(seq->name+2, sce_seq->id.name+2);
+ BLI_strncpy(seq->name+2, sce_seq->id.name+2, sizeof(seq->name)-2);
seqbase_unique_name_recursive(&ed->seqbase, seq);
seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + strip->len, 0);
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 45543a9313e..33d2a27f789 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -929,11 +929,11 @@ static void UNUSED_FUNCTION(seq_remap_paths)(Scene *scene)
if(last_seq==NULL)
return;
- BLI_strncpy(from, last_seq->strip->dir, FILE_MAX);
+ BLI_strncpy(from, last_seq->strip->dir, sizeof(from));
// XXX if (0==sbutton(from, 0, sizeof(from)-1, "From: "))
// return;
- strcpy(to, from);
+ BLI_strncpy(to, from, sizeof(to));
// XXX if (0==sbutton(to, 0, sizeof(to)-1, "To: "))
// return;
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 47f051e1ec4..51f4f1e579c 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -136,7 +136,12 @@ static void text_listener(ScrArea *sa, wmNotifier *wmn)
switch(wmn->data) {
case ND_DISPLAY:
+ ED_area_tag_redraw(sa);
+ break;
case ND_CURSOR:
+ if(st->text && st->text == wmn->reference)
+ text_scroll_to_cursor(st, sa);
+
ED_area_tag_redraw(sa);
break;
}
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 8d40550961f..242bccd2376 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -2583,6 +2583,9 @@ static int set_selection_invoke(bContext *C, wmOperator *op, wmEvent *event)
SpaceText *st= CTX_wm_space_text(C);
SetSelection *ssel;
+ if(event->mval[0]>=st->txtbar.xmin)
+ return OPERATOR_PASS_THROUGH;
+
op->customdata= MEM_callocN(sizeof(SetSelection), "SetCursor");
ssel= op->customdata;
ssel->selecting= RNA_boolean_get(op->ptr, "select");
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 2f0f4e2807f..702e5cc0b55 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -2955,7 +2955,7 @@ static TransData *ActionFCurveToTransData(TransData *td, TransData2D **td2dv, FC
TransData2D *td2d = *td2dv;
int i;
- if (fcu == NULL)
+ if (ELEM(NULL, fcu, fcu->bezt))
return td;
for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) {
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index ae4718d8f56..7f6394e822b 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -464,7 +464,7 @@ void UV_OT_minimize_stretch(wmOperatorType *ot)
/* identifiers */
ot->name= "Minimize Stretch";
ot->idname= "UV_OT_minimize_stretch";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_GRAB_POINTER|OPTYPE_BLOCKING;
ot->description="Reduce UV stretching by relaxing angles";
/* api callbacks */
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index c1ef8c4792b..34c39b1083a 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -1175,7 +1175,7 @@ static struct ImBuf * anim_getnew(struct anim * anim) {
case ANIM_SEQUENCE:
ibuf = IMB_loadiffname(anim->name, anim->ib_flags);
if (ibuf) {
- strcpy(anim->first, anim->name);
+ BLI_strncpy(anim->first, anim->name, sizeof(anim->first));
anim->duration = 1;
}
break;
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index e064d7f760d..aa7defb2f39 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -342,27 +342,55 @@ static int imb_save_openexr_float(struct ImBuf *ibuf, const char *name, int flag
FrameBuffer frameBuffer;
OutputFile *file = new OutputFile(name, header);
- int xstride = sizeof(float) * channels;
- int ystride = - xstride*width;
- float *rect[4] = {NULL, NULL, NULL, NULL};
-
- /* last scanline, stride negative */
- rect[0]= ibuf->rect_float + channels*(height-1)*width;
- rect[1]= rect[0]+1;
- rect[2]= rect[0]+2;
- rect[3]= (channels >= 4)? rect[0]+3:rect[0]; /* red as alpha, is this needed since alpha isnt written? */
-
- frameBuffer.insert ("R", Slice (FLOAT, (char *)rect[0], xstride, ystride));
- frameBuffer.insert ("G", Slice (FLOAT, (char *)rect[1], xstride, ystride));
- frameBuffer.insert ("B", Slice (FLOAT, (char *)rect[2], xstride, ystride));
+ int xstride = sizeof(float) * 4;
+ int ystride = xstride*width;
+ float *init_to = new float [4 * width*height * sizeof(float)];
+ float *from, *to = init_to;
+
+ frameBuffer.insert ("R", Slice (FLOAT, (char *)init_to, xstride, ystride));
+ frameBuffer.insert ("G", Slice (FLOAT, (char *)(init_to + 1), xstride, ystride));
+ frameBuffer.insert ("B", Slice (FLOAT, (char *)(init_to + 2), xstride, ystride));
if (ibuf->depth==32 && channels >= 4)
- frameBuffer.insert ("A", Slice (FLOAT, (char *)rect[3], xstride, ystride));
+ frameBuffer.insert ("A", Slice (FLOAT, (char *)(init_to + 3), xstride, ystride));
if (write_zbuf)
frameBuffer.insert ("Z", Slice (FLOAT, (char *) (ibuf->zbuf_float + (height-1)*width),
sizeof(float), sizeof(float) * -width));
+
+ if(ibuf->profile == IB_PROFILE_LINEAR_RGB) {
+ for (int i = ibuf->y-1; i >= 0; i--)
+ {
+ from= ibuf->rect_float + channels*i*width;
+
+ for (int j = ibuf->x; j > 0; j--)
+ {
+ to[0] = from[0];
+ to[1] = from[1];
+ to[2] = from[2];
+ to[3] = (channels >= 4)? from[3]: 1.0f;
+ to+= 4; from += 4;
+ }
+ }
+ }
+ else {
+ for (int i = ibuf->y-1; i >= 0; i--)
+ {
+ from= ibuf->rect_float + channels*i*width;
+
+ for (int j = ibuf->x; j > 0; j--)
+ {
+ to[0] = srgb_to_linearrgb(from[0]);
+ to[1] = srgb_to_linearrgb(from[1]);
+ to[2] = srgb_to_linearrgb(from[2]);
+ to[3] = (channels >= 4)? from[3]: 1.0f;
+ to+= 4; from += 4;
+ }
+ }
+ }
+
file->setFrameBuffer (frameBuffer);
file->writePixels (height);
delete file;
+ delete [] init_to;
}
catch (const std::exception &exc)
{
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index ff6817bb9fe..13ba0859b7f 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -437,7 +437,8 @@ typedef struct SpaceLogic {
struct bGPdata *gpd; /* grease-pencil data */
} SpaceLogic;
-
+/* note, this entire struct isnt used anymore!,
+ * may remove some day - campbell */
typedef struct SpaceImaSel {
SpaceLink *next, *prev;
ListBase regionbase; /* storage of regions for inactive spaces */
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 44c37f93b5e..f2d1578388d 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -132,7 +132,7 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *
}
}
-static TimeMarker *rna_Action_pose_markers_new(bAction *act, ReportList *reports, const char name[])
+static TimeMarker *rna_Action_pose_markers_new(bAction *act, const char name[])
{
TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
marker->flag= 1;
@@ -550,7 +550,6 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Action_pose_markers_new");
RNA_def_function_ui_description(func, "Add a pose marker to the action");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
RNA_def_property_flag(parm, PROP_REQUIRED);
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index d828139a6d5..2859a7bb89b 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -450,7 +450,7 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, Property
return item;
}
-static void rna_Actuator_Armature_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Actuator_Armature_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
bActuator *act= (bActuator *)ptr->data;
bArmatureActuator *aa = act->data;
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index ebf8990adf3..21e99d312d6 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -80,6 +80,8 @@ static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value)
/* wrapper for poll callback */
static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
{
+ extern FunctionRNA rna_KeyingSetInfo_poll_func;
+
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
@@ -87,7 +89,7 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
int ok;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
- func= RNA_struct_find_function(&ptr, "poll");
+ func= &rna_KeyingSetInfo_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */
@@ -108,12 +110,14 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
/* wrapper for iterator callback */
static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks)
{
+ extern FunctionRNA rna_KeyingSetInfo_iterator_func;
+
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
- func= RNA_struct_find_function(&ptr, "iterator");
+ func= &rna_KeyingSetInfo_iterator_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */
@@ -129,12 +133,14 @@ static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks
/* wrapper for generator callback */
static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, PointerRNA *data)
{
+ extern FunctionRNA rna_KeyingSetInfo_generate_func;
+
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
- func= RNA_struct_find_function(&ptr, "generate");
+ func= &rna_KeyingSetInfo_generate_func; /* RNA_struct_find_generate(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index 357f613f65f..e21f6aeb26f 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -76,7 +76,7 @@ EnumPropertyItem boidruleset_type_items[] ={
#include "BKE_depsgraph.h"
#include "BKE_particle.h"
-static void rna_Boids_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
if(ptr->type==&RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index edae977f3f6..c03a10f2170 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -292,7 +292,7 @@ static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
}
}
-static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
Curve *cu= (Curve*)ptr->id.data;
@@ -722,7 +722,7 @@ static void rna_def_bpoint(BlenderRNA *brna)
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vec[3]");
- RNA_def_property_ui_text(prop, "Weight", "Nurbs weight");
+ RNA_def_property_ui_text(prop, "Weight", "NURBS weight");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Number values */
@@ -1446,7 +1446,7 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Spline", NULL);
RNA_def_struct_sdna(srna, "Nurb");
- RNA_def_struct_ui_text(srna, "Spline", "Element of a curve, either Nurbs, Bezier or Polyline or a character with text objects");
+ RNA_def_struct_ui_text(srna, "Spline", "Element of a curve, either NURBS, Bezier or Polyline or a character with text objects");
prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bp", NULL);
@@ -1496,13 +1496,13 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
prop= RNA_def_property(srna, "order_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orderu");
RNA_def_property_range(prop, 2, 6);
- RNA_def_property_ui_text(prop, "Order U", "Nurbs order in the U direction (For splines and surfaces), Higher values let points influence a greater area");
+ RNA_def_property_ui_text(prop, "Order U", "NURBS order in the U direction (for splines and surfaces, higher values let points influence a greater area)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
prop= RNA_def_property(srna, "order_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orderv");
RNA_def_property_range(prop, 2, 6);
- RNA_def_property_ui_text(prop, "Order V", "Nurbs order in the V direction (For surfaces only), Higher values let points influence a greater area");
+ RNA_def_property_ui_text(prop, "Order V", "NURBS order in the V direction (for surfaces only, higher values let points influence a greater area)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index 43812ad4a01..08a71e0cd4f 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -1368,13 +1368,14 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "ipo");
RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
RNA_def_property_ui_text(prop, "Interpolation",
- "Interpolation method to use for segment of the curve from this Keyframe until the next Keyframe");
+ "Interpolation method to use for segment of the F-Curve from "
+ "this Keyframe until the next Keyframe");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "hide");
RNA_def_property_enum_items(prop, beztriple_keyframe_type_items);
- RNA_def_property_ui_text(prop, "Type", "The type of keyframe (for visual purposes only");
+ RNA_def_property_ui_text(prop, "Type", "Type of keyframe (for visual purposes only)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
/* Vector values */
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index ba90aca47a3..c114c44ad77 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -173,6 +173,7 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA
static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *value)
{
#ifdef DISABLE_ELBEEM
+ (void)ptr;
value[0]= '\0';
#else
Object *ob= (Object*)ptr->id.data;
@@ -182,7 +183,7 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v
#endif
}
-static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *ptr)
+static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *UNUSED(ptr))
{
#ifdef DISABLE_ELBEEM
return 0;
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index eac4932ac43..66bcc5951cd 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -369,25 +369,25 @@ static void rna_def_imageuser(BlenderRNA *brna)
prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frames");
RNA_def_property_range(prop, 0, MAXFRAMEF);
- RNA_def_property_ui_text(prop, "Frames", "Sets the number of images of a movie to use");
+ RNA_def_property_ui_text(prop, "Frames", "Number of images of a movie to use");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
- RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation");
+ RNA_def_property_ui_text(prop, "Offset", "Offset the number of the frame to use in the animation");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
- RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie/sequence, assuming first picture has a #1");
+ RNA_def_property_ui_text(prop, "Start Frame", "Global starting frame of the movie/sequence, assuming first picture has a #1");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "fie_ima");
RNA_def_property_range(prop, 1, 200);
- RNA_def_property_ui_text(prop, "Fields per Frame", "The number of fields per rendered frame (2 fields is 1 image)");
+ RNA_def_property_ui_text(prop, "Fields per Frame", "Number of fields per rendered frame (2 fields is 1 image)");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED);
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c
index 2a81c4f0a2c..f30fea659ae 100644
--- a/source/blender/makesrna/intern/rna_lattice.c
+++ b/source/blender/makesrna/intern/rna_lattice.c
@@ -179,10 +179,11 @@ static void rna_Lattice_points_w_set(PointerRNA *ptr, int value)
static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value)
{
Lattice *lt= ptr->data;
- strcpy(lt->vgroup, value);
+ BLI_strncpy(lt->vgroup, value, sizeof(lt->vgroup));
- if(lt->editlatt)
- strcpy(lt->editlatt->latt->vgroup, value);
+ if(lt->editlatt) {
+ BLI_strncpy(lt->editlatt->latt->vgroup, value, sizeof(lt->editlatt->latt->vgroup));
+ }
}
/* annoying, but is a consequence of RNA structures... */
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index d35b7ad38fb..c4f33f9cf10 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -1383,20 +1383,20 @@ static void rna_def_mtface(BlenderRNA *brna)
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_get", "rna_MeshTextureFaceLayer_active_set");
- RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing");
+ RNA_def_property_ui_text(prop, "Active", "Set the layer as active for display and editing");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_render_get",
"rna_MeshTextureFaceLayer_active_render_set");
- RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering");
+ RNA_def_property_ui_text(prop, "Active Render", "Set the layer as active for rendering");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop= RNA_def_property(srna, "active_clone", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "active_clone", 0);
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_clone_get", "rna_MeshTextureFaceLayer_clone_set");
- RNA_def_property_ui_text(prop, "Active Clone", "Sets the layer as active for cloning");
+ RNA_def_property_ui_text(prop, "Active Clone", "Set the layer as active for cloning");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
@@ -1835,7 +1835,8 @@ static void rna_def_mesh(BlenderRNA *brna)
/* UV textures */
prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", NULL, NULL, NULL, "rna_Mesh_uv_textures_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", NULL, NULL, NULL,
+ "rna_Mesh_uv_textures_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
RNA_def_property_ui_text(prop, "UV Textures", "");
rna_def_uv_textures(brna, prop);
@@ -1865,26 +1866,30 @@ static void rna_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "vertex_colors", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", NULL, NULL, NULL, "rna_Mesh_vertex_colors_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", NULL, NULL, NULL,
+ "rna_Mesh_vertex_colors_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshColorLayer");
RNA_def_property_ui_text(prop, "Vertex Colors", "");
rna_def_vertex_colors(brna, prop);
prop= RNA_def_property(srna, "layers_float", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", NULL, NULL, NULL, "rna_Mesh_float_layers_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", NULL, NULL, NULL,
+ "rna_Mesh_float_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshFloatPropertyLayer");
RNA_def_property_ui_text(prop, "Float Property Layers", "");
prop= RNA_def_property(srna, "layers_int", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", NULL, NULL, NULL, "rna_Mesh_int_layers_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", NULL, NULL, NULL,
+ "rna_Mesh_int_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshIntPropertyLayer");
RNA_def_property_ui_text(prop, "Int Property Layers", "");
prop= RNA_def_property(srna, "layers_string", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", NULL, NULL, NULL, "rna_Mesh_string_layers_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", NULL, NULL, NULL,
+ "rna_Mesh_string_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshStringPropertyLayer");
RNA_def_property_ui_text(prop, "String Property Layers", "");
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 8a6a69886c6..2386030027f 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1403,19 +1403,19 @@ static void def_cmp_image(StructRNA *srna)
prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frames");
RNA_def_property_range(prop, 0, MAXFRAMEF);
- RNA_def_property_ui_text(prop, "Frames", "Sets the number of images of a movie to use"); /* copied from the rna_image.c */
+ RNA_def_property_ui_text(prop, "Frames", "Number of images of a movie to use"); /* copied from the rna_image.c */
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
- RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie/sequence, assuming first picture has a #1"); /* copied from the rna_image.c */
+ RNA_def_property_ui_text(prop, "Start Frame", "Global starting frame of the movie/sequence, assuming first picture has a #1"); /* copied from the rna_image.c */
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
- RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation"); /* copied from the rna_image.c */
+ RNA_def_property_ui_text(prop, "Offset", "Offset the number of the frame to use in the animation"); /* copied from the rna_image.c */
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index bbbec3bcf9a..e329df8470d 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1397,7 +1397,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Controller");
RNA_def_property_ui_text(prop, "Controllers",
- "Game engine controllers to process events, connecting sensor to actuators");
+ "Game engine controllers to process events, connecting sensors to actuators");
prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Actuator");
@@ -1426,7 +1426,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "body_type");
RNA_def_property_enum_items(prop, body_type_items);
RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get", "rna_GameObjectSettings_physics_type_set", NULL);
- RNA_def_property_ui_text(prop, "Physics Type", "Selects the type of physical representation");
+ RNA_def_property_ui_text(prop, "Physics Type", "Select the type of physical representation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_actor", PROP_BOOLEAN, PROP_NONE);
@@ -1488,20 +1488,20 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
/* lock rotation */
prop= RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_ROT_AXIS);
- RNA_def_property_ui_text(prop, "Lock X Rotation Axis", "Disable simulation of angular motion along the X axis");
+ RNA_def_property_ui_text(prop, "Lock X Rotation Axis", "Disable simulation of angular motion along the X axis");
prop= RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_ROT_AXIS);
- RNA_def_property_ui_text(prop, "Lock Y Rotation Axis", "Disable simulation of angular motion along the Y axis");
+ RNA_def_property_ui_text(prop, "Lock Y Rotation Axis", "Disable simulation of angular motion along the Y axis");
prop= RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_ROT_AXIS);
- RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
+ RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
/* is this used anywhere ? */
prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflag2", OB_NEVER_DO_ACTIVITY_CULLING);
- RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
+ RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
prop= RNA_def_property(srna, "use_material_physics_fh", PROP_BOOLEAN, PROP_NONE);
@@ -1526,7 +1526,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "anisotropicFriction");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Friction Coefficients",
- "Relative friction coefficient in the in the X, Y and Z directions, "
+ "Relative friction coefficients in the in the X, Y and Z directions, "
"when anisotropic friction is enabled");
prop= RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE);
@@ -1537,7 +1537,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "boundtype");
RNA_def_property_enum_items(prop, collision_bounds_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Object_collision_bounds_itemf");
- RNA_def_property_ui_text(prop, "Collision Bounds", "Selects the collision type");
+ RNA_def_property_ui_text(prop, "Collision Bounds", "Select the collision type");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "use_collision_compound", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index c36dca22731..597f8730e72 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -193,7 +193,7 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
pid2 = pid;
else if(cache->name[0] != '\0' && strcmp(cache->name,pid->cache->name)==0) {
/*TODO: report "name exists" to user */
- strcpy(cache->name, cache->prev_name);
+ BLI_strncpy(cache->name, cache->prev_name, sizeof(cache->name));
new_name = 0;
}
}
@@ -203,13 +203,13 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
char old_name[80];
char new_name[80];
- strcpy(old_name, cache->prev_name);
- strcpy(new_name, cache->name);
+ BLI_strncpy(old_name, cache->prev_name, sizeof(old_name));
+ BLI_strncpy(new_name, cache->name, sizeof(new_name));
BKE_ptcache_disk_cache_rename(pid2, old_name, new_name);
}
- strcpy(cache->prev_name, cache->name);
+ BLI_strncpy(cache->prev_name, cache->name, sizeof(cache->prev_name));
}
}
@@ -679,7 +679,8 @@ static void rna_softbody_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point
}
-static EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
+static EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
Object *ob= NULL;
@@ -725,7 +726,8 @@ static void rna_def_ptcache_point_caches(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Point Caches", "Collection of point caches");
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set", "rna_Cache_active_point_cache_index_range");
+ RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set",
+ "rna_Cache_active_point_cache_index_range");
RNA_def_property_ui_text(prop, "Active Point Cache Index", "");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change");
}
@@ -827,7 +829,8 @@ static void rna_def_pointcache(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
prop= RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next",
+ "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list");
rna_def_ptcache_point_caches(brna, prop);
@@ -914,7 +917,8 @@ static void rna_def_collision(BlenderRNA *brna)
prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
- RNA_def_property_ui_text(prop, "Absorption", "How much of effector force gets lost during collision with this object (in percent)");
+ RNA_def_property_ui_text(prop, "Absorption",
+ "How much of effector force gets lost during collision with this object (in percent)");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
}
@@ -1128,7 +1132,9 @@ static void rna_def_field(BlenderRNA *brna)
prop= RNA_def_property(srna, "texture_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "tex_mode");
RNA_def_property_enum_items(prop, texture_items);
- RNA_def_property_ui_text(prop, "Texture Mode", "How the texture effect is calculated (RGB & Curl need a RGB texture else Gradient will be used instead)");
+ RNA_def_property_ui_text(prop, "Texture Mode",
+ "How the texture effect is calculated (RGB & Curl need a RGB texture, "
+ "else Gradient will be used instead)");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
prop= RNA_def_property(srna, "z_direction", PROP_ENUM, PROP_NONE);
@@ -1423,7 +1429,10 @@ static void rna_def_game_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "weld_threshold", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "welding");
RNA_def_property_range(prop, 0.0f, 0.01f);
- RNA_def_property_ui_text(prop, "Welding", "Welding threshold: distance between nearby vertices to be considered equal => set to 0.0 to disable welding test and speed up scene loading (ok if the mesh has no duplicates)");
+ RNA_def_property_ui_text(prop, "Welding",
+ "Welding threshold: distance between nearby vertices to be considered equal "
+ "=> set to 0.0 to disable welding test and speed up scene loading "
+ "(ok if the mesh has no duplicates)");
/* Integers */
@@ -1435,7 +1444,7 @@ static void rna_def_game_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "cluster_iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "numclusteriterations");
RNA_def_property_range(prop, 1, 128);
- RNA_def_property_ui_text(prop, "Cluster Iterations", "Specify the number of cluster iterations");
+ RNA_def_property_ui_text(prop, "Cluster Iterations", "Number of cluster iterations");
/* Booleans */
@@ -1519,7 +1528,8 @@ static void rna_def_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "vertex_group_goal", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vertgroup");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not impossible .. but not supported yet */
- RNA_def_property_string_funcs(prop, "rna_SoftBodySettings_goal_vgroup_get", "rna_SoftBodySettings_goal_vgroup_length", "rna_SoftBodySettings_goal_vgroup_set");
+ RNA_def_property_string_funcs(prop, "rna_SoftBodySettings_goal_vgroup_get", "rna_SoftBodySettings_goal_vgroup_length",
+ "rna_SoftBodySettings_goal_vgroup_set");
RNA_def_property_ui_text(prop, "Goal Vertex Group", "Control point weight values");
prop= RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE);
@@ -1641,7 +1651,8 @@ static void rna_def_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rklimit");
RNA_def_property_range(prop, 0.001f, 10.0f);
- RNA_def_property_ui_text(prop, "Error Limit", "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed");
+ RNA_def_property_ui_text(prop, "Error Limit",
+ "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed");
RNA_def_property_update(prop, 0, "rna_softbody_update");
prop= RNA_def_property(srna, "step_min", PROP_INT, PROP_NONE);
@@ -1665,7 +1676,8 @@ static void rna_def_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "fuzzy", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "fuzzyness");
RNA_def_property_range(prop, 1, 100);
- RNA_def_property_ui_text(prop, "Fuzzy", "Fuzziness while on collision, high values make collision handling faster but less stable");
+ RNA_def_property_ui_text(prop, "Fuzzy",
+ "Fuzziness while on collision, high values make collision handling faster but less stable");
RNA_def_property_update(prop, 0, "rna_softbody_update");
prop= RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index e3a3f93b5f3..d224bd0d4e5 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -48,13 +48,14 @@
// XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable
EnumPropertyItem posebone_rotmode_items[] = {
{ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"},
- {ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock"},
- {ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"},
- {ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"},
- {ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"},
- {ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"},
- {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"},
- {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector"},
+ {ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order (prone to Gimbal Lock)"},
+ {ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order (prone to Gimbal Lock)"},
+ {ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order (prone to Gimbal Lock)"},
+ {ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order (prone to Gimbal Lock)"},
+ {ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order (prone to Gimbal Lock)"},
+ {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order (prone to Gimbal Lock)"},
+ {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle",
+ "Axis Angle (W+XYZ), defines a rotation around some axis defined by 3D-Vector"},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
@@ -717,7 +718,8 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro
/* Collection active property */
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
- RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_active_constraint_get", "rna_PoseChannel_active_constraint_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_active_constraint_get",
+ "rna_PoseChannel_active_constraint_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Constraint", "Active PoseChannel constraint");
@@ -820,7 +822,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
*/
prop= RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
RNA_def_property_array(prop, 4);
- RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get", "rna_PoseChannel_rotation_axis_angle_set", NULL);
+ RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get",
+ "rna_PoseChannel_rotation_axis_angle_set", NULL);
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable");
RNA_def_property_float_array_default(prop, default_axisAngle);
RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
@@ -853,7 +856,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
prop= RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "Basis Matrix",
- "Provides an alternative access to loc/scale/rotation relative to the parent and own rest bone");
+ "Alternative access to location/scale/rotation relative to the parent and own rest bone");
RNA_def_property_float_funcs(prop, "rna_PoseChannel_matrix_basis_get", "rna_PoseChannel_matrix_basis_set", NULL);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
@@ -1039,7 +1042,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "agrp_index");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_int_funcs(prop, "rna_PoseChannel_bone_group_index_get", "rna_PoseChannel_bone_group_index_set", "rna_PoseChannel_bone_group_index_range");
+ RNA_def_property_int_funcs(prop, "rna_PoseChannel_bone_group_index_get", "rna_PoseChannel_bone_group_index_set",
+ "rna_PoseChannel_bone_group_index_range");
RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group)");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
@@ -1072,7 +1076,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
// XXX this is sub-optimal - it really should be included above, but due to technical reasons we can't do this!
prop= RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW);
- RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)", "Lock editing of 'angle' component of four-component rotations in the interface");
+ RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)",
+ "Lock editing of 'angle' component of four-component rotations in the interface");
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
@@ -1080,7 +1085,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
// XXX this needs a better name
prop= RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROT4D);
- RNA_def_property_ui_text(prop, "Lock Rotations (4D)", "Lock editing of four component rotations by components (instead of as Eulers)");
+ RNA_def_property_ui_text(prop, "Lock Rotations (4D)",
+ "Lock editing of four component rotations by components (instead of as Eulers)");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
@@ -1098,13 +1104,17 @@ static void rna_def_pose_channel(BlenderRNA *brna)
static void rna_def_pose_itasc(BlenderRNA *brna)
{
static const EnumPropertyItem prop_itasc_mode_items[]= {
- {0, "ANIMATION", 0, "Animation", "Stateless solver computing pose starting from current action and non-IK constraints"},
- {ITASC_SIMULATION, "SIMULATION", 0, "Simulation", "Statefull solver running in real-time context and ignoring actions and non-IK constraints"},
+ {0, "ANIMATION", 0, "Animation",
+ "Stateless solver computing pose starting from current action and non-IK constraints"},
+ {ITASC_SIMULATION, "SIMULATION", 0, "Simulation",
+ "Statefull solver running in real-time context and ignoring actions and non-IK constraints"},
{0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_itasc_reiteration_items[]= {
{0, "NEVER", 0, "Never", "The solver does not reiterate, not even on first frame (starts from rest pose)"},
- {ITASC_INITIAL_REITERATION, "INITIAL", 0, "Initial", "The solver reiterates (converges) on the first frame but not on subsequent frame"},
- {ITASC_INITIAL_REITERATION|ITASC_REITERATION, "ALWAYS", 0, "Always", "The solver reiterates (converges) on all frames"},
+ {ITASC_INITIAL_REITERATION, "INITIAL", 0, "Initial",
+ "The solver reiterates (converges) on the first frame but not on subsequent frame"},
+ {ITASC_INITIAL_REITERATION|ITASC_REITERATION, "ALWAYS", 0, "Always",
+ "The solver reiterates (converges) on all frames"},
{0, NULL, 0, NULL, NULL}};
StructRNA *srna;
@@ -1141,12 +1151,15 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
prop= RNA_def_property(srna, "reiteration_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_itasc_reiteration_items);
- RNA_def_property_ui_text(prop, "Reiteration", "Defines if the solver is allowed to reiterate (converges until precision is met) on none, first or all frames");
+ RNA_def_property_ui_text(prop, "Reiteration",
+ "Defines if the solver is allowed to reiterate (converges until "
+ "precision is met) on none, first or all frames");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
prop= RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ITASC_AUTO_STEP);
- RNA_def_property_ui_text(prop, "Auto step", "Automatically determine the optimal number of steps for best performance/accuracy trade off");
+ RNA_def_property_ui_text(prop, "Auto step",
+ "Automatically determine the optimal number of steps for best performance/accuracy trade off");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
prop= RNA_def_property(srna, "step_min", PROP_FLOAT, PROP_NONE);
@@ -1164,7 +1177,8 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
prop= RNA_def_property(srna, "feedback", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "feedback");
RNA_def_property_range(prop, 0.0f,100.0f);
- RNA_def_property_ui_text(prop, "Feedback", "Feedback coefficient for error correction. Average response time=1/feedback. Default=20");
+ RNA_def_property_ui_text(prop, "Feedback",
+ "Feedback coefficient for error correction. Average response time=1/feedback. Default=20");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
prop= RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
@@ -1182,13 +1196,17 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
prop= RNA_def_property(srna, "damping_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampmax");
RNA_def_property_range(prop, 0.0f,1.0f);
- RNA_def_property_ui_text(prop, "Damp", "Maximum damping coefficient when singular value is nearly 0. Higher values=more stability, less reactivity. Default=0.5");
+ RNA_def_property_ui_text(prop, "Damp",
+ "Maximum damping coefficient when singular value is nearly 0 "
+ "(higher values=more stability, less reactivity - default=0.5)");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
prop= RNA_def_property(srna, "damping_epsilon", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampeps");
RNA_def_property_range(prop, 0.0f,1.0f);
- RNA_def_property_ui_text(prop, "Epsilon", "Singular value under which damping is progressively applied. Higher values=more stability, less reactivity. Default=0.1");
+ RNA_def_property_ui_text(prop, "Epsilon",
+ "Singular value under which damping is progressively applied "
+ "(higher values=more stability, less reactivity - default=0.1)");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
}
@@ -1232,7 +1250,8 @@ static void rna_def_bone_groups(BlenderRNA *brna, PropertyRNA *cprop)
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_group");
- RNA_def_property_int_funcs(prop, "rna_Pose_active_bone_group_index_get", "rna_Pose_active_bone_group_index_set", "rna_Pose_active_bone_group_index_range");
+ RNA_def_property_int_funcs(prop, "rna_Pose_active_bone_group_index_get", "rna_Pose_active_bone_group_index_set",
+ "rna_Pose_active_bone_group_index_range");
RNA_def_property_ui_text(prop, "Active Bone Group Index", "Active index in bone groups array");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
}
@@ -1265,7 +1284,8 @@ static void rna_def_pose(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "iksolver");
RNA_def_property_enum_funcs(prop, NULL, "rna_Pose_ik_solver_set", NULL);
RNA_def_property_enum_items(prop, prop_iksolver_items);
- RNA_def_property_ui_text(prop, "IK Solver", "Selection of IK solver for IK chain, current choice is 0 for Legacy, 1 for iTaSC");
+ RNA_def_property_ui_text(prop, "IK Solver",
+ "Selection of IK solver for IK chain, current choice is 0 for Legacy, 1 for iTaSC");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_ik_solver_update");
prop= RNA_def_property(srna, "ik_param", PROP_POINTER, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index f5fab9d2f33..a2e68668856 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -88,12 +88,14 @@ void RE_engines_exit(void)
static void engine_render(RenderEngine *engine, struct Scene *scene)
{
+ extern FunctionRNA rna_RenderEngine_render_func;
+
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
- func= RNA_struct_find_function(&ptr, "render");
+ func= &rna_RenderEngine_render_func; /* RNA_struct_find_function(&ptr, "render"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "scene", &scene);
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 376b0c529d0..31c872f43f8 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -167,7 +167,7 @@ static int rna_idproperty_known(CollectionPropertyIterator *iter, void *data)
return 0;
}
-static int rna_property_builtin(CollectionPropertyIterator *iter, void *data)
+static int rna_property_builtin(CollectionPropertyIterator *UNUSED(iter), void *data)
{
PropertyRNA *prop= (PropertyRNA*)data;
@@ -176,7 +176,7 @@ static int rna_property_builtin(CollectionPropertyIterator *iter, void *data)
return (prop->flag & PROP_BUILTIN);
}
-static int rna_function_builtin(CollectionPropertyIterator *iter, void *data)
+static int rna_function_builtin(CollectionPropertyIterator *UNUSED(iter), void *data)
{
FunctionRNA *func= (FunctionRNA*)data;
@@ -775,7 +775,7 @@ static int rna_EnumProperty_default_get(PointerRNA *ptr)
return ((EnumPropertyRNA*)prop)->defaultvalue;
}
-static int rna_enum_check_separator(CollectionPropertyIterator *iter, void *data)
+static int rna_enum_check_separator(CollectionPropertyIterator *UNUSED(iter), void *data)
{
EnumPropertyItem *item= (EnumPropertyItem*)data;
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 3c83ff6d831..a68d4e93c00 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1061,7 +1061,7 @@ static void rna_SceneCamera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
* is not for general use and only for the few cases where changing scene
* settings and NOT for general purpose updates, possibly this should be
* given its own notifier. */
-static void rna_Scene_update_active_object_data(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Scene_update_active_object_data(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
Object *ob= OBACT;
if(ob) {
@@ -1762,13 +1762,13 @@ static void rna_def_scene_game_recast_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "region_min_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "regionminsize");
RNA_def_property_ui_range(prop, 0, 150, 1, 2);
- RNA_def_property_ui_text(prop, "Min Region Size", "Minimum regions size. Smaller regions will be deleted");
+ RNA_def_property_ui_text(prop, "Min Region Size", "Minimum regions size (smaller regions will be deleted)");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "region_merge_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "regionmergesize");
RNA_def_property_ui_range(prop, 0, 150, 1, 2);
- RNA_def_property_ui_text(prop, "Merged Region Size", "Minimum regions size. Smaller regions will be merged");
+ RNA_def_property_ui_text(prop, "Merged Region Size", "Minimum regions size (smaller regions will be merged)");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "edge_max_len", PROP_FLOAT, PROP_NONE);
@@ -1984,7 +1984,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "occlusionRes");
RNA_def_property_range(prop, 128.0, 1024.0);
RNA_def_property_ui_text(prop, "Occlusion Resolution",
- "The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
+ "Size of the occlusion buffer in pixel, use higher value for better precision (slower)");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
@@ -1992,7 +1992,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 1, 60, 1, 1);
RNA_def_property_range(prop, 1, 250);
RNA_def_property_ui_text(prop, "Frames Per Second",
- "The nominal number of game frames per second "
+ "Nominal number of game frames per second "
"(physics fixed timestep = 1/fps, independently of actual frame rate)");
RNA_def_property_update(prop, NC_SCENE, NULL);
@@ -2001,7 +2001,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_text(prop, "Max Logic Steps",
- "Sets the maximum number of logic frame per game frame if graphics slows down the game, "
+ "Maximum number of logic frame per game frame if graphics slows down the game, "
"higher value allows better synchronization with physics");
RNA_def_property_update(prop, NC_SCENE, NULL);
@@ -2010,7 +2010,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_text(prop, "Max Physics Steps",
- "Sets the maximum number of physics step per game frame if graphics slows down the game, "
+ "Maximum number of physics step per game frame if graphics slows down the game, "
"higher value allows physics to keep up with realtime");
RNA_def_property_update(prop, NC_SCENE, NULL);
@@ -2019,7 +2019,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_text(prop, "Physics Sub Steps",
- "Sets the number of simulation substep per physic timestep, "
+ "Number of simulation substep per physic timestep, "
"higher value give better physics precision");
RNA_def_property_update(prop, NC_SCENE, NULL);
@@ -2073,7 +2073,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
- RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
+ RNA_def_property_ui_text(prop, "Record Animation", "Record animation to F-Curves");
prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
@@ -2082,8 +2082,8 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "restrict_animation_updates", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_RESTRICT_ANIM_UPDATES);
RNA_def_property_ui_text(prop, "Restrict Animation Updates",
- "Restrict the number of animation updates to the animation FPS. This is "
- "better for performance, but can cause issues with smooth playback");
+ "Restrict the number of animation updates to the animation FPS (this is "
+ "better for performance, but can cause issues with smooth playback)");
/* materials */
prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 28b96f3b08b..d169ee5079b 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -127,7 +127,8 @@ static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
pset->brushtype = value;
}
-static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *UNUSED(free))
+static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UNUSED(ptr),
+ PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
Scene *scene= CTX_data_scene(C);
Object *ob= (scene->basact)? scene->basact->object: NULL;
@@ -275,7 +276,8 @@ static void rna_def_sculpt(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMMETRY_FEATHER);
- RNA_def_property_ui_text(prop, "Symmetry Feathering", "Reduce the strength of the brush where it overlaps symmetrical daubs");
+ RNA_def_property_ui_text(prop, "Symmetry Feathering",
+ "Reduce the strength of the brush where it overlaps symmetrical daubs");
prop= RNA_def_property(srna, "use_threaded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_USE_OPENMP);
@@ -283,7 +285,9 @@ static void rna_def_sculpt(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_ONLY_DEFORM);
- RNA_def_property_ui_text(prop, "Use Deform Only", "Use only deformation modifiers (temporary disable all constructive modifiers except multi-resolution)");
+ RNA_def_property_ui_text(prop, "Use Deform Only",
+ "Use only deformation modifiers (temporary disable all "
+ "constructive modifiers except multi-resolution)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Sculpt_update");
}
@@ -345,7 +349,8 @@ static void rna_def_image_paint(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE);
- RNA_def_property_ui_text(prop, "Clone Layer", "Use another UV layer as clone source, otherwise use 3D the cursor as the source");
+ RNA_def_property_ui_text(prop, "Clone Layer",
+ "Use another UV layer as clone source, otherwise use 3D the cursor as the source");
/* integers */
@@ -357,7 +362,8 @@ static void rna_def_image_paint(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 90);
RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
- prop= RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size", "Size to capture the image for re-projecting", 0, 0);
+ prop= RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size",
+ "Size to capture the image for re-projecting", 0, 0);
RNA_def_property_range(prop, 512, 16384);
}
@@ -518,7 +524,8 @@ static void rna_def_particle_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_BRUSH_DATA_PUFF_VOLUME);
- RNA_def_property_ui_text(prop, "Puff Volume", "Apply puff to unselected end-points, (helps maintain hair volume when puffing root)");
+ RNA_def_property_ui_text(prop, "Puff Volume",
+ "Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
prop= RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "invert");
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index b90f10693ac..9d72eeacf3e 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -1190,7 +1190,7 @@ static void rna_def_editor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Overlay Offset", "");
RNA_def_property_int_funcs(prop, "rna_SequenceEditor_overlay_frame_get", "rna_SequenceEditor_overlay_frame_set", NULL);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip");
+ RNA_def_property_ui_text(prop, "Active Strip", "Sequencer's active strip");
}
static void rna_def_filter_video(StructRNA *srna)
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 217d68860f2..44bdeba3e2e 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -177,14 +177,14 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_range(prop, -5.0, 5.0);
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
- RNA_def_property_ui_text(prop, "Density", "How much density effects smoke motion, higher value results in faster rising smoke");
+ RNA_def_property_ui_text(prop, "Density", "How much density affects smoke motion (higher value results in faster rising smoke)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "beta");
RNA_def_property_range(prop, -5.0, 5.0);
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
- RNA_def_property_ui_text(prop, "Heat", "How much heat effects smoke motion, higher value results in faster rising smoke");
+ RNA_def_property_ui_text(prop, "Heat", "How much heat affects smoke motion (higher value results in faster rising smoke)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE);
@@ -245,7 +245,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
RNA_def_property_enum_items(prop, smoke_domain_colli_items);
- RNA_def_property_ui_text(prop, "Border Collisions", "Selects which domain border will be treated as collision object");
+ RNA_def_property_ui_text(prop, "Border Collisions", "Select which domain border will be treated as collision object");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
@@ -313,7 +313,7 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY);
- RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits it's velocity from the emitter particle");
+ RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits its velocity from the emitter particle");
prop= RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vel_multi");
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 202fb759e89..af253736017 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -881,7 +881,7 @@ static int rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, PointerRNA value)
return (ntree->nodetype==0 && ntree->type == snode->treetype);
}
-static void rna_SpaceNodeEditor_node_tree_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_SpaceNodeEditor_node_tree_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
SpaceNode *snode= (SpaceNode*)ptr->data;
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index b5e8acb76e5..1babf5e61a1 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -133,7 +133,7 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
}
}
-static void rna_Texture_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Texture_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Tex *tex= ptr->id.data;
@@ -162,7 +162,7 @@ static void rna_Texture_voxeldata_image_update(Main *bmain, Scene *scene, Pointe
/* Used for Texture Properties, used (also) for/in Nodes */
-static void rna_Texture_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Texture_nodes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Tex *tex= ptr->id.data;
@@ -177,7 +177,7 @@ static void rna_Texture_type_set(PointerRNA *ptr, int value)
tex_set_type(tex, value);
}
-void rna_TextureSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
ID *id= ptr->id.data;
@@ -388,12 +388,12 @@ static void rna_PointDensity_psys_set(PointerRNA *ptr, PointerRNA value)
pd->psys= BLI_findindex(&ob->particlesystem, value.data) + 1;
}
-static char *rna_PointDensity_path(PointerRNA *ptr)
+static char *rna_PointDensity_path(PointerRNA *UNUSED(ptr))
{
return BLI_sprintfN("point_density");
}
-static char *rna_VoxelData_path(PointerRNA *ptr)
+static char *rna_VoxelData_path(PointerRNA *UNUSED(ptr))
{
return BLI_sprintfN("voxel_data");
}
@@ -698,7 +698,7 @@ static EnumPropertyItem prop_noise_basis_items[] = {
{TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle",
"Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges"},
{TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise",
- "Noise algorithm - Cell Noise: Square cell tessallation"},
+ "Noise algorithm - Cell Noise: Square cell tessellation"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_noise_type[] = {
@@ -1525,13 +1525,13 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
prop= RNA_def_property(srna, "particle_cache_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space");
RNA_def_property_enum_items(prop, particle_cache_items);
- RNA_def_property_ui_text(prop, "Particle Cache", "Co-ordinate system to cache particles in");
+ RNA_def_property_ui_text(prop, "Particle Cache", "Coordinate system to cache particles in");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "vertex_cache_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space");
RNA_def_property_enum_items(prop, vertice_cache_items);
- RNA_def_property_ui_text(prop, "Vertices Cache", "Co-ordinate system to cache vertices in");
+ RNA_def_property_ui_text(prop, "Vertices Cache", "Coordinate system to cache vertices in");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
@@ -1657,9 +1657,9 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem voxeldata_extension[] = {
- {TEX_EXTEND, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"},
- {TEX_CLIP, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"},
- {TEX_REPEAT, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
+ {TEX_EXTEND, "EXTEND", 0, "Extend", "Extend by repeating edge pixels of the image"},
+ {TEX_CLIP, "CLIP", 0, "Clip", "Clip to image size and set exterior pixels as transparent"},
+ {TEX_REPEAT, "REPEAT", 0, "Repeat", "Cause the image to repeat horizontally and vertically"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem smoked_type_items[] = {
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 2c2bc4704bf..2a62a39ef33 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -95,6 +95,8 @@ static ARegionType *region_type_find(ReportList *reports, int space_type, int re
static int panel_poll(const bContext *C, PanelType *pt)
{
+ extern FunctionRNA rna_Panel_poll_func;
+
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
@@ -102,7 +104,7 @@ static int panel_poll(const bContext *C, PanelType *pt)
int visible;
RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */
- func= RNA_struct_find_function(&ptr, "poll");
+ func= &rna_Panel_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -118,12 +120,14 @@ static int panel_poll(const bContext *C, PanelType *pt)
static void panel_draw(const bContext *C, Panel *pnl)
{
+ extern FunctionRNA rna_Panel_draw_func;
+
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr);
- func= RNA_struct_find_function(&ptr, "draw");
+ func= &rna_Panel_draw_func;/* RNA_struct_find_function(&ptr, "draw"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -134,12 +138,14 @@ static void panel_draw(const bContext *C, Panel *pnl)
static void panel_draw_header(const bContext *C, Panel *pnl)
{
+ extern FunctionRNA rna_Panel_draw_header_func;
+
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr);
- func= RNA_struct_find_function(&ptr, "draw_header");
+ func= &rna_Panel_draw_header_func; /* RNA_struct_find_function(&ptr, "draw_header"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -249,12 +255,14 @@ static StructRNA* rna_Panel_refine(PointerRNA *ptr)
static void header_draw(const bContext *C, Header *hdr)
{
+ extern FunctionRNA rna_Header_draw_func;
+
PointerRNA htr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->ext.srna, hdr, &htr);
- func= RNA_struct_find_function(&htr, "draw");
+ func= &rna_Header_draw_func; /* RNA_struct_find_function(&htr, "draw"); */
RNA_parameter_list_create(&list, &htr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -347,6 +355,8 @@ static StructRNA* rna_Header_refine(PointerRNA *htr)
static int menu_poll(const bContext *C, MenuType *pt)
{
+ extern FunctionRNA rna_Menu_poll_func;
+
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
@@ -354,7 +364,7 @@ static int menu_poll(const bContext *C, MenuType *pt)
int visible;
RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */
- func= RNA_struct_find_function(&ptr, "poll");
+ func= &rna_Menu_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -370,12 +380,14 @@ static int menu_poll(const bContext *C, MenuType *pt)
static void menu_draw(const bContext *C, Menu *hdr)
{
+ extern FunctionRNA rna_Menu_draw_func;
+
PointerRNA mtr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->ext.srna, hdr, &mtr);
- func= RNA_struct_find_function(&mtr, "draw");
+ func= &rna_Menu_draw_func; /* RNA_struct_find_function(&mtr, "draw"); */
RNA_parameter_list_create(&list, &mtr, func);
RNA_parameter_set_lookup(&list, "context", &C);
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index bf83a6e043c..49e2c8007dc 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -72,7 +72,7 @@ static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointe
WM_main_add_notifier(NC_WINDOW, NULL);
}
-static void rna_userdef_dpi_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_userdef_dpi_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
{
U.widget_unit = (U.dpi * 20 + 36)/72;
WM_main_add_notifier(NC_WINDOW, NULL); /* full redraw */
@@ -813,25 +813,25 @@ static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, short incl_nurb
prop= RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "nurb_uline");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Nurb U-lines", "");
+ RNA_def_property_ui_text(prop, "NURBS U-lines", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "nurb_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "nurb_vline");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Nurb V-lines", "");
+ RNA_def_property_ui_text(prop, "NURBS V-lines", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "nurb_sel_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "nurb_sel_uline");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Nurb active U-lines", "");
+ RNA_def_property_ui_text(prop, "NURBS active U-lines", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "nurb_sel_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "nurb_sel_vline");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Nurb active V-lines", "");
+ RNA_def_property_ui_text(prop, "NURBS active V-lines", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "act_spline", PROP_FLOAT, PROP_COLOR_GAMMA);
@@ -2078,19 +2078,19 @@ static void rna_def_userdef_solidlight(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 3);
RNA_def_property_float_array_default(prop, default_dir);
- RNA_def_property_ui_text(prop, "Direction", "The direction that the OpenGL light is shining");
+ RNA_def_property_ui_text(prop, "Direction", "Direction that the OpenGL light is shining");
RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "col");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Diffuse Color", "The diffuse color of the OpenGL light");
+ RNA_def_property_ui_text(prop, "Diffuse Color", "Diffuse color of the OpenGL light");
RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "spec");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Specular Color", "The color of the lights specular highlight");
+ RNA_def_property_ui_text(prop, "Specular Color", "Color of the light's specular highlight");
RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
}
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index e9df79acd4a..676fe1e092d 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -762,6 +762,8 @@ static void rna_Operator_unregister(struct Main *bmain, StructRNA *type)
static int operator_poll(bContext *C, wmOperatorType *ot)
{
+ extern FunctionRNA rna_Operator_poll_func;
+
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
@@ -769,7 +771,7 @@ static int operator_poll(bContext *C, wmOperatorType *ot)
int visible;
RNA_pointer_create(NULL, ot->ext.srna, NULL, &ptr); /* dummy */
- func= RNA_struct_find_function(&ptr, "poll");
+ func= &rna_Operator_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -785,6 +787,8 @@ static int operator_poll(bContext *C, wmOperatorType *ot)
static int operator_execute(bContext *C, wmOperator *op)
{
+ extern FunctionRNA rna_Operator_execute_func;
+
PointerRNA opr;
ParameterList list;
FunctionRNA *func;
@@ -792,7 +796,7 @@ static int operator_execute(bContext *C, wmOperator *op)
int result;
RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr);
- func= RNA_struct_find_function(&opr, "execute");
+ func= &rna_Operator_execute_func; /* RNA_struct_find_function(&opr, "execute"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -809,6 +813,8 @@ static int operator_execute(bContext *C, wmOperator *op)
/* same as execute() but no return value */
static int operator_check(bContext *C, wmOperator *op)
{
+ extern FunctionRNA rna_Operator_check_func;
+
PointerRNA opr;
ParameterList list;
FunctionRNA *func;
@@ -816,7 +822,7 @@ static int operator_check(bContext *C, wmOperator *op)
int result;
RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr);
- func= RNA_struct_find_function(&opr, "check");
+ func= &rna_Operator_check_func; /* RNA_struct_find_function(&opr, "check"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -832,6 +838,8 @@ static int operator_check(bContext *C, wmOperator *op)
static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
+ extern FunctionRNA rna_Operator_invoke_func;
+
PointerRNA opr;
ParameterList list;
FunctionRNA *func;
@@ -839,7 +847,7 @@ static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event)
int result;
RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr);
- func= RNA_struct_find_function(&opr, "invoke");
+ func= &rna_Operator_invoke_func; /* RNA_struct_find_function(&opr, "invoke"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -857,6 +865,8 @@ static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* same as invoke */
static int operator_modal(bContext *C, wmOperator *op, wmEvent *event)
{
+ extern FunctionRNA rna_Operator_modal_func;
+
PointerRNA opr;
ParameterList list;
FunctionRNA *func;
@@ -864,7 +874,7 @@ static int operator_modal(bContext *C, wmOperator *op, wmEvent *event)
int result;
RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr);
- func= RNA_struct_find_function(&opr, "modal");
+ func= &rna_Operator_modal_func; /* RNA_struct_find_function(&opr, "modal"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -881,12 +891,14 @@ static int operator_modal(bContext *C, wmOperator *op, wmEvent *event)
static void operator_draw(bContext *C, wmOperator *op)
{
+ extern FunctionRNA rna_Operator_draw_func;
+
PointerRNA opr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr);
- func= RNA_struct_find_function(&opr, "draw");
+ func= &rna_Operator_draw_func; /* RNA_struct_find_function(&opr, "draw"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -898,6 +910,8 @@ static void operator_draw(bContext *C, wmOperator *op)
/* same as exec(), but call cancel */
static int operator_cancel(bContext *C, wmOperator *op)
{
+ extern FunctionRNA rna_Operator_cancel_func;
+
PointerRNA opr;
ParameterList list;
FunctionRNA *func;
@@ -905,7 +919,7 @@ static int operator_cancel(bContext *C, wmOperator *op)
int result;
RNA_pointer_create(&CTX_wm_screen(C)->id, op->type->ext.srna, op, &opr);
- func= RNA_struct_find_function(&opr, "cancel");
+ func= &rna_Operator_cancel_func; /* RNA_struct_find_function(&opr, "cancel"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -1689,7 +1703,7 @@ static void rna_def_keyconfig(BlenderRNA *brna)
prop= RNA_def_property(srna, "id", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "id");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "id", "ID of the item");
+ RNA_def_property_ui_text(prop, "ID", "ID of the item");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
prop= RNA_def_property(srna, "any", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index 11ec327c306..62975763874 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -409,7 +409,7 @@ static void rna_def_world_mist(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "mistdist");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
- RNA_def_property_ui_text(prop, "Depth", "The distance over which the mist effect fades in");
+ RNA_def_property_ui_text(prop, "Depth", "Distance over which the mist effect fades in");
RNA_def_property_update(prop, 0, "rna_World_draw_mist_update");
prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
@@ -433,7 +433,7 @@ static void rna_def_world_stars(BlenderRNA *brna)
srna= RNA_def_struct(brna, "WorldStarsSettings", NULL);
RNA_def_struct_sdna(srna, "World");
RNA_def_struct_nested(brna, srna, "World");
- RNA_def_struct_ui_text(srna, "World Stars", "Stars setting for a World data-block");
+ RNA_def_struct_ui_text(srna, "World Stars", "Stars settings for a World data-block");
prop= RNA_def_property(srna, "use_stars", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_STARS);
diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner.py b/source/blender/makesrna/rna_cleanup/rna_cleaner.py
index 5df6e9a86ff..ca610eeb024 100755
--- a/source/blender/makesrna/rna_cleanup/rna_cleaner.py
+++ b/source/blender/makesrna/rna_cleanup/rna_cleaner.py
@@ -8,7 +8,7 @@ Typical line in the input file (elements in [] are optional).
[comment *] ToolSettings.snap_align_rotation -> use_snap_align_rotation: boolean [Align rotation with the snapping target]
Geterate output format from blender run this:
- ./blender.bin --background --python ./release/scripts/modules/rna_info.py 2> source/blender/makesrna/rna_cleanup/out.txt
+ ./blender.bin --background -noaudio --python ./release/scripts/modules/rna_info.py 2> source/blender/makesrna/rna_cleanup/out.txt
"""
diff --git a/source/blender/makesrna/rna_cleanup/rna_update.sh b/source/blender/makesrna/rna_cleanup/rna_update.sh
index a4d686cc482..e3119191cb2 100755
--- a/source/blender/makesrna/rna_cleanup/rna_update.sh
+++ b/source/blender/makesrna/rna_cleanup/rna_update.sh
@@ -1,5 +1,5 @@
cd ../../../../
-./blender.bin --background --python ./release/scripts/modules/rna_info.py 2> source/blender/makesrna/rna_cleanup/out.txt
+./blender.bin --background -noaudio --python ./release/scripts/modules/rna_info.py 2> source/blender/makesrna/rna_cleanup/out.txt
cd ./source/blender/makesrna/rna_cleanup/
./rna_cleaner.py out.txt
./rna_cleaner.py rna_properties.txt
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 757da28e4b5..f2e3a0d016a 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -40,6 +40,7 @@
#include "BLI_math.h"
#include "BLI_edgehash.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_mesh.h"
@@ -183,7 +184,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tsmd->crease_outer = smd->crease_outer;
tsmd->crease_rim = smd->crease_rim;
tsmd->flag = smd->flag;
- strcpy(tsmd->defgrp_name, smd->defgrp_name);
+ BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, sizeof(tsmd->defgrp_name));
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c
index 4dbf4b96b74..6214f39dc0a 100644
--- a/source/blender/nodes/intern/node_common.c
+++ b/source/blender/nodes/intern/node_common.c
@@ -718,7 +718,7 @@ static bNodeSocket *group_verify_socket(bNodeTree *ntree, ListBase *lb, int in_o
if(sock) {
sock->groupsock = gsock;
- strcpy(sock->name, gsock->name);
+ BLI_strncpy(sock->name, gsock->name, sizeof(sock->name));
sock->type= gsock->type;
/* XXX hack: group socket input/output roles are inverted internally,
@@ -903,7 +903,7 @@ static void loop_sync(bNodeTree *ntree, int sync_in_out)
if (mirror->own_index == GET_INT_FROM_POINTER(sock->storage))
break;
/* make sure the name is the same (only for identification by user, no deeper meaning) */
- strcpy(mirror->name, sock->name);
+ BLI_strncpy(mirror->name, sock->name, sizeof(mirror->name));
/* fix the socket order if necessary */
if (mirror != sync) {
BLI_remlink(sync_lb, mirror);
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 1bccc8a24c4..e658532db24 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -184,6 +184,15 @@ void PyC_FileAndNum(const char **filename, int *lineno)
}
}
+void PyC_FileAndNum_Safe(const char **filename, int *lineno)
+{
+ if(!PYC_INTERPRETER_ACTIVE) {
+ return;
+ }
+
+ PyC_FileAndNum(filename, lineno);
+}
+
/* Would be nice if python had this built in */
PyObject *PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...)
{
diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
index 03a8637710e..f38ce209be2 100644
--- a/source/blender/python/generic/py_capi_utils.h
+++ b/source/blender/python/generic/py_capi_utils.h
@@ -36,6 +36,7 @@ PyObject * PyC_ExceptionBuffer(void);
PyObject * PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...);
PyObject * PyC_Err_Format_Prefix(PyObject *exception_type_prefix, const char *format, ...);
void PyC_FileAndNum(const char **filename, int *lineno);
+void PyC_FileAndNum_Safe(const char **filename, int *lineno); /* checks python is running */
int PyC_AsArray(void *array, PyObject *value, const int length, const PyTypeObject *type, const short is_double, const char *error_prefix);
/* follow http://www.python.org/dev/peps/pep-0383/ */
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 19dc0538dba..3db73816025 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -2468,7 +2468,7 @@ static void do_render_composite_fields_blur_3d(Render *re)
ntreeCompositTagAnimated(ntree);
}
- if(ntree && re->r.scemode & R_DOCOMP) {
+ if(ntree && re->scene->use_nodes && re->r.scemode & R_DOCOMP) {
/* checks if there are render-result nodes that need scene */
if((re->r.scemode & R_SINGLE_LAYER)==0)
ntree_render_scenes(re);
diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c
index 7a39342ac8d..a73bf93841d 100644
--- a/source/blender/render/intern/source/renderdatabase.c
+++ b/source/blender/render/intern/source/renderdatabase.c
@@ -481,12 +481,12 @@ void RE_set_customdata_names(ObjectRen *obr, CustomData *data)
layer= &data->layers[i];
if (layer->type == CD_MTFACE) {
- strcpy(obr->mtface[mtfn++], layer->name);
+ BLI_strncpy(obr->mtface[mtfn++], layer->name, sizeof(layer->name));
obr->actmtface= CLAMPIS(layer->active_rnd, 0, numtf);
obr->bakemtface= layer->active;
}
else if (layer->type == CD_MCOL) {
- strcpy(obr->mcol[mcn++], layer->name);
+ BLI_strncpy(obr->mcol[mcn++], layer->name, sizeof(layer->name));
obr->actmcol= CLAMPIS(layer->active_rnd, 0, numcol);
}
}
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index cf6123feaf7..052b9faa8b6 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -343,8 +343,8 @@ typedef struct wmEvent {
short val; /* press, release, scrollvalue */
int x, y; /* mouse pointer position, screen coord */
int mval[2]; /* region mouse position, name convention pre 2.5 :) */
- short unicode; /* future, ghost? */
- char ascii; /* from ghost */
+ char utf8_buf[6]; /* from, ghost if utf8 is enabled for the platform */
+ char ascii; /* from ghost, fallback if utf8 isnt set */
char pad;
/* previous state */
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 33e98007fed..7dcb4cf091f 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2578,6 +2578,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
GHOST_TEventKeyData *kd= customdata;
event.type= convert_key(kd->key);
event.ascii= kd->ascii;
+ strcpy(event.utf8_buf, kd->utf8_buf);
event.val= (type==GHOST_kEventKeyDown)?KM_PRESS:KM_RELEASE;
/* exclude arrow keys, esc, etc from text input */
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index e2935f76999..30682809974 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -105,6 +105,11 @@
static GHash *global_ops_hash= NULL;
+#ifdef WITH_PYTHON_UI_INFO
+# include "DNA_text_types.h"
+# include "BKE_text.h"
+#endif
+
/* ************ operator API, exported ********** */
@@ -3505,6 +3510,79 @@ static void operatortype_ghash_free_cb(wmOperatorType *ot)
MEM_freeN(ot);
}
+#ifdef WITH_PYTHON_UI_INFO
+
+static ScrArea *biggest_text_view(bContext *C)
+{
+ bScreen *sc= CTX_wm_screen(C);
+ ScrArea *sa, *big= NULL;
+ int size, maxsize= 0;
+
+ for(sa= sc->areabase.first; sa; sa= sa->next) {
+ if(sa->spacetype==SPACE_TEXT) {
+ size= sa->winx * sa->winy;
+ if(size > maxsize) {
+ maxsize= size;
+ big= sa;
+ }
+ }
+ }
+ return big;
+}
+
+static int wm_text_edit_exec(bContext *C, wmOperator *op)
+{
+ Main *bmain= CTX_data_main(C);
+ Text *text;
+
+ char filepath[240];
+ int line= RNA_int_get(op->ptr, "line");
+ RNA_string_get(op->ptr, "filepath", filepath);
+
+ for (text=bmain->text.first; text; text=text->id.next) {
+ if (text->name && BLI_path_cmp(text->name, filepath) == 0) {
+ break;
+ }
+ }
+
+ if (text == NULL) {
+ text= add_text(filepath, bmain->name);
+ }
+
+ if (text == NULL) {
+ BKE_reportf(op->reports, RPT_WARNING, "file: '%s' can't be opened", filepath);
+ return OPERATOR_CANCELLED;
+ }
+ else {
+ /* naughty!, find text area to set, not good behavior
+ * but since this is a dev tool lets allow it - campbell */
+ ScrArea *sa= biggest_text_view(C);
+ if(sa) {
+ SpaceText *st= sa->spacedata.first;
+ st->text= text;
+ }
+
+ txt_move_toline(text, line - 1, FALSE);
+ WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text);
+ }
+
+ return OPERATOR_FINISHED;
+}
+
+static void WM_OT_text_edit(wmOperatorType *ot)
+{
+ ot->name= "Edit Text File";
+ ot->idname= "WM_OT_text_edit";
+
+ ot->exec= wm_text_edit_exec;
+
+ RNA_def_string_file_path(ot->srna, "filepath", "", FILE_MAX, "Path", "");
+ RNA_def_int(ot->srna, "line", 0, INT_MIN, INT_MAX, "Line", "", 0, INT_MAX);
+}
+
+#endif /* WITH_PYTHON_UI_INFO */
+
+
/* ******************************************************* */
/* called on initialize WM_exit() */
void wm_operatortype_free(void)
@@ -3548,6 +3626,10 @@ void wm_operatortype_init(void)
WM_operatortype_append(WM_OT_collada_import);
#endif
+#ifdef WITH_PYTHON_UI_INFO
+ WM_operatortype_append(WM_OT_text_edit);
+#endif
+
}
/* circleselect-like modal operators */
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 60dcc9c7599..3e1f5cae43c 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -93,8 +93,8 @@ if(WITH_GAMEENGINE)
add_definitions(-DWITH_GAMEENGINE)
endif()
-if(NOT WITH_SDL)
- add_definitions(-DDISABLE_SDL)
+if(WITH_SDL)
+ add_definitions(-DWITH_SDL)
endif()
if(WITH_BINRELOC)
diff --git a/source/creator/creator.c b/source/creator/creator.c
index f1b9549b925..2aa3b08c05a 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -309,7 +309,7 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data)
#else
printf (" $TMP or $TMPDIR Store temporary files here.\n");
#endif
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
printf (" $SDL_AUDIODRIVER LibSDL audio driver - alsa, esd, dma.\n");
#endif
printf (" $PYTHONHOME Path to the python directory, eg. /usr/lib/python.\n\n");
@@ -1225,7 +1225,7 @@ int main(int argc, const char **argv)
/* this is properly initialized with user defs, but this is default */
BLI_where_is_temp(btempdir, FILE_MAX, 1); /* call after loading the startup.blend so we can read U.tempdir */
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
BLI_setenv("SDL_VIDEODRIVER", "dummy");
#endif
}
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index ce542671425..af4df5035bb 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -360,7 +360,14 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
ketsjiengine->SetCameraOverrideUseOrtho((rv3d->persp == RV3D_ORTHO));
ketsjiengine->SetCameraOverrideProjectionMatrix(MT_CmMatrix4x4(rv3d->winmat));
ketsjiengine->SetCameraOverrideViewMatrix(MT_CmMatrix4x4(rv3d->viewmat));
- ketsjiengine->SetCameraOverrideClipping(v3d->near, v3d->far);
+ if(rv3d->persp == RV3D_ORTHO)
+ {
+ ketsjiengine->SetCameraOverrideClipping(-v3d->far, v3d->far);
+ }
+ else
+ {
+ ketsjiengine->SetCameraOverrideClipping(v3d->near, v3d->far);
+ }
ketsjiengine->SetCameraOverrideLens(v3d->lens);
}
diff --git a/source/gameengine/GameLogic/CMakeLists.txt b/source/gameengine/GameLogic/CMakeLists.txt
index bd417165337..9a57de60517 100644
--- a/source/gameengine/GameLogic/CMakeLists.txt
+++ b/source/gameengine/GameLogic/CMakeLists.txt
@@ -131,8 +131,8 @@ if(WITH_SDL)
list(APPEND INC_SYS
${SDL_INCLUDE_DIR}
)
-else()
- add_definitions(-DDISABLE_SDL)
+
+ add_definitions(-DWITH_SDL)
endif()
blender_add_lib(ge_logic "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
index 48ba09e67d2..0547d97285d 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
+++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
@@ -29,8 +29,8 @@
* \ingroup gamelogic
*/
-#ifndef DISABLE_SDL
-#include <SDL.h>
+#ifdef WITH_SDL
+# include <SDL.h>
#endif
#include <stdio.h>
@@ -57,7 +57,7 @@ SCA_Joystick::SCA_Joystick(short int index)
for(int i=0; i<JOYHAT_MAX; i++)
m_hat_array[i]= 0;
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
m_private = new PrivateData();
#endif
}
@@ -66,7 +66,7 @@ SCA_Joystick::SCA_Joystick(short int index)
SCA_Joystick::~SCA_Joystick()
{
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
delete m_private;
#endif
}
@@ -77,9 +77,9 @@ int SCA_Joystick::m_refCount = 0;
SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex )
{
-#ifdef DISABLE_SDL
+#ifndef WITH_SDL
return NULL;
-#else
+#else /* WITH_SDL */
if (joyindex < 0 || joyindex >= JOYINDEX_MAX) {
echo("Error-invalid joystick index: " << joyindex);
return NULL;
@@ -107,14 +107,14 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex )
m_refCount++;
}
return m_instance[joyindex];
-#endif
+#endif /* WITH_SDL */
}
void SCA_Joystick::ReleaseInstance()
{
if (--m_refCount == 0)
{
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
int i;
for (i=0; i<JOYINDEX_MAX; i++) {
if (m_instance[i]) {
@@ -125,7 +125,7 @@ void SCA_Joystick::ReleaseInstance()
}
SDL_QuitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO);
-#endif
+#endif /* WITH_SDL */
}
}
@@ -163,7 +163,7 @@ bool SCA_Joystick::aAxisIsPositive(int axis_single)
bool SCA_Joystick::aAnyButtonPressIsPositive(void)
{
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
/* this is needed for the "all events" option
* so we know if there are no buttons pressed */
for (int i=0; i<m_buttonmax; i++)
@@ -175,7 +175,7 @@ bool SCA_Joystick::aAnyButtonPressIsPositive(void)
bool SCA_Joystick::aButtonPressIsPositive(int button)
{
-#ifdef DISABLE_SDL
+#ifndef WITH_SDL
return false;
#else
bool result;
@@ -187,7 +187,7 @@ bool SCA_Joystick::aButtonPressIsPositive(int button)
bool SCA_Joystick::aButtonReleaseIsPositive(int button)
{
-#ifdef DISABLE_SDL
+#ifndef WITH_SDL
return false;
#else
bool result;
@@ -221,11 +221,11 @@ int SCA_Joystick::GetNumberOfHats()
bool SCA_Joystick::CreateJoystickDevice(void)
{
-#ifdef DISABLE_SDL
+#ifndef WITH_SDL
m_isinit = true;
m_axismax = m_buttonmax = m_hatmax = 0;
return false;
-#else
+#else /* WITH_SDL */
if(m_isinit == false){
if (m_joyindex>=m_joynum) {
// don't print a message, because this is done anyway
@@ -257,13 +257,13 @@ bool SCA_Joystick::CreateJoystickDevice(void)
}
return true;
-#endif
+#endif /* WITH_SDL */
}
void SCA_Joystick::DestroyJoystickDevice(void)
{
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
if (m_isinit){
if(SDL_JoystickOpened(m_joyindex)){
echo("Closing-joystick " << m_joyindex);
@@ -271,12 +271,12 @@ void SCA_Joystick::DestroyJoystickDevice(void)
}
m_isinit = false;
}
-#endif
+#endif /* WITH_SDL */
}
int SCA_Joystick::Connected(void)
{
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
if (m_isinit && SDL_JoystickOpened(m_joyindex))
return 1;
#endif
@@ -285,7 +285,7 @@ int SCA_Joystick::Connected(void)
int SCA_Joystick::pGetAxis(int axisnum, int udlr)
{
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
return m_axis_array[(axisnum*2)+udlr];
#endif
return 0;
@@ -293,7 +293,7 @@ int SCA_Joystick::pGetAxis(int axisnum, int udlr)
int SCA_Joystick::pAxisTest(int axisnum)
{
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
short i1= m_axis_array[(axisnum*2)];
short i2= m_axis_array[(axisnum*2)+1];
@@ -304,7 +304,7 @@ int SCA_Joystick::pAxisTest(int axisnum)
if (i2 < 0) i2 = -i2;
if (i1 <i2) return i2;
else return i1;
-#else
+#else /* WITH_SDL */
return 0;
-#endif
+#endif /* WITH_SDL */
}
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
index f371955ffc6..4e3e3ef656d 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
+++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
@@ -33,8 +33,8 @@
#define _SCA_JOYSTICK_H_
#include "SCA_JoystickDefines.h"
-#ifndef DISABLE_SDL
-#include "SDL.h"
+#ifdef WITH_SDL
+# include "SDL.h"
#endif
/**
@@ -52,7 +52,7 @@ class SCA_Joystick
static int m_refCount;
class PrivateData;
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
PrivateData *m_private;
#endif
int m_joyindex;
@@ -89,7 +89,7 @@ class SCA_Joystick
bool m_istrig_button;
bool m_istrig_hat;
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
/**
* event callbacks
*/
@@ -102,7 +102,7 @@ class SCA_Joystick
void OnBallMotion(SDL_Event *sdl_event){}
#endif
-#endif
+#endif /* WITH_SDL */
/**
* Open the joystick
*/
@@ -193,7 +193,7 @@ public:
*/
int Connected(void);
};
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
void Joystick_HandleEvents( void );
#endif
diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
index b6e313aa6c2..e1ab364ae67 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
+++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
@@ -29,15 +29,15 @@
* \ingroup gamelogic
*/
-#ifndef DISABLE_SDL
-#include <SDL.h>
+#ifdef WITH_SDL
+# include <SDL.h>
#endif
#include "SCA_Joystick.h"
#include "SCA_JoystickPrivate.h"
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
void SCA_Joystick::OnAxisMotion(SDL_Event* sdl_event)
{
if(sdl_event->jaxis.axis >= JOYAXIS_MAX)
@@ -125,4 +125,4 @@ void SCA_Joystick::HandleEvents(void)
}
}
}
-#endif
+#endif /* WITH_SDL */
diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h b/source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h
index 02dd8145bb7..472a7353190 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h
+++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h
@@ -33,7 +33,7 @@
#define __SCA_JOYSTICKPRIVATE_H__
#include "SCA_Joystick.h"
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
class SCA_Joystick::PrivateData
{
public:
@@ -47,6 +47,6 @@ public:
{
}
};
-#endif
+#endif /* WITH_SDL */
#endif
diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.cpp b/source/gameengine/GameLogic/SCA_JoystickManager.cpp
index b61e4f4edca..2942384055b 100644
--- a/source/gameengine/GameLogic/SCA_JoystickManager.cpp
+++ b/source/gameengine/GameLogic/SCA_JoystickManager.cpp
@@ -65,7 +65,7 @@ void SCA_JoystickManager::NextFrame(double curtime,double deltatime)
}
else {
;
-#ifndef DISABLE_SDL
+#ifdef WITH_SDL
SCA_Joystick::HandleEvents(); /* Handle all SDL Joystick events */
#endif
SG_DList::iterator<SCA_JoystickSensor> it(m_sensors);
diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript
index d6323882267..62bdbc29544 100644
--- a/source/gameengine/GameLogic/SConscript
+++ b/source/gameengine/GameLogic/SConscript
@@ -10,9 +10,8 @@ incs += ' #/source/gameengine/Rasterizer #/source/gameengine/SceneGraph'
defs = []
if env['WITH_BF_SDL']:
+ defs.append('WITH_SDL')
incs += ' ' + env['BF_SDL_INC']
-else:
- defs.append('DISABLE_SDL')
if env['WITH_BF_PYTHON']:
incs += ' ' + env['BF_PYTHON_INC']
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index f5bd3a91c26..ea17b9adcfd 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -309,7 +309,7 @@ static void get_filename(int argc, char **argv, char *filename)
#endif // !_APPLE
}
-static BlendFileData *load_game_data(char *progname, char *filename = NULL, char *relativename = NULL)
+static BlendFileData *load_game_data(const char *progname, char *filename = NULL, char *relativename = NULL)
{
ReportList reports;
BlendFileData *bfd = NULL;
@@ -321,7 +321,7 @@ static BlendFileData *load_game_data(char *progname, char *filename = NULL, char
bfd= BLO_read_runtime(progname, &reports);
if (bfd) {
bfd->type= BLENFILETYPE_RUNTIME;
- strcpy(bfd->main->name, progname);
+ BLI_strncpy(bfd->main->name, progname, sizeof(bfd->main->name));
}
} else {
bfd= BLO_read_from_file(progname, &reports);
@@ -766,7 +766,7 @@ int main(int argc, char** argv)
char basedpath[240];
// base the actuator filename relative to the last file
- strcpy(basedpath, exitstring.Ptr());
+ BLI_strncpy(basedpath, exitstring.Ptr(), sizeof(basedpath));
BLI_path_abs(basedpath, pathname);
bfd = load_game_data(basedpath);
diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp
index 08794042e37..9e8f53ad219 100644
--- a/source/gameengine/Ketsji/BL_Action.cpp
+++ b/source/gameengine/Ketsji/BL_Action.cpp
@@ -361,9 +361,6 @@ void BL_Action::Update(float curtime)
break;
}
-
- if (!m_done)
- InitIPO();
}
if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_ARMATURE)
@@ -446,8 +443,6 @@ void BL_Action::Update(float curtime)
obj->SetActiveAction(NULL, 0, curtime);
}
-
- InitIPO();
m_obj->UpdateIPO(m_localtime, m_ipo_flags & ACT_IPOFLAG_CHILD);
}
}
diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt
index 9d8b1781869..329ac890cd2 100644
--- a/source/gameengine/Ketsji/CMakeLists.txt
+++ b/source/gameengine/Ketsji/CMakeLists.txt
@@ -225,8 +225,7 @@ if(WITH_SDL)
list(APPEND INC_SYS
${SDL_INCLUDE_DIR}
)
-else()
- add_definitions(-DDISABLE_SDL)
+ add_definitions(-DWITH_SDL)
endif()
if(WITH_CODEC_FFMPEG)
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index 6d07d4c6a66..b4bd460ddbc 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -1401,8 +1401,14 @@ void KX_KetsjiEngine::PostProcessScene(KX_Scene* scene)
KX_Camera* activecam = NULL;
RAS_CameraData camdata = RAS_CameraData();
- if (override_camera) camdata.m_lens = m_overrideCamLens;
-
+ if (override_camera)
+ {
+ camdata.m_lens = m_overrideCamLens;
+ camdata.m_clipstart = m_overrideCamNear;
+ camdata.m_clipend = m_overrideCamFar;
+
+ camdata.m_perspective= !m_overrideCamUseOrtho;
+ }
activecam = new KX_Camera(scene,KX_Scene::m_callbacks,camdata);
activecam->SetName("__default__cam__");
diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
index 34f5c26415d..e1978263a12 100644
--- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
+++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
@@ -240,29 +240,23 @@ bool KX_MouseFocusSensor::ParentObjectHasFocusCamera(KX_Camera *cam)
/* build the from and to point in normalized device coordinates
- * Looks like normailized device coordinates are [-1,1] in x [-1,1] in y
- * [0,-1] in z
+ * Normalized device coordinates are [-1,1] in x, y, z
*
* The actual z coordinates used don't have to be exact just infront and
* behind of the near and far clip planes.
*/
frompoint.setValue( (2 * (m_x-x_lb) / width) - 1.0,
1.0 - (2 * (m_y_inv - y_lb) / height),
- /*cam->GetCameraData()->m_perspective ? 0.0:cdata->m_clipstart,*/ /* real clipstart is scaled in ortho for some reason, zero is ok */
- 0.0, /* nearclip, see above comments */
+ -1.0,
1.0 );
topoint.setValue( (2 * (m_x-x_lb) / width) - 1.0,
1.0 - (2 * (m_y_inv-y_lb) / height),
- cam->GetCameraData()->m_perspective ? 1.0:cam->GetCameraData()->m_clipend, /* farclip, see above comments */
+ 1.0,
1.0 );
-
- /* camera to world */
- MT_Transform wcs_camcs_tranform = cam->GetWorldToCamera();
- MT_Transform cams_wcs_transform;
- cams_wcs_transform.invert(wcs_camcs_tranform);
- MT_Matrix4x4 camcs_wcs_matrix = MT_Matrix4x4(cams_wcs_transform);
+ /* camera to world */
+ MT_Matrix4x4 camcs_wcs_matrix = MT_Matrix4x4(cam->GetCameraToWorld());
/* badly defined, the first time round.... I wonder why... I might
* want to guard against floating point errors here.*/
@@ -272,6 +266,8 @@ bool KX_MouseFocusSensor::ParentObjectHasFocusCamera(KX_Camera *cam)
/* shoot-points: clip to cam to wcs . win to clip was already done.*/
frompoint = clip_camcs_matrix * frompoint;
topoint = clip_camcs_matrix * topoint;
+ /* clipstart = - (frompoint[2] / frompoint[3])
+ * clipend = - (topoint[2] / topoint[3]) */
frompoint = camcs_wcs_matrix * frompoint;
topoint = camcs_wcs_matrix * topoint;
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 40917a67c2f..e86831b9323 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -1816,7 +1816,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
/* Yet another gotcha in the py api
* Cant run PySys_SetArgv more then once because this adds the
* binary dir to the sys.path each time.
- * Id have thaught python being totally restarted would make this ok but
+ * Id have thought python being totally restarted would make this ok but
* somehow it remembers the sys.path - Campbell
*/
static bool first_time = true;
diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript
index 9b453ed76d5..064f09df9f3 100644
--- a/source/gameengine/Ketsji/SConscript
+++ b/source/gameengine/Ketsji/SConscript
@@ -27,8 +27,7 @@ incs += ' ' + env['BF_OPENGL_INC']
if env['WITH_BF_SDL']:
incs += ' ' + env['BF_SDL_INC']
-else:
- defs.append('DISABLE_SDL')
+ defs.append('WITH_SDL')
if env['WITH_BF_PYTHON']:
incs += ' ' + env['BF_PYTHON_INC']
diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.cpp b/source/gameengine/Rasterizer/RAS_FramingManager.cpp
index 31aba32c683..96c88eec355 100644
--- a/source/gameengine/Rasterizer/RAS_FramingManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_FramingManager.cpp
@@ -101,7 +101,7 @@ ComputeDefaultOrtho(
frustum.x1 = -frustum.x2;
frustum.y2 = sizeY;
frustum.y1 = -frustum.y2;
- frustum.camnear = -camfar;
+ frustum.camnear = camnear;
frustum.camfar = camfar;
}
diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt
index c5a6831a4cb..64cc79de879 100644
--- a/source/tests/CMakeLists.txt
+++ b/source/tests/CMakeLists.txt
@@ -43,7 +43,7 @@ else()
endif()
# for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no
-set(TEST_BLENDER_EXE ${TEST_BLENDER_EXE} --background --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)
+set(TEST_BLENDER_EXE ${TEST_BLENDER_EXE} --background -noaudio --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)
# ------------------------------------------------------------------------------
diff --git a/source/tests/rna_info_dump.py b/source/tests/rna_info_dump.py
index 62c1248d733..293c02dfb84 100644
--- a/source/tests/rna_info_dump.py
+++ b/source/tests/rna_info_dump.py
@@ -19,7 +19,7 @@
# <pep8 compliant>
# Used for generating API diff's between releases
-# ./blender.bin --background --python release/test/rna_info_dump.py
+# ./blender.bin --background -noaudio --python release/test/rna_info_dump.py
import bpy