Merge branch 'master' into blender2.8

This commit is contained in:
Campbell Barton 2017-07-17 13:21:05 +10:00
commit 193d7d6333
8 changed files with 73 additions and 32 deletions

View 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

View 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()

View 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));

View 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;

View 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);

View 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);

View 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 */

View 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;