Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Tue, 18 Jul 2017 03:09:36 +0000 (13:09 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 18 Jul 2017 03:09:36 +0000 (13:09 +1000)
build_files/buildbot/slave_compile.py
doc/python_api/sphinx_doc_gen.py
source/blender/collada/AnimationExporter.cpp
source/blender/editors/object/object_transform.c
source/blender/editors/transform/transform_snap_object.c
source/blender/ikplugin/intern/iksolver_plugin.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/python/intern/bpy_props.c
source/blender/windowmanager/intern/wm_window.c

index 0e264a752d51b71ba45ebb0d072955b48e3a6510..d99e66f78717be19a806b27148f5214890351a6d 100644 (file)
@@ -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))
 
index af1c2be434a615033d1fa2786ab6b97ac32af188..7b3d05e5a6e5ea9e426f91de98449e0a9fa53edf 100644 (file)
@@ -1726,9 +1726,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 <blender_manual:advanced_scripting_addon_tutorial>`\n")
-        fw("\n")
 
     fw(title_string("Application Modules", "=", double=True))
     fw(".. toctree::\n")
index 707aaea0b65fbf347a667b919c74c93bd748ec55..881662bd0b89ee405a719a8d7ad226945e0cbf3d 100644 (file)
@@ -530,7 +530,7 @@ void AnimationExporter::dae_baked_animation(std::vector<float> &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();
index 542b98d771f3305095e694637c0b644fb89f796a..75f6df3fb87a4b499486a351c98ed94d441d7a90 100644 (file)
@@ -924,8 +924,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;
index bdefd169f225679656d2663fb6551be744244479..96f51b99158442878663d7282d0408bc72cd6f21 100644 (file)
@@ -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)) {
index 6ea311b2c7bce4d54fe0d65c3ac449bd20365549..f837789914e0653c9eabc4ec9ea9d75248826953 100644 (file)
@@ -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);
index af77d037b69a74f87137f4c226db2766187fa9ca..5c445ceca198ca85f77cf62390647ac3340db6de 100644 (file)
@@ -3919,12 +3919,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");
index c7787ba9682981eb422a2abae50b25cfa54df119..362c0281b3635ce631f6307f260b7166f6322bd8 100644 (file)
@@ -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"
index 8068b048d1027b647f583859355f8d643eb6b658..595ccc9458400faef6956be65a4bc30482b00fd4 100644 (file)
@@ -418,6 +418,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) {