Cut out some unwanted differences with trunk
in preparation for merge.  Also fixed some
warnings, though many remain.
This commit is contained in:
Joseph Eagar 2011-05-07 02:48:14 +00:00
parent 5fc6d567d0
commit 3462ddf17f
27 changed files with 326 additions and 5407 deletions

@ -2214,6 +2214,7 @@ Device_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
switch(device)
{
case AUD_DEVICE_NULL:
(void)specs; /* quiet warning when others disabled */
self->device = new AUD_NULLDevice();
break;
case AUD_DEVICE_OPENAL:

@ -44,8 +44,8 @@ extern "C" {
/********************************** Polygons *********************************/
void cent_tri_v3(float r[3], float a[3], float b[3], float c[3]);
void cent_quad_v3(float r[3], float a[3], float b[3], float c[3], float d[3]);
void cent_tri_v3(float r[3], const float a[3], const float b[3], const float c[3]);
void cent_quad_v3(float r[3], const float a[3], const float b[3], const float c[3], const float d[3]);
float normal_tri_v3(float r[3], const float a[3], const float b[3], const float c[3]);
float normal_quad_v3(float r[3], const float a[3], const float b[3], const float c[3], const float d[3]);
@ -54,24 +54,24 @@ float area_tri_v2(const float a[2], const float b[2], const float c[2]);
float area_tri_signed_v2(const float v1[2], const float v2[2], const float v3[2]);
float area_tri_v3(const float a[3], const float b[3], const float c[3]);
float area_quad_v3(const float a[3], const float b[3], const float c[3], const float d[3]);
float area_poly_v3(int nr, float verts[][3], float normal[3]);
float area_poly_v3(int nr, float verts[][3], const float normal[3]);
int is_quad_convex_v3(const float *v1, const float *v2, const float *v3, const float *v4);
/********************************* Distance **********************************/
float dist_to_line_v2(float p[2], float l1[2], float l2[2]);
float dist_to_line_segment_v2(float p[2], float l1[2], float l2[2]);
float dist_to_line_v2(const float p[2], const float l1[2], const float l2[2]);
float dist_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2]);
float dist_to_line_segment_v3(float p[3], float l1[3], float l2[3]);
float dist_to_line_segment_v3(const float p[3], const float l1[3], const float l2[3]);
float closest_to_line_v3(float r[3], const float p[3], const float l1[3], const float l2[3]);
float closest_to_line_v2(float r[2], const float p[2], const float l1[2], const float l2[2]);
void closest_to_line_segment_v3(float r[3], float p[3], float l1[3], float l2[3]);
void closest_to_line_segment_v3(float r[3], const float p[3], const float l1[3], const float l2[3]);
/******************************* Intersection ********************************/
/* TODO int return value consistency */
int is_quad_convex_v3(float *v1, float *v2, float *v3, float *v4);
/* line-line */
#define ISECT_LINE_LINE_COLINEAR -1
#define ISECT_LINE_LINE_NONE 0
@ -80,7 +80,7 @@ void closest_to_line_segment_v3(float r[3], float p[3], float l1[3], float l2[3]
int isect_line_line_v2(const float a1[2], const float a2[2], const float b1[2], const float b2[2]);
int isect_line_line_v2_short(const short a1[2], const short a2[2], const short b1[2], const short b2[2]);
int isect_seg_seg_v2_point(const float *v1, const float *v2, const float *v3, const float *v4, float vi[2]);
int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[2], const float v4[2], float vi[2]);
/* Returns the number of point of interests
* 0 - lines are colinear
@ -88,57 +88,57 @@ int isect_seg_seg_v2_point(const float *v1, const float *v2, const float *v3, co
* 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively
* */
int isect_line_line_v3(float v1[3], float v2[3],
float v3[3], float v4[3], float i1[3], float i2[3]);
int isect_line_line_strict_v3(float v1[3], float v2[3],
float v3[3], float v4[3], float vi[3], float *lambda);
int isect_line_line_v3(const float v1[3], const float v2[3],
const float v3[3], const float v4[3], float i1[3], float i2[3]);
int isect_line_line_strict_v3(const float v1[3], const float v2[3],
const float v3[3], const float v4[3], float vi[3], float *lambda);
/* line/ray triangle */
int isect_line_tri_v3(float p1[3], float p2[3],
float v0[3], float v1[3], float v2[3], float *lambda, float *uv);
int isect_ray_tri_v3(float p1[3], float d[3],
float v0[3], float v1[3], float v2[3], float *lambda, float *uv);
int isect_ray_tri_threshold_v3(float p1[3], float d[3],
float v0[3], float v1[3], float v2[3], float *lambda, float *uv, float threshold);
int isect_ray_tri_epsilon_v3(float p1[3], float d[3],
float v0[3], float v1[3], float v2[3], float *lambda, float *uv, float epsilon);
int isect_line_tri_v3(const float p1[3], const float p2[3],
const float v0[3], const float v1[3], const float v2[3], float *lambda, float uv[2]);
int isect_ray_tri_v3(const float p1[3], const float d[3],
const float v0[3], const float v1[3], const float v2[3], float *lambda, float uv[2]);
int isect_ray_tri_threshold_v3(const float p1[3], const float d[3],
const float v0[3], const float v1[3], const float v2[3], float *lambda, float uv[2], const float threshold);
int isect_ray_tri_epsilon_v3(const float p1[3], const float d[3],
const float v0[3], const float v1[3], const float v2[3], float *lambda, float uv[2], const float epsilon);
/* point in polygon */
int isect_point_quad_v2(float p[2], float a[2], float b[2], float c[2], float d[2]);
int isect_point_quad_v2(const float p[2], const float a[2], const float b[2], const float c[2], const float d[2]);
int isect_point_tri_v2(float v1[2], float v2[2], float v3[2], float pt[2]);
int isect_point_tri_v2_int(int x1, int y1, int x2, int y2, int a, int b);
int isect_point_tri_prism_v3(float p[3], float v1[3], float v2[3], float v3[3]);
int isect_point_tri_v2(const float v1[2], const float v2[2], const float v3[2], const float pt[2]);
int isect_point_tri_v2_int(const int x1, const int y1, const int x2, const int y2, const int a, const int b);
int isect_point_tri_prism_v3(const float p[3], const float v1[3], const float v2[3], const float v3[3]);
void isect_point_quad_uv_v2(float v0[2], float v1[2], float v2[2], float v3[2],
float pt[2], float *uv);
void isect_point_face_uv_v2(int isquad, float v0[2], float v1[2], float v2[2],
float v3[2], float pt[2], float *uv);
void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2[2], const float v3[2],
const float pt[2], float *uv);
void isect_point_face_uv_v2(const int isquad, const float v0[2], const float v1[2], const float v2[2],
const float v3[2], const float pt[2], float *uv);
/* other */
int isect_sweeping_sphere_tri_v3(float p1[3], float p2[3], float radius,
float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint);
int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius,
const float v0[3], const float v1[3], const float v2[3], float *lambda, float ipoint[3]);
int isect_axial_line_tri_v3(int axis, float co1[3], float co2[3],
float v0[3], float v1[3], float v2[3], float *lambda);
int isect_axial_line_tri_v3(const int axis, const float co1[3], const float co2[3],
const float v0[3], const float v1[3], const float v2[3], float *lambda);
int isect_aabb_aabb_v3(float min1[3], float max1[3], float min2[3], float max2[3]);
int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3]);
int clip_line_plane(float clipco[3], float plane[4], float co[3]);
int clip_line_plane(float p1[3], float p2[3], const float plane[4]);
void plot_line_v2v2i(int p1[2], int p2[2], int (*callback)(int, int, void *), void *userData);
void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int, void *), void *userData);
/****************************** Interpolation ********************************/
/* tri or quad, d can be NULL */
void interp_weights_face_v3(float w[4],
float a[3], float b[3], float c[3], float d[3], float p[3]);
void interp_weights_poly_v3(float w[], float v[][3], int n, float p[3]);
const float a[3], const float b[3], const float c[3], const float d[3], const float p[3]);
void interp_weights_poly_v3(float w[], float v[][3], const int n, const float p[3]);
void interp_cubic_v3(float x[3], float v[3],
float x1[3], float v1[3], float x2[3], float v2[3], float t);
const float x1[3], const float v1[3], const float x2[3], const float v2[3], const float t);
int interp_sparse_array(float *array, int list_size, float invalid);
int interp_sparse_array(float *array, const int list_size, const float invalid);
void barycentric_transform(float pt_tar[3], float const pt_src[3],
const float tri_tar_p1[3], const float tri_tar_p2[3], const float tri_tar_p3[3],
@ -154,22 +154,22 @@ void lookat_m4(float mat[4][4], float vx, float vy,
void polarview_m4(float mat[4][4], float dist, float azimuth,
float incidence, float twist);
void perspective_m4(float mat[4][4], float left, float right,
float bottom, float top, float nearClip, float farClip);
void orthographic_m4(float mat[4][4], float left, float right,
float bottom, float top, float nearClip, float farClip);
void perspective_m4(float mat[4][4], const float left, const float right,
const float bottom, const float top, const float nearClip, const float farClip);
void orthographic_m4(float mat[4][4], const float left, const float right,
const float bottom, const float top, const float nearClip, const float farClip);
void window_translate_m4(float winmat[][4], float perspmat[][4],
float x, float y);
const float x, const float y);
int box_clip_bounds_m4(float boundbox[2][3],
float bounds[4], float winmat[4][4]);
const float bounds[4], float winmat[4][4]);
void box_minmax_bounds_m4(float min[3], float max[3],
float boundbox[2][3], float mat[4][4]);
/********************************** Mapping **********************************/
void map_to_tube(float *u, float *v, float x, float y, float z);
void map_to_sphere(float *u, float *v, float x, float y, float z);
void map_to_tube(float *u, float *v, const float x, const float y, const float z);
void map_to_sphere(float *u, float *v, const float x, const float y, const float z);
/********************************** Normals **********************************/
@ -184,11 +184,11 @@ typedef struct VertexTangent {
float tang[3], uv[2];
} VertexTangent;
float *find_vertex_tangent(VertexTangent *vtang, float *uv);
float *find_vertex_tangent(VertexTangent *vtang, const float uv[2]);
void sum_or_add_vertex_tangent(void *arena, VertexTangent **vtang,
float *tang, float *uv);
void tangent_from_uv(float *uv1, float *uv2, float *uv3,
float *co1, float *co2, float *co3, float *n, float *tang);
const float tang[3], const float uv[2]);
void tangent_from_uv(float uv1[2], float uv2[2], float uv3[2],
float co1[3], float co2[3], float co3[3], float n[3], float tang[3]);
/******************************** Vector Clouds ******************************/
@ -202,16 +202,17 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,
0 = (0,0),
1 = (1,-1), 2 = (1,0), 3 = (1,1),
4 = (2,-2), 5 = (2,-1), 6 = (2,0), 7 = (2,1), 8 = (2,2) */
/*
MINLINE void zero_sh(float r[9]);
MINLINE void copy_sh_sh(float r[9], float a[9]);
MINLINE void mul_sh_fl(float r[9], float f);
MINLINE void add_sh_shsh(float r[9], float a[9], float b[9]);
MINLINE void copy_sh_sh(float r[9], const float a[9]);
MINLINE void mul_sh_fl(float r[9], const float f);
MINLINE void add_sh_shsh(float r[9], const float a[9], const float b[9]);
MINLINE float eval_shv3(float r[9], float v[3]);
MINLINE float diffuse_shv3(float r[9], float v[3]);
MINLINE void vec_fac_to_sh(float r[9], float v[3], float f);
MINLINE void madd_sh_shfl(float r[9], float sh[3], float f);
MINLINE float eval_shv3(float r[9], const float v[3]);
MINLINE float diffuse_shv3(float r[9], const float v[3]);
MINLINE void vec_fac_to_sh(float r[9], const float v[3], const float f);
MINLINE void madd_sh_shfl(float r[9], const float sh[3], const float f);
*/
/********************************* Form Factor *******************************/

