From d0aa62091272a6d42c91005b0fe12e7ce28d6529 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 17 Jul 2017 09:32:19 +0200 Subject: [PATCH 1/9] Buildbot: Switch to GCC-7 for Linux build slaves This is GCC version was used for Testbuild1 and Testbuild2. --- build_files/buildbot/slave_compile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_files/buildbot/slave_compile.py b/build_files/buildbot/slave_compile.py index 0e264a752d5..d99e66f7871 100644 --- a/build_files/buildbot/slave_compile.py +++ b/build_files/buildbot/slave_compile.py @@ -112,8 +112,8 @@ if 'cmake' in builder: chroot_name = 'buildbot_' + deb_name + '_i686' cuda_chroot_name = 'buildbot_' + deb_name + '_x86_64' targets = ['player', 'blender', 'cuda'] - cmake_extra_options.extend(["-DCMAKE_C_COMPILER=/usr/bin/gcc-6", - "-DCMAKE_CXX_COMPILER=/usr/bin/g++-6"]) + cmake_extra_options.extend(["-DCMAKE_C_COMPILER=/usr/bin/gcc-7", + "-DCMAKE_CXX_COMPILER=/usr/bin/g++-7"]) cmake_options.append("-C" + os.path.join(blender_dir, cmake_config_file)) From d4246476d0da11ba8da17806f5235530d328ad0f Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 17 Jul 2017 11:36:27 +0200 Subject: [PATCH 2/9] Py API doc generation: remove reference to "Blender/Python Add-on Tutorial" That one has been moved to wiki! --- doc/python_api/sphinx_doc_gen.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 098e2736ed1..7ad3bab1557 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -1720,9 +1720,6 @@ def write_rst_contents(basepath): for info, info_desc in INFO_DOCS: fw(" %s <%s>\n\n" % (info_desc, info)) fw("\n") - fw("- :ref:`Blender/Python Add-on Tutorial: a step by step guide on") - fw(" how to write an add-on from scratch `\n") - fw("\n") fw(title_string("Application Modules", "=", double=True)) fw(".. toctree::\n") From 06505c5264539a255620c9c8898c5a879555b10e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 17 Jul 2017 12:56:12 +0200 Subject: [PATCH 3/9] Fix T39925: Set Origin to Geometry on a new text object moves the origin away from the object No need to take into account font size here... --- source/blender/editors/object/object_transform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 4d7d7df0d2f..47a3f79b0b4 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -923,8 +923,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) cent[2] = 0.0f; - cu->xof = cu->xof - (cent[0] / cu->fsize); - cu->yof = cu->yof - (cent[1] / cu->fsize); + cu->xof = cu->xof - cent[0]; + cu->yof = cu->yof - cent[1]; tot_change++; cu->id.tag |= LIB_TAG_DOIT; From 9feeb14e916be5216f06e14e14f3a6f9309286e8 Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Mon, 17 Jul 2017 16:39:33 +0200 Subject: [PATCH 4/9] fix T52065: Joint ID was generated wrong for bone animation exports --- source/blender/collada/AnimationExporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 3bff20e846b..b3d512204be 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -530,7 +530,7 @@ void AnimationExporter::dae_baked_animation(std::vector &fra, Object *ob_ addSampler(sampler); - std::string target = translate_id(bone_name) + "/transform"; + std::string target = get_joint_id(bone, ob_arm) + "/transform"; addChannel(COLLADABU::URI(empty, sampler_id), target); closeAnimation(); From f05f2f0336025f00a299ec930151a155d55c6ab3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 5 Jul 2017 23:15:12 +0200 Subject: [PATCH 5/9] Fix T51971: IK non-uniform scale regression. This is a different fix for the issue from D2088, preserving backwards compatibility for IK stretching. The main problem with this patch is that this new behavior has been there for a year, so it may break rigs created since then which rely on the new IK stretch behavior. Test file for various cases: https://developer.blender.org/diffusion/BL/browse/trunk/lib/tests/animation/IK.blend Reviewers: campbellbarton Subscribers: maverick, pkrime Differential Revision: https://developer.blender.org/D2743 --- .../blender/ikplugin/intern/iksolver_plugin.c | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c index 6ea311b2c7b..f837789914e 100644 --- a/source/blender/ikplugin/intern/iksolver_plugin.c +++ b/source/blender/ikplugin/intern/iksolver_plugin.c @@ -217,9 +217,27 @@ static void where_is_ik_bone(bPoseChannel *pchan, float ik_mat[3][3]) // nr = copy_m4_m3(ikmat, ik_mat); if (pchan->parent) - mul_m4_series(pchan->pose_mat, pchan->parent->pose_mat, pchan->chan_mat, ikmat); + mul_m4_m4m4(pchan->pose_mat, pchan->parent->pose_mat, pchan->chan_mat); else - mul_m4_m4m4(pchan->pose_mat, pchan->chan_mat, ikmat); + copy_m4_m4(pchan->pose_mat, pchan->chan_mat); + +#ifdef USE_NONUNIFORM_SCALE + /* apply IK mat, but as if the bones have uniform scale since the IK solver + * is not aware of non-uniform scale */ + float scale[3]; + mat4_to_size(scale, pchan->pose_mat); + normalize_v3_length(pchan->pose_mat[0], scale[1]); + normalize_v3_length(pchan->pose_mat[2], scale[1]); +#endif + + mul_m4_m4m4(pchan->pose_mat, pchan->pose_mat, ikmat); + +#ifdef USE_NONUNIFORM_SCALE + float ik_scale[3]; + mat3_to_size(ik_scale, ik_mat); + normalize_v3_length(pchan->pose_mat[0], scale[0] * ik_scale[0]); + normalize_v3_length(pchan->pose_mat[2], scale[2] * ik_scale[2]); +#endif /* calculate head */ copy_v3_v3(pchan->pose_head, pchan->pose_mat[3]); @@ -308,6 +326,10 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) /* change length based on bone size */ length = bone->length * len_v3(R_bonemat[1]); + /* basis must be pure rotation */ + normalize_m3(R_bonemat); + normalize_m3(R_parmat); + /* compute rest basis and its inverse */ copy_m3_m3(rest_basis, bone->bone_mat); transpose_m3_m3(irest_basis, bone->bone_mat); @@ -317,11 +339,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) mul_m3_m3m3(full_basis, iR_parmat, R_bonemat); mul_m3_m3m3(basis, irest_basis, full_basis); - /* basis must be pure rotation */ - normalize_m3(basis); - /* transform offset into local bone space */ - normalize_m3(iR_parmat); mul_m3_v3(iR_parmat, start); IK_SetTransform(seg, start, rest_basis, basis, length); @@ -545,18 +563,6 @@ void iksolver_execute_tree(struct Scene *scene, Object *ob, bPoseChannel *pchan tree->pchan[a]->flag |= POSE_CHAIN; } -#ifdef USE_NONUNIFORM_SCALE - float (*pchan_scale_data)[3] = MEM_mallocN(sizeof(float[3]) * tree->totchannel, __func__); - - for (a = 0; a < tree->totchannel; a++) { - mat4_to_size(pchan_scale_data[a], tree->pchan[a]->pose_mat); - - /* make uniform at y scale since this controls the length */ - normalize_v3_length(tree->pchan[a]->pose_mat[0], pchan_scale_data[a][1]); - normalize_v3_length(tree->pchan[a]->pose_mat[2], pchan_scale_data[a][1]); - } -#endif - /* 5. execute the IK solver */ execute_posetree(scene, ob, tree); @@ -571,14 +577,6 @@ void iksolver_execute_tree(struct Scene *scene, Object *ob, bPoseChannel *pchan where_is_ik_bone(tree->pchan[a], tree->basis_change[a]); } -#ifdef USE_NONUNIFORM_SCALE - for (a = 0; a < tree->totchannel; a++) { - normalize_v3_length(tree->pchan[a]->pose_mat[0], pchan_scale_data[a][0]); - normalize_v3_length(tree->pchan[a]->pose_mat[2], pchan_scale_data[a][2]); - } - MEM_freeN(pchan_scale_data); -#endif - /* 7. and free */ BLI_remlink(&pchan_root->iktree, tree); free_posetree(tree); From d268cad06a5207d63ff10026eeb09fe450282a01 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 17 Jul 2017 13:56:51 +0200 Subject: [PATCH 6/9] Fix T52090: clarify meaning of EnumProperty number when using ENUM_FLAG. --- source/blender/python/intern/bpy_props.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index c7787ba9682..362c0281b36 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -2697,7 +2697,8 @@ PyDoc_STRVAR(BPy_EnumProperty_doc, " :icon: An icon string identifier or integer icon value\n" " (e.g. returned by :class:`bpy.types.UILayout.icon`)\n" " :number: Unique value used as the identifier for this item (stored in file data).\n" -" Use when the identifier may need to change.\n" +" Use when the identifier may need to change. If the *ENUM_FLAG* option is used,\n" +" the values are bitmasks and should be powers of two.\n" "\n" " When an item only contains 4 items they define ``(identifier, name, description, number)``.\n" "\n" From 9bbb197d146d87c053d39a0dfdd9db4cffc53c61 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 17 Jul 2017 14:10:57 +0200 Subject: [PATCH 7/9] Work around small DPI resulting in blurry fonts, clamping auto DPI to minimum 96. Since we added auto DPI on Linux, on some systems the UI draws smaller than before due to the monitor reporting DPI values like 88. Blender font drawing gives quite blurry results for such slightly smaller DPI, apparently because the builtin font isn't really designed for such small font sizes. As a workaround this clamps the auto DPI to minimum 96, since the main case we are interested in supporting is high DPI displays anyway. Differential Revision: https://developer.blender.org/D2740 --- source/blender/makesrna/intern/rna_userdef.c | 10 ++++++++-- source/blender/windowmanager/intern/wm_window.c | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index c0f2dbd0706..224efbbde7a 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3926,12 +3926,18 @@ static void rna_def_userdef_system(BlenderRNA *brna) prop = RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display"); + RNA_def_property_ui_text(prop, "DPI", + "DPI for addons to use when drawing custom user interface elements. Controlled by " + "operating system settings and Blender UI scale, with a reference value of 72 DPI. " + "Note that since this value includes a user defined scale, it is not always the " + "actual monitor DPI."); prop = RNA_def_property(srna, "pixel_size", PROP_FLOAT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_sdna(prop, NULL, "pixelsize"); - RNA_def_property_ui_text(prop, "Pixel Size", ""); + RNA_def_property_ui_text(prop, "Pixel Size", + "Suggested line thickness and point size in pixels, for addons drawing custom user " + "interface elements. Controlled by operating system settings and Blender UI scale."); prop = RNA_def_property(srna, "font_path_ui", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "font_path_ui"); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 8afeb8e7b3d..e7a1643a1ff 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -379,6 +379,11 @@ void WM_window_set_dpi(wmWindow *win) { int auto_dpi = GHOST_GetDPIHint(win->ghostwin); + /* Clamp auto DPI to 96, since our font/interface drawing does not work well + * with lower sizes. The main case we are interested in supporting is higher + * DPI. If a smaller UI is desired it is still possible to adjust UI scale. */ + auto_dpi = MAX2(auto_dpi, 96); + /* Lazily init UI scale size, preserving backwards compatibility by * computing UI scale from ratio of previous DPI and auto DPI */ if (U.ui_scale == 0) { From 16fc2ad28ef5918ce22426d21f1d9fe6be4b23bd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Jul 2017 12:10:23 +1000 Subject: [PATCH 8/9] Transform: avoid possible uninitialized var --- source/blender/editors/transform/transform_snap_object.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index 7a0790a1be2..9e94b2835d5 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -570,8 +570,7 @@ static bool raycastEditMesh( } SnapObjectData_EditMesh *sod = NULL; - - BVHTreeFromEditMesh *treedata; + BVHTreeFromEditMesh *treedata = NULL; void **sod_p; if (BLI_ghash_ensure_p(sctx->cache.object_map, ob, &sod_p)) { @@ -1840,8 +1839,7 @@ static bool snapEditMesh( float local_scale = normalize_v3(ray_normal_local); SnapObjectData_EditMesh *sod = NULL; - - BVHTreeFromEditMesh *treedata; + BVHTreeFromEditMesh *treedata = NULL; void **sod_p; if (BLI_ghash_ensure_p(sctx->cache.object_map, ob, &sod_p)) { From 66383ea206d882fd8737c8e8da5355095e614bc8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Jul 2017 12:12:40 +1000 Subject: [PATCH 9/9] Cleanup: quiet picky warnings --- source/blender/makesrna/intern/rna_userdef.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 224efbbde7a..7a978c35810 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3930,14 +3930,14 @@ static void rna_def_userdef_system(BlenderRNA *brna) "DPI for addons to use when drawing custom user interface elements. Controlled by " "operating system settings and Blender UI scale, with a reference value of 72 DPI. " "Note that since this value includes a user defined scale, it is not always the " - "actual monitor DPI."); + "actual monitor DPI"); prop = RNA_def_property(srna, "pixel_size", PROP_FLOAT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_sdna(prop, NULL, "pixelsize"); RNA_def_property_ui_text(prop, "Pixel Size", "Suggested line thickness and point size in pixels, for addons drawing custom user " - "interface elements. Controlled by operating system settings and Blender UI scale."); + "interface elements. Controlled by operating system settings and Blender UI scale"); prop = RNA_def_property(srna, "font_path_ui", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "font_path_ui");