Merged changes in the trunk up to revision 41768.
Conflicts resolved: source/blender/makesdna/intern/makesdna.c source/blender/makesrna/RNA_enum_types.h source/blender/render/intern/source/shadeinput.c source/blenderplayer/bad_level_call_stubs/stubs.c Additional changes: * source/blender/makesrna/intern/rna_linestyle.c: Fixed white space issues that generated a number of compiler errors. The problem was that two string literals for enumerating MA_RAMP_SOFT and MA_RAMP_LINEAR contained a space. The string literals are supposed to represent a valid C identifier because of their use for automatic code generation. * Stroke transparency has been temporarily disabled due to a functionality conflict with some merged changes. A fix of this issue is planned.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
Import ('env')
|
||||
|
||||
incs = '. ../editors/include ../makesdna ../makesrna ../blenlib ../blenkernel ../nodes'
|
||||
incs = '. ../editors/include ../makesdna ../makesrna ../blenfont ../blenlib ../blenkernel ../nodes'
|
||||
incs += ' ../imbuf ../blenloader ../gpu ../render/extern/include ../windowmanager'
|
||||
incs += ' ../freestyle/intern/python'
|
||||
incs += ' #intern/guardedalloc #intern/memutil #extern/glew/include'
|
||||
@@ -44,5 +44,8 @@ if env['BF_BUILDINFO']:
|
||||
if env['WITH_BF_INTERNATIONAL']:
|
||||
defs.append('WITH_INTERNATIONAL')
|
||||
|
||||
if env['WITH_BF_CYCLES']:
|
||||
defs.append('WITH_CYCLES')
|
||||
|
||||
sources = env.Glob('intern/*.c')
|
||||
env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [361])
|
||||
|
||||
@@ -263,10 +263,10 @@ static void noise_vector(float x, float y, float z, int nb, float v[3])
|
||||
{
|
||||
/* Simply evaluate noise at 3 different positions */
|
||||
v[0]= (float)(2.0f * BLI_gNoise(1.f, x + 9.321f, y - 1.531f, z - 7.951f, 0,
|
||||
nb) - 1.0f);
|
||||
nb) - 1.0f);
|
||||
v[1]= (float)(2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f);
|
||||
v[2]= (float)(2.0f * BLI_gNoise(1.f, x + 6.327f, y + 0.1671f, z - 2.672f, 0,
|
||||
nb) - 1.0f);
|
||||
nb) - 1.0f);
|
||||
}
|
||||
|
||||
static PyObject *Noise_vector(PyObject *UNUSED(self), PyObject *args)
|
||||
@@ -442,10 +442,10 @@ static PyObject *Noise_voronoi(PyObject *UNUSED(self), PyObject *args)
|
||||
return NULL;
|
||||
voronoi(x, y, z, da, pa, me, dtype);
|
||||
return Py_BuildValue("[[ffff][[fff][fff][fff][fff]]]",
|
||||
da[0], da[1], da[2], da[3],
|
||||
pa[0], pa[1], pa[2],
|
||||
pa[3], pa[4], pa[5],
|
||||
pa[6], pa[7], pa[8], pa[9], pa[10], pa[11]);
|
||||
da[0], da[1], da[2], da[3],
|
||||
pa[0], pa[1], pa[2],
|
||||
pa[3], pa[4], pa[5],
|
||||
pa[6], pa[7], pa[8], pa[9], pa[10], pa[11]);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
set(INC
|
||||
..
|
||||
../../blenfont
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../blenloader
|
||||
@@ -96,6 +97,10 @@ if(WITH_AUDASPACE)
|
||||
add_definitions(-DWITH_AUDASPACE)
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES)
|
||||
add_definitions(-DWITH_CYCLES)
|
||||
endif()
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
add_definitions(-DWITH_INTERNATIONAL)
|
||||
endif()
|
||||
|
||||
@@ -174,6 +174,8 @@ void BPY_context_set(bContext *C)
|
||||
|
||||
/* defined in AUD_C-API.cpp */
|
||||
extern PyObject *AUD_initPython(void);
|
||||
/* defined in cycles/blender */
|
||||
extern PyObject *CYCLES_initPython(void);
|
||||
|
||||
static struct _inittab bpy_internal_modules[]= {
|
||||
{(char *)"noise", BPyInit_noise},
|
||||
@@ -183,6 +185,9 @@ static struct _inittab bpy_internal_modules[]= {
|
||||
{(char *)"blf", BPyInit_blf},
|
||||
#ifdef WITH_AUDASPACE
|
||||
{(char *)"aud", AUD_initPython},
|
||||
#endif
|
||||
#ifdef WITH_CYCLES
|
||||
{(char *)"bcycles", CYCLES_initPython},
|
||||
#endif
|
||||
{(char *)"gpu", GPU_initPython},
|
||||
{NULL, NULL}
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
#include "../generic/py_capi_utils.h"
|
||||
|
||||
#ifdef WITH_INTERNATIONAL
|
||||
#include "UI_interface.h" /* bad level call into editors */
|
||||
#include "BLF_translation.h"
|
||||
#endif
|
||||
|
||||
#define USE_PEDANTIC_WRITE
|
||||
|
||||
@@ -945,7 +945,7 @@ static int Quaternion_setAngle(QuaternionObject *self, PyObject *value, void *UN
|
||||
|
||||
angle= PyFloat_AsDouble(value);
|
||||
|
||||
if (angle==-1.0 && PyErr_Occurred()) { /* parsed item not a number */
|
||||
if (angle==-1.0f && PyErr_Occurred()) { /* parsed item not a number */
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"Quaternion.angle = value: float expected");
|
||||
return -1;
|
||||
|
||||
@@ -420,7 +420,7 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( BaseMath_ReadCallback(line_a) == -1 ||
|
||||
if ( BaseMath_ReadCallback(line_a) == -1 ||
|
||||
BaseMath_ReadCallback(line_b) == -1 ||
|
||||
BaseMath_ReadCallback(plane_co) == -1 ||
|
||||
BaseMath_ReadCallback(plane_no) == -1
|
||||
@@ -559,7 +559,7 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( BaseMath_ReadCallback(line_a) == -1 ||
|
||||
if ( BaseMath_ReadCallback(line_a) == -1 ||
|
||||
BaseMath_ReadCallback(line_b) == -1 ||
|
||||
BaseMath_ReadCallback(sphere_co) == -1
|
||||
) {
|
||||
@@ -686,7 +686,7 @@ PyDoc_STRVAR(M_Geometry_intersect_point_quad_2d_doc,
|
||||
" Takes 5 vectors (using only the x and y coordinates): one is the point and the next 4 define the quad, only the x and y are used from the vectors. Returns 1 if the point is within the quad, otherwise 0.\n"
|
||||
"\n"
|
||||
" :arg pt: Point\n"
|
||||
" :type v1: :class:`mathutils.Vector`\n"
|
||||
" :type pt: :class:`mathutils.Vector`\n"
|
||||
" :arg quad_p1: First point of the quad\n"
|
||||
" :type quad_p1: :class:`mathutils.Vector`\n"
|
||||
" :arg quad_p2: Second point of the quad\n"
|
||||
@@ -717,6 +717,42 @@ static PyObject *M_Geometry_intersect_point_quad_2d(PyObject *UNUSED(self), PyOb
|
||||
return PyLong_FromLong(isect_point_quad_v2(pt_vec->vec, quad_p1->vec, quad_p2->vec, quad_p3->vec, quad_p4->vec));
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(M_Geometry_distance_point_to_plane_doc,
|
||||
".. function:: distance_point_to_plane(pt, plane_co, plane_no)\n"
|
||||
"\n"
|
||||
" Returns the signed distance between a point and a plane "
|
||||
" (negative when below the normal).\n"
|
||||
"\n"
|
||||
" :arg pt: Point\n"
|
||||
" :type pt: :class:`mathutils.Vector`\n"
|
||||
" :arg plane_co: First point of the quad\n"
|
||||
" :type plane_co: :class:`mathutils.Vector`\n"
|
||||
" :arg plane_no: Second point of the quad\n"
|
||||
" :type plane_no: :class:`mathutils.Vector`\n"
|
||||
" :rtype: float\n"
|
||||
);
|
||||
static PyObject *M_Geometry_distance_point_to_plane(PyObject *UNUSED(self), PyObject* args)
|
||||
{
|
||||
VectorObject *pt, *plene_co, *plane_no;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O!O!O!:distance_point_to_plane",
|
||||
&vector_Type, &pt,
|
||||
&vector_Type, &plene_co,
|
||||
&vector_Type, &plane_no)
|
||||
) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( BaseMath_ReadCallback(pt) == -1 ||
|
||||
BaseMath_ReadCallback(plene_co) == -1 ||
|
||||
BaseMath_ReadCallback(plane_no) == -1)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return PyFloat_FromDouble(dist_to_plane_v3(pt->vec, plene_co->vec, plane_no->vec));
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(M_Geometry_barycentric_transform_doc,
|
||||
".. function:: barycentric_transform(point, tri_a1, tri_a2, tri_a3, tri_b1, tri_b2, tri_b3)\n"
|
||||
"\n"
|
||||
@@ -1103,6 +1139,7 @@ static PyMethodDef M_Geometry_methods[]= {
|
||||
{"intersect_line_plane", (PyCFunction) M_Geometry_intersect_line_plane, METH_VARARGS, M_Geometry_intersect_line_plane_doc},
|
||||
{"intersect_line_sphere", (PyCFunction) M_Geometry_intersect_line_sphere, METH_VARARGS, M_Geometry_intersect_line_sphere_doc},
|
||||
{"intersect_line_sphere_2d", (PyCFunction) M_Geometry_intersect_line_sphere_2d, METH_VARARGS, M_Geometry_intersect_line_sphere_2d_doc},
|
||||
{"distance_point_to_plane", (PyCFunction) M_Geometry_distance_point_to_plane, METH_VARARGS, M_Geometry_distance_point_to_plane_doc},
|
||||
{"area_tri", (PyCFunction) M_Geometry_area_tri, METH_VARARGS, M_Geometry_area_tri_doc},
|
||||
{"normal", (PyCFunction) M_Geometry_normal, METH_VARARGS, M_Geometry_normal_doc},
|
||||
{"barycentric_transform", (PyCFunction) M_Geometry_barycentric_transform, METH_VARARGS, M_Geometry_barycentric_transform_doc},
|
||||
|
||||
Reference in New Issue
Block a user