@ -30,7 +30,7 @@
Simple, fast memory allocator that uses many BLI_mempools for allocation.
this is meant to be used by lots of relatively small objects.
this is a temporary and inperfect fix for performance issues caused
this is a temporary and imperfect fix for performance issues caused
by vgroups. it needs to be replaced with something better, preferably
integrated into guardedalloc.

@ -41,14 +41,14 @@
/********************************** Polygons *********************************/
void cent_tri_v3(float *cent, float *v1, float *v2, float *v3)
void cent_tri_v3(float cent[3], const float v1[3], const float v2[3], const float v3[3])
{
cent[0]= 0.33333f*(v1[0]+v2[0]+v3[0]);
cent[1]= 0.33333f*(v1[1]+v2[1]+v3[1]);
cent[2]= 0.33333f*(v1[2]+v2[2]+v3[2]);
}
void cent_quad_v3(float *cent, float *v1, float *v2, float *v3, float *v4)
void cent_quad_v3(float cent[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
{
cent[0]= 0.25f*(v1[0]+v2[0]+v3[0]+v4[0]);
cent[1]= 0.25f*(v1[1]+v2[1]+v3[1]+v4[1]);
@ -99,7 +99,7 @@ float area_tri_v2(const float v1[2], const float v2[2], const float v3[2])
float area_tri_signed_v2(const float v1[2], const float v2[2], const float v3[2])
{
return 0.5f * ((v1[0]-v2[0])*(v2[1]-v3[1]) + (v1[1]-v2[1])*(v3[0]-v2[0]));
return 0.5f * ((v1[0]-v2[0])*(v2[1]-v3[1]) + (v1[1]-v2[1])*(v3[0]-v2[0]));
}
float area_quad_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3]) /* only convex Quadrilaterals */
@ -131,7 +131,7 @@ float area_tri_v3(const float v1[3], const float v2[3], const float v3[3]) /* T
return (len/2.0f);
}
float area_poly_v3(int nr, float verts[][3], float *normal)
float area_poly_v3(int nr, float verts[][3], const float normal[3])
{
float x, y, z, area, max;
float *cur, *prev;
@ -165,7 +165,7 @@ float area_poly_v3(int nr, float verts[][3], float *normal)
/* distance v1 to line v2-v3 */
/* using Hesse formula, NO LINE PIECE! */
float dist_to_line_v2(float *v1, float *v2, float *v3)
float dist_to_line_v2(const float v1[2], const float v2[2], const float v3[2])
{
float a[2],deler;
@ -179,7 +179,7 @@ float dist_to_line_v2(float *v1, float *v2, float *v3)
}
/* distance v1 to line-piece v2-v3 */
float dist_to_line_segment_v2(float *v1, float *v2, float *v3)
float dist_to_line_segment_v2(const float v1[2], const float v2[2], const float v3[2])
{
float labda, rc[2], pt[2], len;
@ -208,11 +208,11 @@ float dist_to_line_segment_v2(float *v1, float *v2, float *v3)
rc[0]= pt[0]-v1[0];
rc[1]= pt[1]-v1[1];
return (float)sqrt(rc[0]*rc[0]+ rc[1]*rc[1]);
return sqrtf(rc[0]*rc[0]+ rc[1]*rc[1]);
}
/* point closest to v1 on line v2-v3 in 3D */
void closest_to_line_segment_v3(float *closest, float v1[3], float v2[3], float v3[3])
void closest_to_line_segment_v3(float closest[3], const float v1[3], const float v2[3], const float v3[3])
{
float lambda, cp[3];
@ -227,7 +227,7 @@ void closest_to_line_segment_v3(float *closest, float v1[3], float v2[3], float
}
/* distance v1 to line-piece v2-v3 in 3D */
float dist_to_line_segment_v3(float *v1, float *v2, float *v3)
float dist_to_line_segment_v3(const float v1[3], const float v2[3], const float v3[3])
{
float closest[3];
@ -239,7 +239,7 @@ float dist_to_line_segment_v3(float *v1, float *v2, float *v3)
/******************************* Intersection ********************************/
/* intersect Line-Line, shorts */
int isect_line_line_v2_short(const short *v1, const short *v2, const short *v3, const short *v4)
int isect_line_line_v2_short(const short v1[2], const short v2[2], const short v3[2], const short v4[2])
{
float div, labda, mu;
@ -258,7 +258,7 @@ int isect_line_line_v2_short(const short *v1, const short *v2, const short *v3,
}
/* intersect Line-Line, floats */
int isect_line_line_v2(const float *v1, const float *v2, const float *v3, const float *v4)
int isect_line_line_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
{
float div, labda, mu;
@ -277,9 +277,9 @@ int isect_line_line_v2(const float *v1, const float *v2, const float *v3, const
}
/* get intersection point of two 2D segments and return intersection type:
-1: colliniar or out-of-segment intersection
-1: colliniar
1: intersection */
int isect_seg_seg_v2_point(const float *v1, const float *v2, const float *v3, const float *v4, float vi[2])
int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[2], const float v4[2], float vi[2])
{
float a1, a2, b1, b2, c1, c2, d;
float u, v;
@ -354,8 +354,8 @@ int isect_seg_seg_v2_point(const float *v1, const float *v2, const float *v3, co
1: intersection
*/
static short IsectLLPt2Df(float x0,float y0,float x1,float y1,
float x2,float y2,float x3,float y3, float *xi,float *yi)
static short IsectLLPt2Df(const float x0, const float y0, const float x1, const float y1,
const float x2, const float y2, const float x3, const float y3, float *xi,float *yi)
{
/*
@ -405,7 +405,7 @@ static short IsectLLPt2Df(float x0,float y0,float x1,float y1,
/* point in tri */
int isect_point_tri_v2(float pt[2], float v1[2], float v2[2], float v3[2])
int isect_point_tri_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2])
{
if (line_point_side_v2(v1,v2,pt)>=0.0f) {
if (line_point_side_v2(v2,v3,pt)>=0.0f) {
@ -424,7 +424,7 @@ int isect_point_tri_v2(float pt[2], float v1[2], float v2[2], float v3[2])
return 0;
}
/* point in quad - only convex quads */
int isect_point_quad_v2(float pt[2], float v1[2], float v2[2], float v3[2], float v4[2])
int isect_point_quad_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2])
{
if (line_point_side_v2(v1,v2,pt)>=0.0f) {
if (line_point_side_v2(v2,v3,pt)>=0.0f) {
@ -451,7 +451,7 @@ int isect_point_quad_v2(float pt[2], float v1[2], float v2[2], float v3[2], floa
test if the line starting at p1 ending at p2 intersects the triangle v0..v2
return non zero if it does
*/
int isect_line_tri_v3(float p1[3], float p2[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv)
int isect_line_tri_v3(const float p1[3], const float p2[3], const float v0[3], const float v1[3], const float v2[3], float *lambda, float uv[2])
{
float p[3], s[3], d[3], e1[3], e2[3], q[3];
@ -473,7 +473,7 @@ int isect_line_tri_v3(float p1[3], float p2[3], float v0[3], float v1[3], float
cross_v3_v3v3(q, s, e1);
v = f * dot_v3v3(d, q);
v = f * dot_v3v3(d, q);
if ((v < 0.0f)||((u + v) > 1.0f)) return 0;
*lambda = f * dot_v3v3(e2, q);
@ -491,7 +491,7 @@ int isect_line_tri_v3(float p1[3], float p2[3], float v0[3], float v1[3], float
test if the ray starting at p1 going in d direction intersects the triangle v0..v2
return non zero if it does
*/
int isect_ray_tri_v3(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv)
int isect_ray_tri_v3(const float p1[3], const float d[3], const float v0[3], const float v1[3], const float v2[3], float *lambda, float uv[2])
{
float p[3], s[3], e1[3], e2[3], q[3];
float a, f, u, v;
@ -519,7 +519,7 @@ int isect_ray_tri_v3(float p1[3], float d[3], float v0[3], float v1[3], float v2
*lambda = f * dot_v3v3(e2, q);
if ((*lambda < 0.0f)) return 0;
if(uv) {
if(uv) {
uv[0]= u;
uv[1]= v;
}
@ -527,41 +527,41 @@ int isect_ray_tri_v3(float p1[3], float d[3], float v0[3], float v1[3], float v2
return 1;
}
int isect_ray_tri_epsilon_v3(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv, float epsilon)
int isect_ray_tri_epsilon_v3(const float p1[3], const float d[3], const float v0[3], const float v1[3], const float v2[3], float *lambda, float uv[2], const float epsilon)
{
float p[3], s[3], e1[3], e2[3], q[3];
float a, f, u, v;
float p[3], s[3], e1[3], e2[3], q[3];
float a, f, u, v;
sub_v3_v3v3(e1, v1, v0);
sub_v3_v3v3(e2, v2, v0);
sub_v3_v3v3(e1, v1, v0);
sub_v3_v3v3(e2, v2, v0);
cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p);
if (a == 0.0f) return 0;
f = 1.0f/a;
cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p);
if (a == 0.0f) return 0;
f = 1.0f/a;
sub_v3_v3v3(s, p1, v0);
sub_v3_v3v3(s, p1, v0);
u = f * dot_v3v3(s, p);
if ((u < -epsilon)||(u > 1.0f+epsilon)) return 0;
u = f * dot_v3v3(s, p);
if ((u < -epsilon)||(u > 1.0f+epsilon)) return 0;
cross_v3_v3v3(q, s, e1);
cross_v3_v3v3(q, s, e1);
v = f * dot_v3v3(d, q);
if ((v < -epsilon)||((u + v) > 1.0f+epsilon)) return 0;
v = f * dot_v3v3(d, q);
if ((v < -epsilon)||((u + v) > 1.0f+epsilon)) return 0;
*lambda = f * dot_v3v3(e2, q);
if ((*lambda < 0.0f)) return 0;
*lambda = f * dot_v3v3(e2, q);
if ((*lambda < 0.0f)) return 0;
if(uv) {
uv[0]= u;
uv[1]= v;
}
if(uv) {
uv[0]= u;
uv[1]= v;
}
return 1;
return 1;
}
int isect_ray_tri_threshold_v3(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv, float threshold)
int isect_ray_tri_threshold_v3(const float p1[3], const float d[3], const float v0[3], const float v1[3], const float v2[3], float *lambda, float *uv, const float threshold)
{
float p[3], s[3], e1[3], e2[3], q[3];
float a, f, u, v;
@ -614,7 +614,7 @@ int isect_ray_tri_threshold_v3(float p1[3], float d[3], float v0[3], float v1[3]
/* Adapted from the paper by Kasper Fauerby */
/* "Improved Collision detection and Response" */
static int getLowestRoot(float a, float b, float c, float maxR, float* root)
static int getLowestRoot(const float a, const float b, const float c, const float maxR, float *root)
{
// Check if a solution exists
float determinant = b*b - 4.0f*a*c;
@ -651,7 +651,7 @@ static int getLowestRoot(float a, float b, float c, float maxR, float* root)
return 0;
}
int isect_sweeping_sphere_tri_v3(float p1[3], float p2[3], float radius, float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint)
int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius, const float v0[3], const float v1[3], const float v2[3], float *lambda, float ipoint[3])
{
float e1[3], e2[3], e3[3], point[3], vel[3], /*dist[3],*/ nor[3], temp[3], bv[3];
float a, b, c, d, e, x, y, z, radius2=radius*radius;
@ -848,7 +848,7 @@ int isect_sweeping_sphere_tri_v3(float p1[3], float p2[3], float radius, float v
return found_by_sweep;
}
int isect_axial_line_tri_v3(int axis, float p1[3], float p2[3], float v0[3], float v1[3], float v2[3], float *lambda)
int isect_axial_line_tri_v3(const int axis, const float p1[3], const float p2[3], const float v0[3], const float v1[3], const float v2[3], float *lambda)
{
float p[3], e1[3], e2[3];
float u, v, f;
@ -897,7 +897,7 @@ int isect_axial_line_tri_v3(int axis, float p1[3], float p2[3], float v0[3], flo
* 1 - lines are coplanar, i1 is set to intersection
* 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively
* */
int isect_line_line_v3(float v1[3], float v2[3], float v3[3], float v4[3], float i1[3], float i2[3])
int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float i1[3], float i2[3])
{
float a[3], b[3], c[3], ab[3], cb[3], dir1[3], dir2[3];
float d;
@ -909,7 +909,7 @@ int isect_line_line_v3(float v1[3], float v2[3], float v3[3], float v4[3], float
normalize_v3_v3(dir1, a);
normalize_v3_v3(dir2, b);
d = dot_v3v3(dir1, dir2);
if (d >= 1.0-FLT_EPSILON*10 || d <= -1.0 + FLT_EPSILON*10) {
if (d == 1.0f || d == -1.0f) {
/* colinear */
return 0;
}
@ -961,7 +961,7 @@ int isect_line_line_v3(float v1[3], float v2[3], float v3[3], float v4[3], float
/* Intersection point strictly between the two lines
* 0 when no intersection is found
* */
int isect_line_line_strict_v3(float v1[3], float v2[3], float v3[3], float v4[3], float vi[3], float *lambda)
int isect_line_line_strict_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float vi[3], float *lambda)
{
float a[3], b[3], c[3], ab[3], cb[3], ca[3], dir1[3], dir2[3];
float d;
@ -1014,7 +1014,7 @@ int isect_line_line_strict_v3(float v1[3], float v2[3], float v3[3], float v4[3]
}
}
int isect_aabb_aabb_v3(float min1[3], float max1[3], float min2[3], float max2[3])
int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3])
{
return (min1[0]<max2[0] && min1[1]<max2[1] && min1[2]<max2[2] &&
min2[0]<max1[0] && min2[1]<max1[1] && min2[2]<max1[2]);
@ -1058,7 +1058,7 @@ static float lambda_cp_line(float p[3], float l1[3], float l2[3])
#endif
/* Similar to LineIntersectsTriangleUV, except it operates on a quad and in 2d, assumes point is in quad */
void isect_point_quad_uv_v2(float v0[2], float v1[2], float v2[2], float v3[2], float pt[2], float *uv)
void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2[2], const float v3[2], const float pt[2], float *uv)
{
float x0,y0, x1,y1, wtot, v2d[2], w1, w2;
@ -1152,7 +1152,7 @@ void isect_point_quad_uv_v2(float v0[2], float v1[2], float v2[2], float v3[2],
}
/* same as above but does tri's and quads, tri's are a bit of a hack */
void isect_point_face_uv_v2(int isquad, float v0[2], float v1[2], float v2[2], float v3[2], float pt[2], float *uv)
void isect_point_face_uv_v2(const int isquad, const float v0[2], const float v1[2], const float v2[2], const float v3[2], const float pt[2], float *uv)
{
if (isquad) {
isect_point_quad_uv_v2(v0, v1, v2, v3, pt, uv);
@ -1238,7 +1238,7 @@ int isect_point_tri_v2(float v0[2], float v1[2], float v2[2], float pt[2])
x1,y1-- x2,y1
*/
int isect_point_tri_v2_int(int x1, int y1, int x2, int y2, int a, int b)
int isect_point_tri_v2_int(const int x1, const int y1, const int x2, const int y2, const int a, const int b)
{
float v1[2], v2[2], v3[2], p[2];
@ -1257,7 +1257,7 @@ int isect_point_tri_v2_int(int x1, int y1, int x2, int y2, int a, int b)
return isect_point_tri_v2(p, v1, v2, v3);
}
static int point_in_slice(float p[3], float v1[3], float l1[3], float l2[3])
static int point_in_slice(const float p[3], const float v1[3], const float l1[3], const float l2[3])
{
/*
what is a slice ?
@ -1305,7 +1305,7 @@ static int point_in_slice_m(float p[3],float origin[3],float normal[3],float lns
}
#endif
int isect_point_tri_prism_v3(float p[3], float v1[3], float v2[3], float v3[3])
int isect_point_tri_prism_v3(const float p[3], const float v1[3], const float v2[3], const float v3[3])
{
if(!point_in_slice(p,v1,v2,v3)) return 0;
if(!point_in_slice(p,v2,v3,v1)) return 0;
@ -1313,7 +1313,7 @@ int isect_point_tri_prism_v3(float p[3], float v1[3], float v2[3], float v3[3])
return 1;
}
int clip_line_plane(float p1[3], float p2[3], float plane[4])
int clip_line_plane(float p1[3], float p2[3], const float plane[4])
{
float dp[3], n[3], div, t, pc[3];
@ -1363,7 +1363,7 @@ int clip_line_plane(float p1[3], float p2[3], float plane[4])
}
void plot_line_v2v2i(int p1[2], int p2[2], int (*callback)(int, int, void *), void *userData)
void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int, void *), void *userData)
{
int x1= p1[0];
int y1= p1[1];
@ -1429,12 +1429,12 @@ void plot_line_v2v2i(int p1[2], int p2[2], int (*callback)(int, int, void *), vo
/****************************** Interpolation ********************************/
static float tri_signed_area(float *v1, float *v2, float *v3, int i, int j)
static float tri_signed_area(const float v1[3], const float v2[3], const float v3[3], const int i, const int j)
{
return 0.5f*((v1[i]-v2[i])*(v2[j]-v3[j]) + (v1[j]-v2[j])*(v3[i]-v2[i]));
}
static int barycentric_weights(float *v1, float *v2, float *v3, float *co, float *n, float *w)
static int barycentric_weights(const float v1[3], const float v2[3], const float v3[3], const float co[3], const float n[3], float w[3])
{
float xn, yn, zn, a1, a2, a3, asum;
short i, j;
@ -1468,7 +1468,7 @@ static int barycentric_weights(float *v1, float *v2, float *v3, float *co, float
return 0;
}
void interp_weights_face_v3(float *w,float *v1, float *v2, float *v3, float *v4, float *co)
void interp_weights_face_v3(float w[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3], const float co[3])
{
float w2[3];
@ -1524,22 +1524,22 @@ void interp_weights_face_v3(float *w,float *v1, float *v2, float *v3, float *v4,
* note: using area_tri_signed_v2 means locations outside the triangle are correctly weighted */
void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3])
{
float wtot_inv, wtot;
float wtot_inv, wtot;
w[0] = area_tri_signed_v2(v2, v3, co);
w[1] = area_tri_signed_v2(v3, v1, co);
w[2] = area_tri_signed_v2(v1, v2, co);
wtot = w[0]+w[1]+w[2];
w[0] = area_tri_signed_v2(v2, v3, co);
w[1] = area_tri_signed_v2(v3, v1, co);
w[2] = area_tri_signed_v2(v1, v2, co);
wtot = w[0]+w[1]+w[2];
if (wtot != 0.0f) {
wtot_inv = 1.0f/wtot;
if (wtot != 0.0f) {
wtot_inv = 1.0f/wtot;
w[0] = w[0]*wtot_inv;
w[1] = w[1]*wtot_inv;
w[2] = w[2]*wtot_inv;
}
else /* dummy values for zero area face */
w[0] = w[1] = w[2] = 1.0f/3.0f;
w[0] = w[0]*wtot_inv;
w[1] = w[1]*wtot_inv;
w[2] = w[2]*wtot_inv;
}
else /* dummy values for zero area face */
w[0] = w[1] = w[2] = 1.0f/3.0f;
}
/* given 2 triangles in 3D space, and a point in relation to the first triangle.
@ -1592,7 +1592,7 @@ void barycentric_transform(float pt_tar[3], float const pt_src[3],
/* given an array with some invalid values this function interpolates valid values
* replacing the invalid ones */
int interp_sparse_array(float *array, int list_size, float skipval)
int interp_sparse_array(float *array, int const list_size, const float skipval)
{
int found_invalid = 0;
int found_valid = 0;
@ -1672,7 +1672,7 @@ int interp_sparse_array(float *array, int list_size, float skipval)
/* Mean value weights - smooth interpolation weights for polygons with
* more than 3 vertices */
static float mean_value_half_tan(float *v1, float *v2, float *v3)
static float mean_value_half_tan(const float v1[3], const float v2[3], const float v3[3])
{
float d2[3], d3[3], cross[3], area, dot, len;
@ -1690,7 +1690,7 @@ static float mean_value_half_tan(float *v1, float *v2, float *v3)
return (len - dot)/area;
}
void interp_weights_poly_v3(float *w,float v[][3], int n, float *co)
void interp_weights_poly_v3(float *w, float v[][3], const int n, const float co[3])
{
float totweight, t1, t2, len, *vmid, *vprev, *vnext;
int i;
@ -1706,7 +1706,7 @@ void interp_weights_poly_v3(float *w,float v[][3], int n, float *co)
t2= mean_value_half_tan(co, vmid, vnext);
len= len_v3v3(co, vmid);
w[i]= (t1+t2)/(len+FLT_EPSILON*2);
w[i]= (t1+t2)/len;
totweight += w[i];
}
@ -1716,7 +1716,7 @@ void interp_weights_poly_v3(float *w,float v[][3], int n, float *co)
}
/* (x1,v1)(t1=0)------(x2,v2)(t2=1), 0<t<1 --> (x,v)(t) */
void interp_cubic_v3(float *x, float *v,float *x1, float *v1, float *x2, float *v2, float t)
void interp_cubic_v3(float x[3], float v[3], const float x1[3], const float v1[3], const float x2[3], const float v2[3], const float t)
{
float a[3],b[3];
float t2= t*t;
@ -1742,7 +1742,7 @@ void interp_cubic_v3(float *x, float *v,float *x1, float *v1, float *x2, float *
/***************************** View & Projection *****************************/
void orthographic_m4(float matrix[][4],float left, float right, float bottom, float top, float nearClip, float farClip)
void orthographic_m4(float matrix[][4], const float left, const float right, const float bottom, const float top, const float nearClip, const float farClip)
{
float Xdelta, Ydelta, Zdelta;
@ -1761,7 +1761,7 @@ void orthographic_m4(float matrix[][4],float left, float right, float bottom, fl
matrix[3][2] = -(farClip + nearClip)/Zdelta;
}
void perspective_m4(float mat[][4],float left, float right, float bottom, float top, float nearClip, float farClip)
void perspective_m4(float mat[][4],float left, const float right, const float bottom, const float top, const float nearClip, const float farClip)
{
float Xdelta, Ydelta, Zdelta;
@ -1786,7 +1786,7 @@ void perspective_m4(float mat[][4],float left, float right, float bottom, float
}
/* translate a matrix created by orthographic_m4 or perspective_m4 in XY coords (used to jitter the view) */
void window_translate_m4(float winmat[][4], float perspmat[][4], float x, float y)
void window_translate_m4(float winmat[][4], float perspmat[][4], const float x, const float y)
{
if(winmat[2][3] == -1.0f) {
/* in the case of a win-matrix, this means perspective always */
@ -1890,7 +1890,7 @@ void lookat_m4(float mat[][4],float vx, float vy, float vz, float px, float py,
translate_m4(mat,-vx,-vy,-vz); /* translate viewpoint to origin */
}
int box_clip_bounds_m4(float boundbox[2][3], float bounds[4], float winmat[4][4])
int box_clip_bounds_m4(float boundbox[2][3], const float bounds[4], float winmat[4][4])
{
float mat[4][4], vec[4];
int a, fl, flag= -1;
@ -1950,7 +1950,7 @@ void box_minmax_bounds_m4(float min[3], float max[3], float boundbox[2][3], floa
/********************************** Mapping **********************************/
void map_to_tube(float *u, float *v,float x, float y, float z)
void map_to_tube(float *u, float *v, const float x, const float y, const float z)
{
float len;
@ -1963,7 +1963,7 @@ void map_to_tube(float *u, float *v,float x, float y, float z)
*v = *u = 0.0f; /* to avoid un-initialized variables */
}
void map_to_sphere(float *u, float *v,float x, float y, float z)
void map_to_sphere(float *u, float *v, const float x, const float y, const float z)
{
float len;
@ -1971,9 +1971,8 @@ void map_to_sphere(float *u, float *v,float x, float y, float z)
if(len > 0.0f) {
if(x==0.0f && y==0.0f) *u= 0.0f; /* othwise domain error */
else *u = (1.0f - atan2f(x,y) / (float)M_PI) / 2.0f;
z/=len;
*v = 1.0f - (float)saacos(z)/(float)M_PI;
*v = 1.0f - (float)saacos(z/len)/(float)M_PI;
} else {
*v = *u = 0.0f; /* to avoid un-initialized variables */
}
@ -2033,7 +2032,7 @@ void accumulate_vertex_normals(float n1[3], float n2[3], float n3[3],
/* from BKE_mesh.h */
#define STD_UV_CONNECT_LIMIT 0.0001f
void sum_or_add_vertex_tangent(void *arena, VertexTangent **vtang, float *tang, float *uv)
void sum_or_add_vertex_tangent(void *arena, VertexTangent **vtang, const float tang[3], const float uv[2])
{
VertexTangent *vt;
@ -2056,7 +2055,7 @@ void sum_or_add_vertex_tangent(void *arena, VertexTangent **vtang, float *tang,
*vtang= vt;
}
float *find_vertex_tangent(VertexTangent *vtang, float *uv)
float *find_vertex_tangent(VertexTangent *vtang, const float uv[2])
{
VertexTangent *vt;
static float nulltang[3] = {0.0f, 0.0f, 0.0f};
@ -2068,7 +2067,7 @@ float *find_vertex_tangent(VertexTangent *vtang, float *uv)
return nulltang; /* shouldn't happen, except for nan or so */
}
void tangent_from_uv(float *uv1, float *uv2, float *uv3, float *co1, float *co2, float *co3, float *n, float *tang)
void tangent_from_uv(float uv1[2], float uv2[2], float uv3[3], float co1[3], float co2[3], float co3[3], float n[3], float tang[3])
{
float s1= uv2[0] - uv1[0];
float s2= uv3[0] - uv1[0];
@ -2262,14 +2261,14 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
/******************************* Form Factor *********************************/
static void vec_add_dir(float r[3], float v1[3], float v2[3], float fac)
static void vec_add_dir(float r[3], const float v1[3], const float v2[3], const float fac)
{
r[0]= v1[0] + fac*(v2[0] - v1[0]);
r[1]= v1[1] + fac*(v2[1] - v1[1]);
r[2]= v1[2] + fac*(v2[2] - v1[2]);
}
static int ff_visible_quad(float p[3], float n[3], float v0[3], float v1[3], float v2[3], float q0[3], float q1[3], float q2[3], float q3[3])
static int ff_visible_quad(const float p[3], const float n[3], const float v0[3], const float v1[3], const float v2[3], float q0[3], float q1[3], float q2[3], float q3[3])
{
static const float epsilon = 1e-6f;
float c, sd[3];
@ -2605,7 +2604,7 @@ static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float
aresult = (_mm_set_ps1(n[0])*gx + _mm_set_ps1(n[1])*gy + _mm_set_ps1(n[2])*gz)*angle;
/* sum together */
result= (fresult[0] + fresult[1] + fresult[2] + fresult[3])*(0.5f/(float)M_PI);
result= (fresult[0] + fresult[1] + fresult[2] + fresult[3])*(0.5f/(float)M_PI);
result= MAX2(result, 0.0f);
return result;
@ -2628,7 +2627,7 @@ static void ff_normalize(float n[3])
}
}
static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float *q2, float *q3)
static float ff_quad_form_factor(const float p[3], const float n[3], const float q0[3], const float q1[3], const float q2[3], const float q3[3])
{
float r0[3], r1[3], r2[3], r3[3], g0[3], g1[3], g2[3], g3[3];
float a1, a2, a3, a4, dot1, dot2, dot3, dot4, result;
@ -2680,7 +2679,7 @@ float form_factor_hemi_poly(float p[3], float n[3], float v1[3], float v2[3], fl
}
/* evaluate if entire quad is a proper convex quad */
int is_quad_convex_v3(float *v1, float *v2, float *v3, float *v4)
int is_quad_convex_v3(const float *v1, const float *v2, const float *v3, const float *v4)
{
float nor[3], nor1[3], nor2[3], vec[4][2];

@ -34,10 +34,10 @@ typedef struct EdgeTag {
void calc_corner_co(BMesh *bm, BMLoop *l, float *co, float fac)
{
float no[3], tan[3], vec1[3], vec2[3], v1[3], v2[3], v3[3], v4[3];
float p1[3], p2[3], w[3];
float l1, l2;
int ret, inv=0;
float no[3], /*tan[3]*,*/ vec1[3], vec2[3], v1[3], v2[3], v3[3], v4[3];
/*float p1[3], p2[3], w[3];
float l1, l2;*/
int /*ret,*/ inv=0;
if (l->f->len > 2) {
copy_v3_v3(v1, l->prev->v->co);

@ -106,17 +106,9 @@ if(WITH_BUILDINFO)
add_definitions(-DNAN_BUILDINFO)
endif()
<<<<<<< .working
IF(WITH_BUILDINFO)
ADD_DEFINITIONS(-DNAN_BUILDINFO)
ENDIF(WITH_BUILDINFO)
BLENDERLIB(bf_collada "${SRC}" "${INC}")
=======
if(CMAKE_COMPILER_IS_GNUCXX)
# COLLADAFWArray.h gives error with gcc 4.5
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
endif()
blender_add_lib(bf_collada "${SRC}" "${INC}")
>>>>>>> .merge-right.r35190

@ -295,446 +295,6 @@ public:
}
};
<<<<<<< .working
class ImagesExporter: COLLADASW::LibraryImages
{
const char *mfilename;
std::vector<std::string> mImages; // contains list of written images, to avoid duplicates
public:
ImagesExporter(COLLADASW::StreamWriter *sw, const char* filename) : COLLADASW::LibraryImages(sw), mfilename(filename)
{}
void exportImages(Scene *sce)
{
openLibrary();
forEachMaterialInScene(sce, *this);
closeLibrary();
}
void operator()(Material *ma, Object *ob)
{
int a;
for (a = 0; a < MAX_MTEX; a++) {
MTex *mtex = ma->mtex[a];
if (mtex && mtex->tex && mtex->tex->ima) {
Image *image = mtex->tex->ima;
std::string name(id_name(image));
name = translate_id(name);
char rel[FILE_MAX];
char abs[FILE_MAX];
char src[FILE_MAX];
char dir[FILE_MAX];
BLI_split_dirfile(mfilename, dir, NULL);
BKE_rebase_path(abs, sizeof(abs), rel, sizeof(rel), G.sce, image->name, dir);
if (abs[0] != '\0') {
// make absolute source path
BLI_strncpy(src, image->name, sizeof(src));
BLI_path_abs(src, G.sce);
// make dest directory if it doesn't exist
BLI_make_existing_file(abs);
if (BLI_copy_fileops(src, abs) != 0) {
fprintf(stderr, "Cannot copy image to file's directory. \n");
}
}
if (find(mImages.begin(), mImages.end(), name) == mImages.end()) {
COLLADASW::Image img(COLLADABU::URI(COLLADABU::URI::nativePathToUri(rel)), name);
img.add(mSW);
mImages.push_back(name);
}
}
}
}
};
class EffectsExporter: COLLADASW::LibraryEffects
{
public:
EffectsExporter(COLLADASW::StreamWriter *sw) : COLLADASW::LibraryEffects(sw){}
void exportEffects(Scene *sce)
{
openLibrary();
forEachMaterialInScene(sce, *this);
closeLibrary();
}
void operator()(Material *ma, Object *ob)
{
// create a list of indices to textures of type TEX_IMAGE
std::vector<int> tex_indices;
createTextureIndices(ma, tex_indices);
openEffect(translate_id(id_name(ma)) + "-effect");
COLLADASW::EffectProfile ep(mSW);
ep.setProfileType(COLLADASW::EffectProfile::COMMON);
ep.openProfile();
// set shader type - one of three blinn, phong or lambert
if (ma->spec_shader == MA_SPEC_BLINN) {
ep.setShaderType(COLLADASW::EffectProfile::BLINN);
// shininess
ep.setShininess(ma->spec);
}
else if (ma->spec_shader == MA_SPEC_PHONG) {
ep.setShaderType(COLLADASW::EffectProfile::PHONG);
// shininess
// XXX not sure, stolen this from previous Collada plugin
ep.setShininess(ma->har / 4);
}
else {
// XXX write warning "Current shader type is not supported"
ep.setShaderType(COLLADASW::EffectProfile::LAMBERT);
}
// index of refraction
if (ma->mode & MA_RAYTRANSP) {
ep.setIndexOfRefraction(ma->ang);
}
else {
ep.setIndexOfRefraction(1.0f);
}
COLLADASW::ColorOrTexture cot;
// transparency
// Tod: because we are in A_ONE mode transparency is calculated like this:
ep.setTransparency(1.0f);
cot = getcol(0.0f, 0.0f, 0.0f, ma->alpha);
ep.setTransparent(cot);
// emission
cot=getcol(ma->emit, ma->emit, ma->emit, 1.0f);
ep.setEmission(cot);
// diffuse
cot = getcol(ma->r, ma->g, ma->b, 1.0f);
ep.setDiffuse(cot);
// ambient
cot = getcol(ma->ambr, ma->ambg, ma->ambb, 1.0f);
ep.setAmbient(cot);
// reflective, reflectivity
if (ma->mode & MA_RAYMIRROR) {
cot = getcol(ma->mirr, ma->mirg, ma->mirb, 1.0f);
ep.setReflective(cot);
ep.setReflectivity(ma->ray_mirror);
}
else {
cot = getcol(ma->specr, ma->specg, ma->specb, 1.0f);
ep.setReflective(cot);
ep.setReflectivity(ma->spec);
}
// specular
if (ep.getShaderType() != COLLADASW::EffectProfile::LAMBERT) {
cot = getcol(ma->specr, ma->specg, ma->specb, 1.0f);
ep.setSpecular(cot);
}
// XXX make this more readable if possible
// create <sampler> and <surface> for each image
COLLADASW::Sampler samplers[MAX_MTEX];
//COLLADASW::Surface surfaces[MAX_MTEX];
//void *samp_surf[MAX_MTEX][2];
void *samp_surf[MAX_MTEX][1];
// image to index to samp_surf map
// samp_surf[index] stores 2 pointers, sampler and surface
std::map<std::string, int> im_samp_map;
unsigned int a, b;
for (a = 0, b = 0; a < tex_indices.size(); a++) {
MTex *t = ma->mtex[tex_indices[a]];
Image *ima = t->tex->ima;
std::string key(id_name(ima));
key = translate_id(key);
// create only one <sampler>/<surface> pair for each unique image
if (im_samp_map.find(key) == im_samp_map.end()) {
//<newparam> <surface> <init_from>
// COLLADASW::Surface surface(COLLADASW::Surface::SURFACE_TYPE_2D,
// key + COLLADASW::Surface::SURFACE_SID_SUFFIX);
// COLLADASW::SurfaceInitOption sio(COLLADASW::SurfaceInitOption::INIT_FROM);
// sio.setImageReference(key);
// surface.setInitOption(sio);
//<newparam> <sampler> <source>
COLLADASW::Sampler sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D,
key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX,
key + COLLADASW::Sampler::SURFACE_SID_SUFFIX);
sampler.setImageId(key);
// copy values to arrays since they will live longer
samplers[a] = sampler;
//surfaces[a] = surface;
// store pointers so they can be used later when we create <texture>s
samp_surf[b][0] = &samplers[a];
//samp_surf[b][1] = &surfaces[a];
im_samp_map[key] = b;
b++;
}
}
// used as fallback when MTex->uvname is "" (this is pretty common)
// it is indeed the correct value to use in that case
std::string active_uv(getActiveUVLayerName(ob));
// write textures
// XXX very slow
for (a = 0; a < tex_indices.size(); a++) {
MTex *t = ma->mtex[tex_indices[a]];
Image *ima = t->tex->ima;
// we assume map input is always TEXCO_UV
std::string key(id_name(ima));
key = translate_id(key);
int i = im_samp_map[key];
COLLADASW::Sampler *sampler = (COLLADASW::Sampler*)samp_surf[i][0];
//COLLADASW::Surface *surface = (COLLADASW::Surface*)samp_surf[i][1];
std::string uvname = strlen(t->uvname) ? t->uvname : active_uv;
// color
if (t->mapto & MAP_COL) {
ep.setDiffuse(createTexture(ima, uvname, sampler));
}
// ambient
if (t->mapto & MAP_AMB) {
ep.setAmbient(createTexture(ima, uvname, sampler));
}
// specular
if (t->mapto & MAP_SPEC) {
ep.setSpecular(createTexture(ima, uvname, sampler));
}
// emission
if (t->mapto & MAP_EMIT) {
ep.setEmission(createTexture(ima, uvname, sampler));
}
// reflective
if (t->mapto & MAP_REF) {
ep.setReflective(createTexture(ima, uvname, sampler));
}
// alpha
if (t->mapto & MAP_ALPHA) {
ep.setTransparent(createTexture(ima, uvname, sampler));
}
// extension:
// Normal map --> Must be stored with <extra> tag as different technique,
// since COLLADA doesn't support normal maps, even in current COLLADA 1.5.
if (t->mapto & MAP_NORM) {
COLLADASW::Texture texture(key);
texture.setTexcoord(uvname);
texture.setSampler(*sampler);
// technique FCOLLADA, with the <bump> tag, is most likely the best understood,
// most widespread de-facto standard.
texture.setProfileName("FCOLLADA");
texture.setChildElementName("bump");
ep.addExtraTechniqueColorOrTexture(COLLADASW::ColorOrTexture(texture));
}
}
// performs the actual writing
ep.addProfileElements();
bool twoSided = false;
if (ob->type == OB_MESH && ob->data) {
Mesh *me = (Mesh*)ob->data;
if (me->flag & ME_TWOSIDED)
twoSided = true;
}
if (twoSided)
ep.addExtraTechniqueParameter("GOOGLEEARTH", "show_double_sided", 1);
ep.addExtraTechniques(mSW);
ep.closeProfile();
if (twoSided)
mSW->appendTextBlock("<extra><technique profile=\"MAX3D\"><double_sided>1</double_sided></technique></extra>");
closeEffect();
}
COLLADASW::ColorOrTexture createTexture(Image *ima,
std::string& uv_layer_name,
COLLADASW::Sampler *sampler
/*COLLADASW::Surface *surface*/)
{
COLLADASW::Texture texture(translate_id(id_name(ima)));
texture.setTexcoord(uv_layer_name);
//texture.setSurface(*surface);
texture.setSampler(*sampler);
COLLADASW::ColorOrTexture cot(texture);
return cot;
}
COLLADASW::ColorOrTexture getcol(float r, float g, float b, float a)
{
COLLADASW::Color color(r,g,b,a);
COLLADASW::ColorOrTexture cot(color);
return cot;
}
//returns the array of mtex indices which have image
//need this for exporting textures
void createTextureIndices(Material *ma, std::vector<int> &indices)
{
indices.clear();
for (int a = 0; a < MAX_MTEX; a++) {
if (ma->mtex[a] &&
ma->mtex[a]->tex &&
ma->mtex[a]->tex->type == TEX_IMAGE &&
ma->mtex[a]->texco == TEXCO_UV){
indices.push_back(a);
}
}
}
};
class MaterialsExporter: COLLADASW::LibraryMaterials
{
public:
MaterialsExporter(COLLADASW::StreamWriter *sw): COLLADASW::LibraryMaterials(sw){}
void exportMaterials(Scene *sce)
{
openLibrary();
forEachMaterialInScene(sce, *this);
closeLibrary();
}
void operator()(Material *ma, Object *ob)
{
std::string name(id_name(ma));
openMaterial(translate_id(name), name);
std::string efid = translate_id(name) + "-effect";
addInstanceEffect(COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, efid));
closeMaterial();
}
};
class CamerasExporter: COLLADASW::LibraryCameras
{
public:
CamerasExporter(COLLADASW::StreamWriter *sw): COLLADASW::LibraryCameras(sw){}
void exportCameras(Scene *sce)
{
openLibrary();
forEachCameraObjectInScene(sce, *this);
closeLibrary();
}
void operator()(Object *ob, Scene *sce)
{
// XXX add other params later
Camera *cam = (Camera*)ob->data;
std::string cam_id(get_camera_id(ob));
std::string cam_name(id_name(cam));
if (cam->type == CAM_PERSP) {
COLLADASW::PerspectiveOptic persp(mSW);
persp.setXFov(1.0);
persp.setAspectRatio(0.1);
persp.setZFar(cam->clipend);
persp.setZNear(cam->clipsta);
COLLADASW::Camera ccam(mSW, &persp, cam_id, cam_name);
addCamera(ccam);
}
else {
COLLADASW::OrthographicOptic ortho(mSW);
ortho.setXMag(1.0);
ortho.setAspectRatio(0.1);
ortho.setZFar(cam->clipend);
ortho.setZNear(cam->clipsta);
COLLADASW::Camera ccam(mSW, &ortho, cam_id, cam_name);
addCamera(ccam);
}
}
};
class LightsExporter: COLLADASW::LibraryLights
{
public:
LightsExporter(COLLADASW::StreamWriter *sw): COLLADASW::LibraryLights(sw){}
void exportLights(Scene *sce)
{
openLibrary();
forEachLampObjectInScene(sce, *this);
closeLibrary();
}
void operator()(Object *ob)
{
Lamp *la = (Lamp*)ob->data;
std::string la_id(get_light_id(ob));
std::string la_name(id_name(la));
COLLADASW::Color col(la->r, la->g, la->b);
float e = la->energy;
// sun
if (la->type == LA_SUN) {
COLLADASW::DirectionalLight cla(mSW, la_id, la_name, e);
cla.setColor(col);
addLight(cla);
}
// hemi
else if (la->type == LA_HEMI) {
COLLADASW::AmbientLight cla(mSW, la_id, la_name, e);
cla.setColor(col);
addLight(cla);
}
// spot
else if (la->type == LA_SPOT) {
COLLADASW::SpotLight cla(mSW, la_id, la_name, e);
cla.setColor(col);
cla.setFallOffAngle(la->spotsize);
cla.setFallOffExponent(la->spotblend);
cla.setLinearAttenuation(la->att1);
cla.setQuadraticAttenuation(la->att2);
addLight(cla);
}
// lamp
else if (la->type == LA_LOCAL) {
COLLADASW::PointLight cla(mSW, la_id, la_name, e);
cla.setColor(col);
cla.setLinearAttenuation(la->att1);
cla.setQuadraticAttenuation(la->att2);
addLight(cla);
}
// area lamp is not supported
// it will be exported as a local lamp
else {
COLLADASW::PointLight cla(mSW, la_id, la_name, e);
cla.setColor(col);
cla.setLinearAttenuation(la->att1);
cla.setQuadraticAttenuation(la->att2);
addLight(cla);
}
}
};
=======
>>>>>>> .merge-right.r35190
// TODO: it would be better to instantiate animations rather than create a new one per object
// COLLADA allows this through multiple <channel>s in <animation>.
// For this to work, we need to know objects that use a certain action.
@ -1432,17 +992,6 @@ void DocumentExporter::exportCurrentScene(Scene *sce, const char* filename)
asset.setUnit(unitname, linearmeasure);
asset.setUpAxisType(COLLADASW::Asset::Z_UP);
<<<<<<< .working
// TODO: need an Author field in userpref
asset.getContributor().mAuthor = "Blender User";
#ifdef NAN_BUILDINFO
char version_buf[128];
sprintf(version_buf, "Blender %d.%02d.%d r%s", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION, build_rev);
asset.getContributor().mAuthoringTool = version_buf;
#else
asset.getContributor().mAuthoringTool = "Blender 2.5x";
#endif
=======
// TODO: need an Author field in userpref
if(strlen(U.author) > 0) {
asset.getContributor().mAuthor = U.author;
@ -1457,7 +1006,6 @@ void DocumentExporter::exportCurrentScene(Scene *sce, const char* filename)
#else
asset.getContributor().mAuthoringTool = "Blender 2.5x";
#endif
>>>>>>> .merge-right.r35190
asset.add();
// <library_cameras>

@ -951,7 +951,7 @@ static void calc_shapeKeys(Object *obedit)
++i;
}
fp+= 3; curofp+= 3; /* alphas */
fp+= 3; /* alphas */
} else {
for (j= 0; j < 3; ++j, ++i) {
VECCOPY(fp, bezt->vec[j]);
@ -1234,7 +1234,6 @@ void make_editNurb(Object *obedit)
Nurb *nu, *newnu, *nu_act= NULL;
KeyBlock *actkey;
if(obedit==NULL) return;
set_actNurb(obedit, NULL);
@ -1591,7 +1590,7 @@ static int deleteflagNurb(bContext *C, wmOperator *UNUSED(op), int flag)
BPoint *bp, *bpn, *newbp;
int a, b, newu, newv, sel;
if(obedit && obedit->type==OB_SURF);
if(obedit->type==OB_SURF);
else return OPERATOR_CANCELLED;
cu->lastsel= NULL;
@ -2855,7 +2854,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
int a, b, sel, amount, *usel, *vsel, i;
float factor;
// printf("*** subdivideNurb: entering subdivide\n");
// printf("*** subdivideNurb: entering subdivide\n");
for(nu= editnurb->nurbs.first; nu; nu= nu->next) {
amount= 0;
@ -3031,7 +3030,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
/* This is a very strange test ... */
/**
Subdivide NURB surfaces - nzc 30-5-'00 -
Subdivision of a NURB curve can be effected by adding a
control point (insertion of a knot), or by raising the
degree of the functions used to build the NURB. The
@ -3231,8 +3230,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
MEM_freeN(nu->bp);
nu->bp= bpnew;
nu->pntsu+= sel;
nurbs_knot_calc_u(nu); /* shift knots
forward */
nurbs_knot_calc_u(nu); /* shift knots forward */
}
}
}
@ -3581,7 +3579,7 @@ void CURVE_OT_spline_type_set(wmOperatorType *ot)
/* identifiers */
ot->name= "Set Spline Type";
ot->description = "Set type of actibe spline";
ot->description = "Set type of active spline";
ot->idname= "CURVE_OT_spline_type_set";
/* api callbacks */
@ -4171,7 +4169,7 @@ void CURVE_OT_make_segment(wmOperatorType *ot)
/***************** pick select from 3d view **********************/
int mouse_nurb(bContext *C, short mval[2], int extend)
int mouse_nurb(bContext *C, const short mval[2], int extend)
{
Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data;
@ -4413,11 +4411,10 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
Nurb *nu, *newnu= NULL;
BezTriple *bezt, *newbezt = NULL;
BPoint *bp, *newbp = NULL;
float mat[3][3],imat[3][3], temp[3];
float imat[4][4], temp[3];
int ok= 0;
copy_m3_m4(mat, obedit->obmat);
invert_m3_m3(imat,mat);
invert_m4_m4(imat, obedit->obmat);
findselectedNurbvert(&editnurb->nurbs, &nu, &bezt, &bp);
@ -4451,10 +4448,14 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
temp[0] = 1;
temp[1] = 0;
temp[2] = 0;
copy_v3_v3(newbezt->vec[1], location);
sub_v3_v3(newbezt->vec[1], obedit->obmat[3]);
sub_v3_v3v3(newbezt->vec[0], newbezt->vec[1],temp);
add_v3_v3v3(newbezt->vec[2], newbezt->vec[1],temp);
sub_v3_v3v3(newbezt->vec[0], newbezt->vec[1], temp);
add_v3_v3v3(newbezt->vec[2], newbezt->vec[1], temp);
mul_m4_v3(imat, newbezt->vec[0]);
mul_m4_v3(imat, newbezt->vec[1]);
mul_m4_v3(imat, newbezt->vec[2]);
ok= 1;
nu= newnu;
@ -4473,9 +4474,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
newnu->orderu= 2;
newnu->pntsu= 1;
copy_v3_v3(newbp->vec, location);
sub_v3_v3(newbp->vec, obedit->obmat[3]);
mul_m3_v3(imat,newbp->vec);
mul_v3_m4v3(newbp->vec, imat, location);
newbp->vec[3]= 1.0;
newnu->knotsu= newnu->knotsv= NULL;
@ -4555,9 +4554,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
copy_v3_v3(newbezt->vec[2], bezt->vec[2]);
}
else {
copy_v3_v3(newbezt->vec[1], location);
sub_v3_v3(newbezt->vec[1], obedit->obmat[3]);
mul_m3_v3(imat,newbezt->vec[1]);
mul_v3_m4v3(newbezt->vec[1], imat, location);
sub_v3_v3v3(temp, newbezt->vec[1],temp);
add_v3_v3v3(newbezt->vec[0], bezt->vec[0],temp);
add_v3_v3v3(newbezt->vec[2], bezt->vec[2],temp);
@ -4622,9 +4619,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
copy_v3_v3(newbp->vec, bp->vec);
}
else {
copy_v3_v3(newbp->vec, location);
sub_v3_v3(newbp->vec, obedit->obmat[3]);
mul_m3_v3(imat,newbp->vec);
mul_v3_m4v3(newbp->vec, imat, location);
newbp->vec[3]= 1.0;
if(!newnu && nu->orderu<4 && nu->orderu<=nu->pntsu)
@ -4666,13 +4661,33 @@ static int add_vertex_exec(bContext *C, wmOperator *op)
static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
RegionView3D *rv3d= CTX_wm_region_view3d(C);
ViewContext vc;
float location[3] = {0.0f, 0.0f, 0.0f};
short mval[2];
if(rv3d && !RNA_property_is_set(op->ptr, "location")) {
Curve *cu;
ViewContext vc;
float location[3];
short mval[2];
Nurb *nu;
BezTriple *bezt;
BPoint *bp;
view3d_set_viewcontext(C, &vc);
cu= vc.obedit->data;
findselectedNurbvert(&cu->editnurb->nurbs, &nu, &bezt, &bp);
if(bezt) {
mul_v3_m4v3(location, vc.obedit->obmat, bezt->vec[1]);
}
else if (bp) {
mul_v3_m4v3(location, vc.obedit->obmat, bp->vec);
}
else {
copy_v3_v3(location, give_cursor(vc.scene, vc.v3d));
}
mval[0]= event->x - vc.ar->winrct.xmin;
mval[1]= event->y - vc.ar->winrct.ymin;
@ -4980,8 +4995,8 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
int a, location[2], deselect;
deselect= RNA_boolean_get(op->ptr, "deselect");
location[0]= event->x - ar->winrct.xmin;
location[1]= event->y - ar->winrct.ymin;
location[0]= event->x - ar->winrct.xmin;
location[1]= event->y - ar->winrct.ymin;
view3d_operator_needs_opengl(C);
view3d_set_viewcontext(C, &vc);
@ -5622,7 +5637,7 @@ static int duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CURVE_OT_duplicate(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Duplicate";
ot->name= "Duplicate Curve";
ot->description = "Duplicate selected control points and segments between them";
ot->idname= "CURVE_OT_duplicate";
@ -5646,7 +5661,7 @@ static int delete_exec(bContext *C, wmOperator *op)
Curve *cu= obedit->data;
EditNurb *editnurb= cu->editnurb;
ListBase *nubase= &editnurb->nurbs;
Nurb *nu, *next, *nu1;
Nurb *nu, *nu1;
BezTriple *bezt, *bezt1, *bezt2;
BPoint *bp, *bp1, *bp2;
int a, cut= 0, type= RNA_enum_get(op->ptr, "type");
@ -5671,6 +5686,7 @@ static int delete_exec(bContext *C, wmOperator *op)
if(type==0) {
/* first loop, can we remove entire pieces? */
Nurb *next;
nu= nubase->first;
while(nu) {
next= nu->next;
@ -5799,7 +5815,6 @@ static int delete_exec(bContext *C, wmOperator *op)
nu1= NULL;
nuindex= 0;
for(nu= nubase->first; nu; nu= nu->next) {
next= nu->next;
if(nu->type == CU_BEZIER) {
bezt= nu->bezt;
for(a=0; a<nu->pntsu-1; a++) {
@ -6542,12 +6557,12 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
ListBase *editnurb;
Nurb *nu;
int newob= 0;
int enter_editmode;
int enter_editmode, is_aligned;
unsigned int layer;
float loc[3], rot[3];
float mat[4][4];
if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &is_aligned))
return OPERATOR_CANCELLED;
if (!isSurf) { /* adding curve */
@ -6647,7 +6662,7 @@ static int add_primitive_bezier_circle_exec(bContext *C, wmOperator *op)
void CURVE_OT_primitive_bezier_circle_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Circle";
ot->name= "Add Bezier Circle";
ot->description= "Construct a Bezier Circle";
ot->idname= "CURVE_OT_primitive_bezier_circle_add";
@ -6940,7 +6955,7 @@ static void *undo_check_lastsel(void *lastsel, Nurb *nu, Nurb *newnu)
return NULL;
}
static void undoCurve_to_editCurve(void *ucu, void *obe, void *obdata)
static void undoCurve_to_editCurve(void *ucu, void *edata, void *obe)
{
Object *obedit= obe;
Curve *cu= (Curve*)obedit->data;
@ -6990,7 +7005,7 @@ static void undoCurve_to_editCurve(void *ucu, void *obe, void *obdata)
ED_curve_updateAnimPaths(obedit);
}
static void *editCurve_to_undoCurve(void *obe, void *cue)
static void *editCurve_to_undoCurve(void *edata, void *obe)
{
Object *obedit= obe;
Curve *cu= (Curve*)obedit->data;

@ -1769,7 +1769,7 @@ void FONT_OT_unlink(wmOperatorType *ot)
/* **************** undo for font object ************** */
static void undoFont_to_editFont(void *strv, void *ecu, void *obdata)
static void undoFont_to_editFont(void *strv, void *ecu, void *UNUSED(obdata))
{
Curve *cu= (Curve *)ecu;
EditFont *ef= cu->editfont;
@ -1786,7 +1786,7 @@ static void undoFont_to_editFont(void *strv, void *ecu, void *obdata)
update_string(cu);
}
static void *editFont_to_undoFont(void *ecu, void *obdata)
static void *editFont_to_undoFont(void *ecu, void *UNUSED(obdata))
{
Curve *cu= (Curve *)ecu;
EditFont *ef= cu->editfont;

@ -75,14 +75,16 @@
/* ----- General Defines ------ */
/* flags for sflag */
enum {
typedef enum eDrawStrokeFlags {
GP_DRAWDATA_NOSTATUS = (1<<0), /* don't draw status info */
GP_DRAWDATA_ONLY3D = (1<<1), /* only draw 3d-strokes */
GP_DRAWDATA_ONLYV2D = (1<<2), /* only draw 'canvas' strokes */
GP_DRAWDATA_ONLYI2D = (1<<3), /* only draw 'image' strokes */
GP_DRAWDATA_IEDITHACK = (1<<4), /* special hack for drawing strokes in Image Editor (weird coordinates) */
GP_DRAWDATA_NO_XRAY = (1<<5), /* dont draw xray in 3D view (which is default) */
};
} eDrawStrokeFlags;
/* thickness above which we should use special drawing */
#define GP_DRAWTHICKNESS_SPECIAL 3
@ -152,7 +154,7 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick
/* ----- Existing Strokes Drawing (3D and Point) ------ */
/* draw a given stroke - just a single dot (only one point) */
static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short sflag, int offsx, int offsy, int winx, int winy)
static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short dflag, short sflag, int offsx, int offsy, int winx, int winy)
{
/* draw point */
if (sflag & GP_STROKE_3DSPACE) {
@ -161,7 +163,6 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short sfl
glEnd();
}
else {
// int spacetype= 0; // XXX make local gpencil state var?
float co[2];
/* get coordinates of point */
@ -181,12 +182,8 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short sfl
/* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, simple dot looks ok
* - also mandatory in if Image Editor 'image-based' dot
*/
#if 0
if ( (thickness < GP_DRAWTHICKNESS_SPECIAL) ||
((spacetype==SPACE_IMAGE) && (sflag & GP_STROKE_2DSPACE)) )
#else
if(1) /* when spacetype is back uncomment the check above */
#endif
((dflag & GP_DRAWDATA_IEDITHACK) && (sflag & GP_STROKE_2DSPACE)) )
{
glBegin(GL_POINTS);
glVertex2fv(co);
@ -510,15 +507,16 @@ static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int
/* check which stroke-drawer to use */
if (gps->totpoints == 1)
gp_draw_stroke_point(gps->points, lthick, gps->flag, offsx, offsy, winx, winy);
gp_draw_stroke_point(gps->points, lthick, dflag, gps->flag, offsx, offsy, winx, winy);
else if (dflag & GP_DRAWDATA_ONLY3D) {
const int no_xray= (dflag & GP_DRAWDATA_NO_XRAY);
int mask_orig;
if(no_xray) {
int mask_orig = 0;
if (no_xray) {
glGetIntegerv(GL_DEPTH_WRITEMASK, &mask_orig);
glDepthMask(0);
glEnable(GL_DEPTH_TEST);
/* first arg is normally rv3d->dist, but this isnt available here and seems to work quite well without */
bglPolygonOffset(1.0f, 1.0f);
/*
@ -526,13 +524,13 @@ static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int
glPolygonOffset(-1.0f, -1.0f);
*/
}
gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, debug);
if(no_xray) {
if (no_xray) {
glDepthMask(mask_orig);
glDisable(GL_DEPTH_TEST);
bglPolygonOffset(0.0, 0.0);
/*
glDisable(GL_POLYGON_OFFSET_LINE);
@ -549,7 +547,6 @@ static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int
static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag)
{
bGPDlayer *gpl;
// bGPDlayer *actlay=NULL; // UNUSED
/* reset line drawing style (in case previous user didn't reset) */
setlinestyle(0);
@ -573,10 +570,6 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
if (gpl->flag & GP_LAYER_HIDE)
continue;
/* if layer is active one, store pointer to it */
// if (gpl->flag & GP_LAYER_ACTIVE)
// actlay= gpl;
/* get frame to draw */
gpf= gpencil_layer_getframe(gpl, cfra, 0);
if (gpf == NULL)
@ -588,11 +581,11 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
QUATCOPY(tcolor, gpl->color); // additional copy of color (for ghosting)
glColor4f(color[0], color[1], color[2], color[3]);
glPointSize((float)(gpl->thickness + 2));
/* apply xray layer setting */
if(gpl->flag & GP_LAYER_NO_XRAY) dflag |= GP_DRAWDATA_NO_XRAY;
if (gpl->flag & GP_LAYER_NO_XRAY) dflag |= GP_DRAWDATA_NO_XRAY;
else dflag &= ~GP_DRAWDATA_NO_XRAY;
/* draw 'onionskins' (frame left + right) */
if (gpl->flag & GP_LAYER_ONIONSKIN) {
/* drawing method - only immediately surrounding (gstep = 0), or within a frame range on either side (gstep > 0)*/
@ -791,11 +784,11 @@ void draw_gpencil_view3d_ext (Scene *scene, View3D *v3d, ARegion *ar, short only
/* check that we have grease-pencil stuff to draw */
gpd= gpencil_data_get_active_v3d(scene); // XXX
if(gpd == NULL) return;
if (gpd == NULL) return;
/* when rendering to the offscreen buffer we dont want to
* deal with the camera border, otherwise map the coords to the camera border. */
if(rv3d->persp == RV3D_CAMOB && !(G.f & G_RENDER_OGL)) {
if ((rv3d->persp == RV3D_CAMOB) && !(G.f & G_RENDER_OGL)) {
rctf rectf;
view3d_calc_camera_border(scene, ar, rv3d, v3d, &rectf, -1); /* negative shift */
BLI_copy_rcti_rctf(&rect, &rectf);

@ -933,8 +933,8 @@ static tGPsdata *gp_session_initpaint (bContext *C)
/* supported views first */
case SPACE_VIEW3D:
{
View3D *v3d= curarea->spacedata.first;
RegionView3D *rv3d= ar->regiondata;
// View3D *v3d= curarea->spacedata.first;
// RegionView3D *rv3d= ar->regiondata;
/* set current area
* - must verify that region data is 3D-view (and not something else)
@ -949,12 +949,6 @@ static tGPsdata *gp_session_initpaint (bContext *C)
return p;
}
/* for camera view set the subrect */
if(rv3d->persp == RV3D_CAMOB) {
view3d_calc_camera_border(p->scene, p->ar, NULL, v3d, &p->subrect_data, 1);
p->subrect= &p->subrect_data;
}
#if 0 // XXX will this sort of antiquated stuff be restored?
/* check that gpencil data is allowed to be drawn */
if ((v3d->flag2 & V3D_DISPGP)==0) {

@ -66,7 +66,7 @@ void free_editNurb (struct Object *obedit);
void free_curve_editNurb (struct Curve *cu);
int mouse_nurb (struct bContext *C, short mval[2], int extend);
int mouse_nurb (struct bContext *C, const short mval[2], int extend);
struct Nurb *add_nurbs_primitive(struct bContext *C, float mat[4][4], int type, int newob);

@ -153,10 +153,16 @@ void uiStyleFontDrawExt(uiFontStyle *fs, rcti *rect, const char *str,
height= BLF_height(fs->uifont_id, "2"); /* correct offset is on baseline, the j is below that */
yofs= floor( 0.5f*(rect->ymax - rect->ymin - height));
if(fs->align==UI_STYLE_TEXT_CENTER)
if(fs->align==UI_STYLE_TEXT_CENTER) {
xofs= floor( 0.5f*(rect->xmax - rect->xmin - BLF_width(fs->uifont_id, str)));
else if(fs->align==UI_STYLE_TEXT_RIGHT)
/* don't center text if it chops off the start of the text, 2 gives some margin */
if(xofs < 2) {
xofs= 2;
}
}
else if(fs->align==UI_STYLE_TEXT_RIGHT) {
xofs= rect->xmax - rect->xmin - BLF_width(fs->uifont_id, str) - 1;
}
/* clip is very strict, so we give it some space */
BLF_clipping(fs->uifont_id, rect->xmin-1, rect->ymin-4, rect->xmax+1, rect->ymax+4);

@ -120,7 +120,6 @@ void EDBM_select_mirrored(Object *obedit, BMEditMesh *em)
void EDBM_automerge(Scene *scene, Object *obedit, int update)
{
BMEditMesh *em;
int len;
if ((scene->toolsettings->automerge) &&
(obedit && obedit->type==OB_MESH) &&
@ -453,7 +452,7 @@ float labda_PdistVL2Dfl( float *v1, float *v2, float *v3)
}
/* note; uses v3d, so needs active 3d window */
static void findnearestedge__doClosest(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int index)
static void findnearestedge__doClosest(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int UNUSED(index))
{
struct { ViewContext vc; float mval[2]; int dist; BMEdge *closest; } *data = userData;
float v1[2], v2[2];
@ -525,7 +524,7 @@ BMEdge *EDBM_findnearestedge(ViewContext *vc, int *dist)
}
}
static void findnearestface__getDistance(void *userData, BMFace *efa, int x, int y, int index)
static void findnearestface__getDistance(void *userData, BMFace *efa, int x, int y, int UNUSED(index))
{
struct { short mval[2]; int dist; BMFace *toFace; } *data = userData;
@ -690,7 +689,6 @@ static EnumPropertyItem prop_similar_types[] = {
static int similar_face_select_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_edit_object(C);
BMEditMesh *em = ((Mesh*)ob->data)->edit_btmesh;
BMOperator bmop;
@ -731,7 +729,6 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
/* wrap the above function but do selection flushing edge to face */
static int similar_edge_select_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_edit_object(C);
BMEditMesh *em = ((Mesh*)ob->data)->edit_btmesh;
BMOperator bmop;
@ -778,7 +775,6 @@ VERT GROUP
static int similar_vert_select_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_edit_object(C);
BMEditMesh *em = ((Mesh*)ob->data)->edit_btmesh;
BMOperator bmop;
@ -824,7 +820,7 @@ static int select_similar_exec(bContext *C, wmOperator *op)
return similar_face_select_exec(C, op);
}
static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *ptr, int *free)
static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free)
{
Object *obedit = CTX_data_edit_object(C);
EnumPropertyItem *item= NULL;
@ -899,7 +895,7 @@ static void walker_select(BMEditMesh *em, int walkercode, void *start, int selec
BMW_End(&walker);
}
static int loop_multiselect(bContext *C, wmOperator *op)
static int loop_multiselect(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0 //BMESH_TODO
Object *obedit= CTX_data_edit_object(C);
@ -1056,7 +1052,7 @@ void MESH_OT_loop_select(wmOperatorType *ot)
/* ******************* mesh shortest path select, uses prev-selected edge ****************** */
/* since you want to create paths with multiple selects, it doesn't have extend option */
static void mouse_mesh_shortest_path(bContext *C, short mval[2])
static void mouse_mesh_shortest_path(bContext *UNUSED(C), short UNUSED(mval[2]))
{
#if 0 //BMESH_TODO
ViewContext vc;
@ -1125,7 +1121,7 @@ static void mouse_mesh_shortest_path(bContext *C, short mval[2])
}
static int mesh_shortest_path_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int mesh_shortest_path_select_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
view3d_operator_needs_opengl(C);
@ -1306,7 +1302,6 @@ void EDBM_selectmode_set(BMEditMesh *em)
void EDBM_convertsel(BMEditMesh *em, short oldmode, short selectmode)
{
BMVert *eve;
BMEdge *eed;
BMFace *efa;
BMIter iter;
@ -1392,7 +1387,7 @@ void EDBM_select_swap(BMEditMesh *em) /* exported for UV */
// if (EM_texFaceCheck())
}
static int select_inverse_mesh_exec(bContext *C, wmOperator *op)
static int select_inverse_mesh_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh;
@ -1429,9 +1424,7 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
BMVert *eve;
BMEdge *e, *eed;
BMFace *efa;
short done=1, toggle=0;
int sel= !RNA_boolean_get(op->ptr, "deselect");
int limit= RNA_boolean_get(op->ptr, "limit");
/* unified_finednearest needs ogl */
view3d_operator_needs_opengl(C);
@ -1501,7 +1494,7 @@ void MESH_OT_select_linked_pick(wmOperatorType *ot)
}
static int select_linked_exec(bContext *C, wmOperator *op)
static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
@ -1875,9 +1868,9 @@ void em_deselect_nth_vert(EditMesh *em, int nth, EditVert *eve_act)
}
#endif
int EM_deselect_nth(EditMesh *em, int nth)
int EM_deselect_nth(BMEditMesh *em, int nth)
{
#if 0
#if 0 //BMESH_TODO
EditSelection *ese;
ese = ((EditSelection*)em->selected.last);
if(ese) {
@ -1933,7 +1926,6 @@ static int select_sharp_edges_exec(bContext *C, wmOperator *op)
BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh;
BMIter iter;
BMEdge *e;
BLI_array_declare(stack);
BMLoop *l1, *l2;
float sharp = RNA_float_get(op->ptr, "sharpness"), angle;
@ -2170,7 +2162,7 @@ void MESH_OT_select_random(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "extend", 0, "Extend Selection", "Extend selection instead of deselecting everything first.");
}
static int select_next_loop(bContext *C, wmOperator *op)
static int select_next_loop(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
BMEditMesh *em= (((Mesh *)obedit->data))->edit_btmesh;
@ -2220,7 +2212,7 @@ void MESH_OT_select_next_loop(wmOperatorType *ot)
}
static int region_to_loop(bContext *C, wmOperator *op)
static int region_to_loop(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh;

@ -377,7 +377,7 @@ short EDBM_Extrude_edges_indiv(BMEditMesh *em, short flag, float *nor)
#endif
/* extrudes individual vertices */
short EDBM_Extrude_verts_indiv(BMEditMesh *em, wmOperator *op, short flag, float *nor)
short EDBM_Extrude_verts_indiv(BMEditMesh *em, wmOperator *op, short flag, float *UNUSED(nor))
{
BMOperator bmop;
@ -3806,12 +3806,14 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO
return 1;
}
static int mesh_separate_material(Main *bmain, Scene *scene, Base *editbase, wmOperator *wmop)
//BMESH_TODO
static int mesh_separate_material(Main *UNUSED(bmain), Scene *UNUSED(scene), Base *UNUSED(editbase), wmOperator *UNUSED(wmop))
{
return 0;
}
static int mesh_separate_loose(Main *bmain, Scene *scene, Base *editbase, wmOperator *wmop)
//BMESH_TODO
static int mesh_separate_loose(Main *UNUSED(bmain), Scene *UNUSED(scene), Base *UNUSED(editbase), wmOperator *UNUSED(wmop))
{
return 0;
}
@ -4010,7 +4012,7 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot)
}
static int edge_flip_exec(bContext *C, wmOperator *op)
static int edge_flip_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@ -4040,7 +4042,8 @@ void MESH_OT_edge_flip(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int split_mesh(bContext *C, wmOperator *op)
//BMESH_TODO
static int split_mesh(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@ -4079,7 +4082,7 @@ void MESH_OT_split(wmOperatorType *ot)
}
static int spin_mesh(bContext *C, wmOperator *op, float *dvec, int steps, float degr, int dupli )
static int spin_mesh(bContext *UNUSED(C), wmOperator *UNUSED(op), float *UNUSED(dvec), int UNUSED(steps), float UNUSED(degr), int UNUSED(dupli) )
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@ -4164,7 +4167,7 @@ static int spin_mesh(bContext *C, wmOperator *op, float *dvec, int steps, float
return OPERATOR_CANCELLED;
}
static int spin_mesh_exec(bContext *C, wmOperator *op)
static int spin_mesh_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@ -4183,7 +4186,7 @@ static int spin_mesh_exec(bContext *C, wmOperator *op)
}
/* get center and axis, in global coords */
static int spin_mesh_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int spin_mesh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
#if 0
Scene *scene = CTX_data_scene(C);
@ -4221,7 +4224,7 @@ void MESH_OT_spin(wmOperatorType *ot)
}
static int screw_mesh_exec(bContext *C, wmOperator *op)
static int screw_mesh_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@ -4295,7 +4298,7 @@ static int screw_mesh_exec(bContext *C, wmOperator *op)
}
/* get center and axis, in global coords */
static int screw_mesh_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int screw_mesh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
#if 0
Scene *scene = CTX_data_scene(C);
@ -4330,7 +4333,7 @@ void MESH_OT_screw(wmOperatorType *ot)
RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f, "Axis", "Axis in global view space", -FLT_MAX, FLT_MAX);
}
int select_by_number_vertices_exec(bContext *C, wmOperator *op)
int select_by_number_vertices_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
#if 0
Object *obedit= CTX_data_edit_object(C);
@ -4490,7 +4493,7 @@ static void xsortvert_flag__doSetX(void *userData, EditVert *UNUSED(eve), int x,
}
/* all verts with (flag & 'flag') are sorted */
static void xsortvert_flag(bContext *C, int flag)
static void xsortvert_flag(bContext *UNUSED(C), int UNUSED(flag))
{
#if 0 //hrm, geometry isn't in linked lists anymore. . .
ViewContext vc;
@ -4814,7 +4817,7 @@ static int mesh_export_obj_exec(bContext *C, wmOperator *op)
MPoly *mpoly, *mp;
MTexPoly *mtexpoly;
MLoopUV *luv, *mloopuv;
MLoopCol *lcol, *mloopcol;
MLoopCol *mloopcol;
FILE *file, *matfile;
int *face_mat_group;
struct {Material *mat; MTexPoly poly; int end;} **matlists;

@ -146,7 +146,7 @@ int EDBM_InitOpf(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *f
/*returns 0 on error, 1 on success. executes and finishes a bmesh operator*/
int EDBM_FinishOp(BMEditMesh *em, BMOperator *bmop, wmOperator *op, int report) {
char *errmsg;
const char *errmsg;
BMO_Finish_Op(em->bm, bmop);
@ -262,10 +262,9 @@ void EDBM_selectmode_to_scene(Scene *scene, Object *obedit)
scene->toolsettings->selectmode = em->selectmode;
}
void EDBM_MakeEditBMesh(ToolSettings *ts, Scene *scene, Object *ob)
void EDBM_MakeEditBMesh(ToolSettings *ts, Scene *UNUSED(scene), Object *ob)
{
Mesh *me = ob->data;
EditMesh *em;
BMesh *bm;
if (!me->mpoly && me->totface) {
@ -418,7 +417,7 @@ void EDBM_select_flush(BMEditMesh *em, int selectmode)
}
/*BMESH_TODO*/
void EDBM_deselect_flush(BMEditMesh *em)
void EDBM_deselect_flush(BMEditMesh *UNUSED(em))
{
}
@ -588,7 +587,7 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata)
return me;
}
static void undoMesh_to_editbtMesh(void *umv, void *emv, void *obdata)
static void undoMesh_to_editbtMesh(void *umv, void *emv, void *UNUSED(obdata))
{
BMEditMesh *em = emv, *em2;
Object *ob;
@ -823,8 +822,8 @@ void EDBM_CacheMirrorVerts(BMEditMesh *em)
em->mirr_free_arrays = 1;
}
if (!CustomData_get_layer_named(&em->bm->vdata, CD_PROP_INT, "__mirror_index")) {
BM_add_data_layer_named(em->bm, &em->bm->vdata, CD_PROP_INT, "__mirror_index");
if (!CustomData_get_layer_named(&em->bm->vdata, CD_PROP_INT, (char*)"__mirror_index")) {
BM_add_data_layer_named(em->bm, &em->bm->vdata, CD_PROP_INT, (char*)"__mirror_index");
}
li = CustomData_get_named_layer_index(&em->bm->vdata, CD_PROP_INT, "__mirror_index");

@ -300,7 +300,7 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot)
/* props */
RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 3, 500);
RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
RNA_def_enum(ot->srna, "fill_type", &fill_type_items, 0, "Fill Type", "");
RNA_def_enum(ot->srna, "fill_type", fill_type_items, 0, "Fill Type", "");
ED_object_add_generic_props(ot, TRUE);
}
@ -355,7 +355,7 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot)
RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 2, 500);
RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
RNA_def_float(ot->srna, "depth", 1.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00);
RNA_def_enum(ot->srna, "end_fill_type", &fill_type_items, 1, "Cap Fill Type", "");
RNA_def_enum(ot->srna, "end_fill_type", fill_type_items, 1, "Cap Fill Type", "");
ED_object_add_generic_props(ot, TRUE);
}
@ -411,7 +411,7 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot)
RNA_def_float(ot->srna, "radius1", 1.0f, 0.0, FLT_MAX, "Radius 1", "", 0.001, 100.00);
RNA_def_float(ot->srna, "radius2", 0.0f, 0.0, FLT_MAX, "Radius 2", "", 0.001, 100.00);
RNA_def_float(ot->srna, "depth", 1.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00);
RNA_def_enum(ot->srna, "end_fill_type", &fill_type_items, 1, "Base Fill Type", "");
RNA_def_enum(ot->srna, "end_fill_type", fill_type_items, 1, "Base Fill Type", "");
ED_object_add_generic_props(ot, TRUE);
}

@ -663,7 +663,6 @@ void scale_point(float *c1, float *p, float s)
int BMBVH_EdgeVisible(BMBVHTree *tree, BMEdge *e, ARegion *ar, View3D *v3d, Object *obedit)
{
BMFace *f;
RegionView3D *rv3d = ar->regiondata;
float co1[3], co2[3], co3[3], dir1[4], dir2[4], dir3[4];
float origin[3], invmat[4][4];
float epsilon = 0.01f;

@ -249,7 +249,7 @@ int ED_mesh_uv_texture_remove(bContext *C, Object *ob, Mesh *me)
return 1;
}
int ED_mesh_color_add(bContext *C, Scene *scene, Object *ob, Mesh *me, const char *name, int active_set)
int ED_mesh_color_add(bContext *C, Scene *UNUSED(scene), Object *UNUSED(ob), Mesh *me, const char *name, int active_set)
{
BMEditMesh *em;
MLoopCol *mcol;

@ -556,7 +556,7 @@ static void freeMetaElemlist(ListBase *lb)
}
static void undoMball_to_editMball(void *lbu, void *lbe, void *obdata)
static void undoMball_to_editMball(void *lbu, void *lbe, void *obe)
{
ListBase *lb= lbu;
ListBase *editelems= lbe;
@ -574,7 +574,7 @@ static void undoMball_to_editMball(void *lbu, void *lbe, void *obdata)
}
static void *editMball_to_undoMball(void *lbe, void *obdata)
static void *editMball_to_undoMball(void *lbe, void *obe)
{
ListBase *editelems= lbe;
ListBase *lb;

@ -1455,8 +1455,8 @@ void ED_screen_set_scene(bContext *C, Scene *scene)
if(rv3d->persp==RV3D_CAMOB)
rv3d->persp= RV3D_PERSP;
}
}
}
}
}
}
}

@ -1319,36 +1319,36 @@ static void pchan_draw_IK_root_lines(bPoseChannel *pchan, short only_temp)
switch (con->type) {
case CONSTRAINT_TYPE_KINEMATIC:
{
bKinematicConstraint *data = (bKinematicConstraint*)con->data;
int segcount= 0;
/* if only_temp, only draw if it is a temporary ik-chain */
if ((only_temp) && !(data->flag & CONSTRAINT_IK_TEMP))
continue;
setlinestyle(3);
glBegin(GL_LINES);
/* exclude tip from chain? */
if ((data->flag & CONSTRAINT_IK_TIP)==0)
parchan= pchan->parent;
else
parchan= pchan;
glVertex3fv(parchan->pose_tail);
/* Find the chain's root */
while (parchan->parent) {
segcount++;
if(segcount==data->rootbone || segcount>255) break; // 255 is weak
parchan= parchan->parent;
bKinematicConstraint *data = (bKinematicConstraint*)con->data;
int segcount= 0;
/* if only_temp, only draw if it is a temporary ik-chain */
if ((only_temp) && !(data->flag & CONSTRAINT_IK_TEMP))
continue;
setlinestyle(3);
glBegin(GL_LINES);
/* exclude tip from chain? */
if ((data->flag & CONSTRAINT_IK_TIP)==0)
parchan= pchan->parent;
else
parchan= pchan;
glVertex3fv(parchan->pose_tail);
/* Find the chain's root */
while (parchan->parent) {
segcount++;
if(segcount==data->rootbone || segcount>255) break; // 255 is weak
parchan= parchan->parent;
}
if (parchan)
glVertex3fv(parchan->pose_head);
glEnd();
setlinestyle(0);
}
if (parchan)
glVertex3fv(parchan->pose_head);
glEnd();
setlinestyle(0);
}
break;
case CONSTRAINT_TYPE_SPLINEIK:
{
@ -1367,7 +1367,7 @@ static void pchan_draw_IK_root_lines(bPoseChannel *pchan, short only_temp)
// FIXME: revise the breaking conditions
if(segcount==data->chainlen || segcount>255) break; // 255 is weak
parchan= parchan->parent;
}
}
if (parchan) // XXX revise the breaking conditions to only stop at the tail?
glVertex3fv(parchan->pose_head);
@ -1826,9 +1826,9 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
glLoadName(index & 0xFFFF);
pchan_draw_IK_root_lines(pchan, !(do_dashed & 2));
}
}
}
}
}
}
glPushMatrix();

@ -311,7 +311,6 @@ enum {
MOD_DISP_DIR_Z,
MOD_DISP_DIR_NOR,
MOD_DISP_DIR_RGB_XYZ,
MOD_DISP_TANGENT,
};
/* DisplaceModifierData->texmapping */

@ -131,7 +131,7 @@ typedef struct Object {
/* materials */
struct Material **mat; /* material slots */
char *matbits; /* a bitfield, with each bit 1 if corrusponding material linked to object */
char *matbits; /* a boolean field, with each byte 1 if corrusponding material is linked to object */
int totcol; /* copy of mesh or curve or meta */
int actcol; /* currently selected material in the UI */

File diff suppressed because it is too large Load Diff

@ -1,4 +1,3 @@
<<<<<<< .working
cd ../../../../
./blender.bin --background --python ./release/scripts/modules/rna_info.py 2> source/blender/makesrna/rna_cleanup/out.txt
cd ./source/blender/makesrna/rna_cleanup/
@ -12,18 +11,4 @@ mv out_work_lost_work.txt rna_properties_lost.txt
cat rna_properties.txt | grep -v "^#" > rna_properties_edits.txt
./rna_cleaner.py rna_properties.txt
echo "Updated: rna_properties.txt rna_properties_edits.txt rna_properties_lost.txt "
=======
cd ../../../../
./blender.bin --background --python ./release/scripts/modules/rna_info.py 2> source/blender/makesrna/rna_cleanup/out.txt
cd ./source/blender/makesrna/rna_cleanup/
./rna_cleaner.py out.txt
./rna_cleaner.py rna_properties.txt
./rna_cleaner_merge.py out_work.py rna_properties_work.py
./rna_cleaner.py out_work_merged.py
./rna_cleaner.py out_work_lost.py
mv out_work_merged_work.txt rna_properties.txt # overwrite
mv out_work_lost_work.txt rna_properties_lost.txt
cat rna_properties.txt | grep -v "^#" > rna_properties_edits.txt
./rna_cleaner.py rna_properties.txt
echo "Updated: rna_properties.txt rna_properties_edits.txt rna_properties_lost.txt "
>>>>>>> .merge-right.r35190

@ -72,7 +72,7 @@ static char M_Geometry_intersect_ray_tri_doc[] =
" :type ray: :class:`mathutils.Vector`\n"
" :arg orig: Origin\n"
" :type orig: :class:`mathutils.Vector`\n"
" :arg clip: Clip by the ray length\n"
" :arg clip: When False, don't restrict the intersection to the area of the triangle, use the infinite plane defined by the triangle.\n"
" :type clip: boolean\n"
" :return: The point of intersection or None if no intersection is found\n"
" :rtype: :class:`mathutils.Vector` or None\n"