diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-07-17 06:21:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-07-17 06:21:05 +0300 |
commit | 193d7d6333882112e31dd4f6196f795a8b7d5022 (patch) | |
tree | a345728d886747d460c0dd7218da0ed127768ef2 | |
parent | a11808a248200a7ee5a9fca0ae16581fee1c249b (diff) | |
parent | bc8a9c47c689b46f20830603b33a1d9041e0ffe3 (diff) |
Merge branch 'master' into blender2.8
-rw-r--r-- | doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst | 4 | ||||
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 23 | ||||
-rw-r--r-- | source/blender/blenlib/intern/noise.c | 12 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_primitive.c | 10 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 33 | ||||
-rw-r--r-- | source/blender/python/generic/bpy_internal_import.c | 13 | ||||
-rw-r--r-- | source/blender/python/generic/py_capi_utils.c | 9 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 1 |
8 files changed, 73 insertions, 32 deletions
diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst b/doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst index d08a761ed95..4bb3d273cb9 100644 --- a/doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst +++ b/doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst @@ -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 - - diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index b3aebcf6188..af1c2be434a 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -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() diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index 347640aae0d..86c24307ae2 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -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)); diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c index cca0f7387cd..d8f83d786b4 100644 --- a/source/blender/bmesh/operators/bmo_primitive.c +++ b/source/blender/bmesh/operators/bmo_primitive.c @@ -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; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index b8fa16117a9..326421cf166 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -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); diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index ed2752d8372..7ab6447d21a 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -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); diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index 2e789d6d4b3..861e2dbb0df 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -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 */ diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index cd4d2f7a1c2..c6337f2ac28 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -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; |