Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Mon, 17 Jul 2017 03:21:05 +0000 (13:21 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 17 Jul 2017 03:21:05 +0000 (13:21 +1000)
doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst
doc/python_api/sphinx_doc_gen.py
source/blender/blenlib/intern/noise.c
source/blender/bmesh/operators/bmo_primitive.c
source/blender/editors/screen/screen_ops.c
source/blender/python/generic/bpy_internal_import.c
source/blender/python/generic/py_capi_utils.c
source/blender/python/intern/bpy_interface.c

index d08a761ed959080b4708a46e8d78fccf68083bb8..4bb3d273cb91b4c0aba0b030d7cde53a3127f553 100644 (file)
@@ -59,7 +59,7 @@ base class --- :class:`SCA_IActuator`
 
    .. attribute:: mode
 
-      The operation mode of the actuator. Can be one of :ref:`these constants<shape-action-actuator>`.
+      The operation mode of the actuator. Can be one of :ref:`these constants<action-actuator>`.
 
       :type: integer
 
@@ -68,5 +68,3 @@ base class --- :class:`SCA_IActuator`
       The name of the property that is set to the current frame number.
 
       :type: string
-
-
index b3aebcf618828cd3f1d1bda2773ec7c69596bb55..af1c2be434a615033d1fa2786ab6b97ac32af188 100644 (file)
@@ -1645,6 +1645,11 @@ def write_sphinx_conf_py(basepath):
     fw("version = '%s - API'\n" % BLENDER_VERSION_DOTS)
     fw("release = '%s - API'\n" % BLENDER_VERSION_DOTS)
 
+    # Quiet file not in table-of-contents warnings.
+    fw("exclude_patterns = [\n")
+    fw("    'include__bmesh.rst',\n")
+    fw("]\n\n")
+
     if ARGS.sphinx_theme != 'default':
         fw("html_theme = '%s'\n" % ARGS.sphinx_theme)
 
@@ -1665,6 +1670,24 @@ def write_sphinx_conf_py(basepath):
     fw("}\n\n")
 
     fw("latex_documents = [ ('contents', 'contents.tex', 'Blender Index', 'Blender Foundation', 'manual'), ]\n")
+
+    # Workaround for useless links leading to compile errors
+    # See https://github.com/sphinx-doc/sphinx/issues/3866
+    fw(r"""
+from sphinx.domains.python import PythonDomain
+
+class PatchedPythonDomain(PythonDomain):
+    def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
+        if 'refspecific' in node:
+            del node['refspecific']
+        return super(PatchedPythonDomain, self).resolve_xref(
+            env, fromdocname, builder, typ, target, node, contnode)
+
+def setup(sphinx):
+    sphinx.override_domain(PatchedPythonDomain)
+""")
+    # end workaround
+
     file.close()
 
 
index 347640aae0d0bce27a9f5f4f5ea54697b0bece08..86c24307ae2ff21e5b45814649e7f3a4a4b30849 100644 (file)
@@ -1395,9 +1395,9 @@ static float voronoi_CrS(float x, float y, float z)
 static float cellNoiseU(float x, float y, float z)
 {
        /* avoid precision issues on unit coordinates */
-       x = (x + 0.000001f)*0.999999f;
-       y = (y + 0.000001f)*0.999999f;
-       z = (z + 0.000001f)*0.999999f;
+       x = (x + 0.000001f)*1.00001f;
+       y = (y + 0.000001f)*1.00001f;
+       z = (z + 0.000001f)*1.00001f;
 
        int xi = (int)(floor(x));
        int yi = (int)(floor(y));
@@ -1417,9 +1417,9 @@ float cellNoise(float x, float y, float z)
 void cellNoiseV(float x, float y, float z, float ca[3])
 {
        /* avoid precision issues on unit coordinates */
-       x = (x + 0.000001f)*0.999999f;
-       y = (y + 0.000001f)*0.999999f;
-       z = (z + 0.000001f)*0.999999f;
+       x = (x + 0.000001f)*1.00001f;
+       y = (y + 0.000001f)*1.00001f;
+       z = (z + 0.000001f)*1.00001f;
 
        int xi = (int)(floor(x));
        int yi = (int)(floor(y));
index cca0f7387cd35ee34ce9ee80ccc289f78b119d11..d8f83d786b4612e477bc9b1592cd21dba008170e 100644 (file)
@@ -839,7 +839,7 @@ void BM_mesh_calc_uvs_grid(
        const float dx = 1.0f / (float)(x_segments - 1);
        const float dy = 1.0f / (float)(y_segments - 1);
        float x = 0.0f;
-       float y = 0.0f;
+       float y = dy;
 
        int loop_index;
 
@@ -854,16 +854,16 @@ void BM_mesh_calc_uvs_grid(
 
                        switch (loop_index) {
                                case 0:
-                                       x += dx;
+                                       y -= dy;
                                        break;
                                case 1:
-                                       y += dy;
+                                       x += dx;
                                        break;
                                case 2:
-                                       x -= dx;
+                                       y += dy;
                                        break;
                                case 3:
-                                       y -= dy;
+                                       x -= dx;
                                        break;
                                default:
                                        break;
index b8fa16117a992a38d6111c95bcb9bfd9ee6857e4..326421cf166fc45e9051109dd1b6a9f0111c93ca 100644 (file)
@@ -2274,25 +2274,28 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
        BLI_dlrbTree_linkedlist_sync(&keys);
        
        /* find matching keyframe in the right direction */
-       do {
-               if (next)
-                       ak = (ActKeyColumn *)BLI_dlrbTree_search_next(&keys, compare_ak_cfraPtr, &cfra);
-               else
-                       ak = (ActKeyColumn *)BLI_dlrbTree_search_prev(&keys, compare_ak_cfraPtr, &cfra);
-               
-               if (ak) {
-                       if (CFRA != (int)ak->cfra) {
-                               /* this changes the frame, so set the frame and we're done */
-                               CFRA = (int)ak->cfra;
-                               done = true;
+       if (next)
+               ak = (ActKeyColumn *)BLI_dlrbTree_search_next(&keys, compare_ak_cfraPtr, &cfra);
+       else
+               ak = (ActKeyColumn *)BLI_dlrbTree_search_prev(&keys, compare_ak_cfraPtr, &cfra);
+       
+       while ((ak != NULL) && (done == false)) {
+               if (CFRA != (int)ak->cfra) {
+                       /* this changes the frame, so set the frame and we're done */
+                       CFRA = (int)ak->cfra;
+                       done = true;
+               }
+               else {
+                       /* take another step... */
+                       if (next) {
+                               ak = ak->next;
                        }
                        else {
-                               /* make this the new starting point for the search */
-                               cfra = ak->cfra;
+                               ak = ak->prev;
                        }
                }
-       } while ((ak != NULL) && (done == false));
-
+       }
+       
        /* free temp stuff */
        BLI_dlrbTree_free(&keys);
 
index ed2752d837236d8cf90d1fa1d64b75964f763657..7ab6447d21a1ee3a1ebac34c459ec09ec1d86217 100644 (file)
@@ -248,8 +248,17 @@ PyObject *bpy_text_reimport(PyObject *module, int *found)
        if ((name = PyModule_GetName(module)) == NULL)
                return NULL;
 
-       if ((filepath = (char *)PyModule_GetFilename(module)) == NULL)
-               return NULL;
+       {
+               PyObject *module_file = PyModule_GetFilenameObject(module);
+               if (module_file == NULL) {
+                       return NULL;
+               }
+               filepath = (char *)_PyUnicode_AsString(module_file);
+               Py_DECREF(module_file);
+               if (filepath == NULL) {
+                       return NULL;
+               }
+       }
 
        /* look up the text object */
        text = BLI_findstring(&maggie->text, BLI_path_basename(filepath), offsetof(ID, name) + 2);
index 2e789d6d4b3e1025314b7a07762fe3aaefaea8ae..861e2dbb0df410dfe9c2d66008620811294bc617 100644 (file)
@@ -300,7 +300,14 @@ void PyC_FileAndNum(const char **filename, int *lineno)
                if (mod_name) {
                        PyObject *mod = PyDict_GetItem(PyImport_GetModuleDict(), mod_name);
                        if (mod) {
-                               *filename = PyModule_GetFilename(mod);
+                               PyObject *mod_file = PyModule_GetFilenameObject(mod);
+                               if (mod_file) {
+                                       *filename = _PyUnicode_AsString(mod_name);
+                                       Py_DECREF(mod_file);
+                               }
+                               else {
+                                       PyErr_Clear();
+                               }
                        }
 
                        /* unlikely, fallback */
index cd4d2f7a1c2dfd5bda80aba972bf77182c2b0f00..c6337f2ac28b1685a142a6da84e6b493785e9793 100644 (file)
@@ -870,6 +870,7 @@ static void bpy_module_delay_init(PyObject *bpy_proxy)
 
        BLI_strncpy(filename_abs, filename_rel, sizeof(filename_abs));
        BLI_path_cwd(filename_abs, sizeof(filename_abs));
+       Py_DECREF(filename_obj);
 
        argv[0] = filename_abs;
        argv[1] = NULL;