Merging r46096 through r46110 from trunk into soc-2011-tomato
This commit is contained in:
@@ -228,6 +228,7 @@ if(UNIX AND NOT APPLE)
|
||||
option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
|
||||
endif()
|
||||
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
|
||||
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
|
||||
option(WITH_MINGW64 "Use the 64-bit version of MinGW" OFF)
|
||||
mark_as_advanced(WITH_MINGW64)
|
||||
|
||||
@@ -1612,6 +1613,13 @@ if(WITH_PYTHON)
|
||||
"to a valid python include path. Containing "
|
||||
"Python.h for python version \"${PYTHON_VERSION}\"")
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON_INSTALL_NUMPY)
|
||||
if(NOT EXISTS "${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/numpy")
|
||||
message(WARNING "Numpy path '${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/numpy' is missing, "
|
||||
"WITH_PYTHON_INSTALL_NUMPY option will be ignored when installing python")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1668,7 +1676,7 @@ if(FIRST_RUN)
|
||||
_setting)
|
||||
set(_msg " * ${_setting}")
|
||||
string(LENGTH "${_msg}" _len)
|
||||
while("28" GREATER "${_len}")
|
||||
while("32" GREATER "${_len}")
|
||||
set(_msg "${_msg} ")
|
||||
math(EXPR _len "${_len} + 1")
|
||||
endwhile()
|
||||
@@ -1728,6 +1736,7 @@ if(FIRST_RUN)
|
||||
|
||||
info_cfg_text("Python:")
|
||||
info_cfg_option(WITH_PYTHON_INSTALL)
|
||||
info_cfg_option(WITH_PYTHON_INSTALL_NUMPY)
|
||||
info_cfg_option(WITH_PYTHON_MODULE)
|
||||
info_cfg_option(WITH_PYTHON_SAFETY)
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_47 libboost_filesystem-vc90-mt-s-
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = True
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21']
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_47 libboost_filesystem-vc90-mt-s-
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = True
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21']
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ __device void camera_sample_environment(KernelGlobals *kg, float raster_x, float
|
||||
float3 Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y, 0.0f));
|
||||
|
||||
/* create ray form raster position */
|
||||
ray->P = make_float3(0.0, 0.0f, 0.0f);
|
||||
ray->P = make_float3(0.0f, 0.0f, 0.0f);
|
||||
ray->D = equirectangular_to_direction(Pcamera.x, Pcamera.y);
|
||||
|
||||
/* transform ray from camera to world */
|
||||
|
||||
@@ -78,7 +78,7 @@ __device float kernel_tex_interp_(__global float *data, int width, float x)
|
||||
|
||||
#define make_float2(x, y) ((float2)(x, y))
|
||||
#ifdef __CL_NO_FLOAT3__
|
||||
#define make_float3(x, y, z) ((float4)(x, y, z, 0.0))
|
||||
#define make_float3(x, y, z) ((float4)(x, y, z, 0.0f))
|
||||
#else
|
||||
#define make_float3(x, y, z) ((float3)(x, y, z))
|
||||
#endif
|
||||
|
||||
@@ -23,11 +23,11 @@ __device void svm_node_gamma(ShaderData *sd, float *stack, uint in_gamma, uint i
|
||||
float3 color = stack_load_float3(stack, in_color);
|
||||
float gamma = stack_load_float(stack, in_gamma);
|
||||
|
||||
if (color.x > 0.0)
|
||||
if (color.x > 0.0f)
|
||||
color.x = powf(color.x, gamma);
|
||||
if (color.y > 0.0)
|
||||
if (color.y > 0.0f)
|
||||
color.y = powf(color.y, gamma);
|
||||
if (color.z > 0.0)
|
||||
if (color.z > 0.0f)
|
||||
color.z = powf(color.z, gamma);
|
||||
|
||||
if (stack_valid(out_color))
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static struct empty_t {} empty;
|
||||
enum empty_t { empty = 0};
|
||||
|
||||
__forceinline BoundBox(empty_t)
|
||||
: min(make_float3(FLT_MAX, FLT_MAX, FLT_MAX)), max(make_float3(-FLT_MAX, -FLT_MAX, -FLT_MAX))
|
||||
|
||||
@@ -286,7 +286,7 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
|
||||
}
|
||||
|
||||
if (m_buttonMask == 0)
|
||||
m_buttonMask = ~(-1 << m_buttonCount);
|
||||
m_buttonMask = (int) ~(UINT_MAX << m_buttonCount);
|
||||
|
||||
#ifdef DEBUG_NDOF_BUTTONS
|
||||
printf("ndof: %d buttons -> hex:%X\n", m_buttonCount, m_buttonMask);
|
||||
|
||||
@@ -276,7 +276,7 @@ extern "C" unsigned char *smoke_get_obstacle(FLUID_3D *fluid)
|
||||
return fluid->_obstacles;
|
||||
}
|
||||
|
||||
extern "C" void smoke_get_ob_velocity(struct FLUID_3D *fluid, float **x, float **y, float **z)
|
||||
extern "C" void smoke_get_ob_velocity(FLUID_3D *fluid, float **x, float **y, float **z)
|
||||
{
|
||||
*x = fluid->_xVelocityOb;
|
||||
*y = fluid->_yVelocityOb;
|
||||
|
||||
@@ -106,6 +106,7 @@ static const char *locales[] = {
|
||||
"serbian (latin)", "sr_RS@latin",
|
||||
"kyrgyz", "ky_KG",
|
||||
"turkish", "tr_TR",
|
||||
"hungarian", "hu_HU",
|
||||
};
|
||||
|
||||
void BLF_lang_init(void)
|
||||
|
||||
@@ -71,7 +71,10 @@ void defvert_normalize_lock(struct MDeformVert *dvert, const int def_nr_lock);
|
||||
|
||||
/* utility function, note that 32 chars is the maximum string length since its only
|
||||
* used with defgroups currently */
|
||||
int BKE_deform_is_char_sep(const char c);
|
||||
|
||||
void BKE_deform_split_suffix(const char string[MAX_VGROUP_NAME], char base[MAX_VGROUP_NAME], char ext[MAX_VGROUP_NAME]);
|
||||
void BKE_deform_split_prefix(const char string[MAX_VGROUP_NAME], char base[MAX_VGROUP_NAME], char ext[MAX_VGROUP_NAME]);
|
||||
|
||||
void flip_side_name(char name[64], const char from_name[64], int strip_number);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -437,11 +437,51 @@ void defgroup_unique_name(bDeformGroup *dg, Object *ob)
|
||||
BLI_uniquename_cb(defgroup_unique_check, &data, "Group", '.', dg->name, sizeof(dg->name));
|
||||
}
|
||||
|
||||
int BKE_deform_is_char_sep(const char c)
|
||||
static int is_char_sep(const char c)
|
||||
{
|
||||
return ELEM4(c, '.', ' ', '-', '_');
|
||||
}
|
||||
|
||||
/* based on BLI_split_dirfile() / os.path.splitext(), "a.b.c" -> ("a.b", ".c") */
|
||||
|
||||
void BKE_deform_split_suffix(const char string[MAX_VGROUP_NAME], char body[MAX_VGROUP_NAME], char suf[MAX_VGROUP_NAME])
|
||||
{
|
||||
size_t len = BLI_strnlen(string, MAX_VGROUP_NAME);
|
||||
size_t i;
|
||||
|
||||
body[0] = suf[0] = '\0';
|
||||
|
||||
for (i = len - 1; i > 1; i--) {
|
||||
if (is_char_sep(string[i])) {
|
||||
BLI_strncpy(body, string, i + 1);
|
||||
BLI_strncpy(suf, string + i, (len + 1) - i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BLI_strncpy(body, string, len);
|
||||
}
|
||||
|
||||
/* "a.b.c" -> ("a.", "b.c") */
|
||||
void BKE_deform_split_prefix(const char string[MAX_VGROUP_NAME], char pre[MAX_VGROUP_NAME], char body[MAX_VGROUP_NAME])
|
||||
{
|
||||
size_t len = BLI_strnlen(string, MAX_VGROUP_NAME);
|
||||
size_t i;
|
||||
|
||||
body[0] = pre[0] = '\0';
|
||||
|
||||
for (i = 1; i < len; i++) {
|
||||
if (is_char_sep(string[i])) {
|
||||
i++;
|
||||
BLI_strncpy(pre, string, i + 1);
|
||||
BLI_strncpy(body, string + i, (len + 1) - i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BLI_strncpy(body, string, len);
|
||||
}
|
||||
|
||||
/* finds the best possible flipped name. For renaming; check for unique names afterwards */
|
||||
/* if strip_number: removes number extensions
|
||||
* note: don't use sizeof() for 'name' or 'from_name' */
|
||||
@@ -478,7 +518,7 @@ void flip_side_name(char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP_
|
||||
BLI_strncpy(prefix, name, sizeof(prefix));
|
||||
|
||||
/* first case; separator . - _ with extensions r R l L */
|
||||
if (BKE_deform_is_char_sep(name[len - 2])) {
|
||||
if (is_char_sep(name[len - 2])) {
|
||||
switch (name[len - 1]) {
|
||||
case 'l':
|
||||
prefix[len - 1] = 0;
|
||||
@@ -499,7 +539,7 @@ void flip_side_name(char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP_
|
||||
}
|
||||
}
|
||||
/* case; beginning with r R l L , with separator after it */
|
||||
else if (BKE_deform_is_char_sep(name[1])) {
|
||||
else if (is_char_sep(name[1])) {
|
||||
switch (name[0]) {
|
||||
case 'l':
|
||||
strcpy(replace, "r");
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#include "DNA_space_types.h"
|
||||
#include "DNA_view3d_types.h"
|
||||
#include "DNA_world_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_bpath.h"
|
||||
|
||||
@@ -131,10 +131,10 @@ void BLI_ghashIterator_step (GHashIterator *ghi);
|
||||
*/
|
||||
int BLI_ghashIterator_isDone (GHashIterator *ghi);
|
||||
|
||||
#define GHASH_ITER(gh_iter_, ghash_) \
|
||||
for (BLI_ghashIterator_init(&gh_iter_, ghash_); \
|
||||
!BLI_ghashIterator_isDone(&gh_iter_); \
|
||||
BLI_ghashIterator_step(&gh_iter_))
|
||||
#define GHASH_ITER(gh_iter_, ghash_) \
|
||||
for (BLI_ghashIterator_init(&gh_iter_, ghash_); \
|
||||
!BLI_ghashIterator_isDone(&gh_iter_); \
|
||||
BLI_ghashIterator_step(&gh_iter_))
|
||||
|
||||
/* *** */
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
#include "DNA_nla_types.h"
|
||||
#include "DNA_node_types.h"
|
||||
#include "DNA_object_fluidsim.h" // NT
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_packedFile_types.h"
|
||||
#include "DNA_particle_types.h"
|
||||
#include "DNA_property_types.h"
|
||||
|
||||
@@ -39,19 +39,19 @@
|
||||
|
||||
/* Internal operator flags */
|
||||
typedef enum {
|
||||
HULL_FLAG_INPUT = (1 << 0),
|
||||
HULL_FLAG_TETRA_VERT = (1 << 1),
|
||||
HULL_FLAG_INPUT = (1 << 0),
|
||||
HULL_FLAG_TETRA_VERT = (1 << 1),
|
||||
|
||||
HULL_FLAG_INTERIOR_ELE = (1 << 2),
|
||||
HULL_FLAG_OUTPUT_GEOM = (1 << 3),
|
||||
HULL_FLAG_INTERIOR_ELE = (1 << 2),
|
||||
HULL_FLAG_OUTPUT_GEOM = (1 << 3),
|
||||
|
||||
HULL_FLAG_DEL = (1 << 4),
|
||||
HULL_FLAG_HOLE = (1 << 5)
|
||||
HULL_FLAG_DEL = (1 << 4),
|
||||
HULL_FLAG_HOLE = (1 << 5)
|
||||
} HullFlags;
|
||||
|
||||
/* Store hull triangles seperate from BMesh faces until the end; this
|
||||
way we don't have to worry about cleaning up extraneous edges or
|
||||
incorrectly deleting existing geometry. */
|
||||
* way we don't have to worry about cleaning up extraneous edges or
|
||||
* incorrectly deleting existing geometry. */
|
||||
typedef struct HullTriangle {
|
||||
BMVert *v[3];
|
||||
float no[3];
|
||||
@@ -59,8 +59,8 @@ typedef struct HullTriangle {
|
||||
} HullTriangle;
|
||||
|
||||
/* These edges define the hole created in the hull by deleting faces
|
||||
that can "see" a new vertex (the boundary edges then form the edge
|
||||
of a new triangle fan that has the new vertex as its center) */
|
||||
* that can "see" a new vertex (the boundary edges then form the edge
|
||||
* of a new triangle fan that has the new vertex as its center) */
|
||||
typedef struct HullBoundaryEdge {
|
||||
struct HullBoundaryEdge *next, *prev;
|
||||
BMVert *v[2];
|
||||
@@ -79,7 +79,7 @@ static int edge_match(BMVert *e1_0, BMVert *e1_1, BMVert *e2[2])
|
||||
/* Returns true if the edge (e1, e2) is already in edges; that edge is
|
||||
deleted here as well. if not found just returns 0 */
|
||||
static int check_for_dup(ListBase *edges, BLI_mempool *pool,
|
||||
BMVert *e1, BMVert *e2)
|
||||
BMVert *e1, BMVert *e2)
|
||||
{
|
||||
HullBoundaryEdge *e, *next;
|
||||
|
||||
@@ -98,13 +98,13 @@ static int check_for_dup(ListBase *edges, BLI_mempool *pool,
|
||||
}
|
||||
|
||||
static void expand_boundary_edges(ListBase *edges, BLI_mempool *edge_pool,
|
||||
const HullTriangle *t)
|
||||
const HullTriangle *t)
|
||||
{
|
||||
HullBoundaryEdge *new;
|
||||
int i;
|
||||
|
||||
/* Insert each triangle edge into the boundary list; if any of
|
||||
its edges are already in there, remove the edge entirely */
|
||||
* its edges are already in there, remove the edge entirely */
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (!check_for_dup(edges, edge_pool, t->v[i], t->v[(i + 1) % 3])) {
|
||||
new = BLI_mempool_calloc(edge_pool);
|
||||
@@ -120,7 +120,7 @@ static void expand_boundary_edges(ListBase *edges, BLI_mempool *edge_pool,
|
||||
/*************************** Hull Triangles ***************************/
|
||||
|
||||
static void hull_add_triangle(GHash *hull_triangles, BLI_mempool *pool,
|
||||
BMVert *v1, BMVert *v2, BMVert *v3)
|
||||
BMVert *v1, BMVert *v2, BMVert *v3)
|
||||
{
|
||||
HullTriangle *t;
|
||||
|
||||
@@ -150,8 +150,8 @@ static GHash *hull_triangles_v_outside(GHash *hull_triangles, const BMVert *v)
|
||||
GHashIterator iter;
|
||||
|
||||
outside = BLI_ghash_new(BLI_ghashutil_ptrhash,
|
||||
BLI_ghashutil_ptrcmp,
|
||||
"outside");
|
||||
BLI_ghashutil_ptrcmp,
|
||||
"outside");
|
||||
|
||||
GHASH_ITER (iter, hull_triangles) {
|
||||
HullTriangle *t = BLI_ghashIterator_getKey(&iter);
|
||||
@@ -180,11 +180,11 @@ static int hull_test_v_outside(GHash *hull_triangles, const BMVert *v)
|
||||
|
||||
|
||||
/* For vertex 'v', find which triangles must be deleted to extend the
|
||||
hull; find the boundary edges of that hole so that it can be filled
|
||||
with connections to the new vertex, and update the hull_triangles
|
||||
to delete the marked triangles */
|
||||
* hull; find the boundary edges of that hole so that it can be filled
|
||||
* with connections to the new vertex, and update the hull_triangles
|
||||
* to delete the marked triangles */
|
||||
static void add_point(GHash *hull_triangles, BLI_mempool *hull_pool,
|
||||
BLI_mempool *edge_pool, GHash *outside, BMVert *v)
|
||||
BLI_mempool *edge_pool, GHash *outside, BMVert *v)
|
||||
{
|
||||
ListBase edges = {NULL, NULL};
|
||||
HullBoundaryEdge *e, *next;
|
||||
@@ -214,8 +214,10 @@ static BMFace *hull_find_example_face(BMesh *bm, BMEdge *e)
|
||||
|
||||
BM_ITER_ELEM (f, &iter, e, BM_FACES_OF_EDGE) {
|
||||
if (BMO_elem_flag_test(bm, f, HULL_FLAG_INPUT) ||
|
||||
!BMO_elem_flag_test(bm, f, HULL_FLAG_OUTPUT_GEOM))
|
||||
!BMO_elem_flag_test(bm, f, HULL_FLAG_OUTPUT_GEOM))
|
||||
{
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -279,13 +281,13 @@ static LinkData *final_edges_find_link(ListBase *adj, BMVert *v)
|
||||
}
|
||||
|
||||
static int hull_final_edges_lookup(HullFinalEdges *final_edges,
|
||||
BMVert *v1, BMVert *v2)
|
||||
BMVert *v1, BMVert *v2)
|
||||
{
|
||||
ListBase *adj;
|
||||
|
||||
/* Use lower vertex pointer for hash key */
|
||||
if (v1 > v2)
|
||||
SWAP(BMVert*, v1, v2);
|
||||
SWAP(BMVert *, v1, v2);
|
||||
|
||||
adj = BLI_ghash_lookup(final_edges->edges, v1);
|
||||
if (!adj)
|
||||
@@ -302,8 +304,8 @@ static HullFinalEdges *hull_final_edges(GHash *hull_triangles)
|
||||
|
||||
final_edges = MEM_callocN(sizeof(HullFinalEdges), "HullFinalEdges");
|
||||
final_edges->edges = BLI_ghash_new(BLI_ghashutil_ptrhash,
|
||||
BLI_ghashutil_ptrcmp,
|
||||
"final edges ghash");
|
||||
BLI_ghashutil_ptrcmp,
|
||||
"final edges ghash");
|
||||
final_edges->base_pool = BLI_mempool_create(sizeof(ListBase), 128, 128, 0);
|
||||
final_edges->link_pool = BLI_mempool_create(sizeof(LinkData), 128, 128, 0);
|
||||
|
||||
@@ -319,7 +321,7 @@ static HullFinalEdges *hull_final_edges(GHash *hull_triangles)
|
||||
|
||||
/* Use lower vertex pointer for hash key */
|
||||
if (v1 > v2)
|
||||
SWAP(BMVert*, v1, v2);
|
||||
SWAP(BMVert *, v1, v2);
|
||||
|
||||
adj = BLI_ghash_lookup(final_edges->edges, v1);
|
||||
if (!adj) {
|
||||
@@ -351,7 +353,7 @@ static void hull_final_edges_free(HullFinalEdges *final_edges)
|
||||
/************************* Initial Tetrahedron ************************/
|
||||
|
||||
static void hull_add_tetrahedron(GHash *hull_triangles, BLI_mempool *pool,
|
||||
BMVert *tetra[4])
|
||||
BMVert *tetra[4])
|
||||
{
|
||||
float center[3];
|
||||
int i, indices[4][3] = {
|
||||
@@ -375,7 +377,7 @@ static void hull_add_tetrahedron(GHash *hull_triangles, BLI_mempool *pool,
|
||||
normal_tri_v3(no, v1->co, v2->co, v3->co);
|
||||
sub_v3_v3v3(d, center, v1->co);
|
||||
if (dot_v3v3(no, d) > 0)
|
||||
SWAP(BMVert*, v1, v3);
|
||||
SWAP(BMVert *, v1, v3);
|
||||
|
||||
hull_add_triangle(hull_triangles, pool, v1, v2, v3);
|
||||
}
|
||||
@@ -383,7 +385,7 @@ static void hull_add_tetrahedron(GHash *hull_triangles, BLI_mempool *pool,
|
||||
|
||||
/* For each axis, get the minimum and maximum input vertices */
|
||||
static void hull_get_min_max(BMesh *bm, BMOperator *op,
|
||||
BMVert *min[3], BMVert *max[3])
|
||||
BMVert *min[3], BMVert *max[3])
|
||||
{
|
||||
BMOIter oiter;
|
||||
BMVert *v;
|
||||
@@ -405,7 +407,7 @@ static void hull_get_min_max(BMesh *bm, BMOperator *op,
|
||||
|
||||
/* Returns true if input is coplanar */
|
||||
static int hull_find_large_tetrahedron(BMesh *bm, BMOperator *op,
|
||||
BMVert *tetra[4])
|
||||
BMVert *tetra[4])
|
||||
{
|
||||
BMVert *min[3], *max[3], *v;
|
||||
BMOIter oiter;
|
||||
@@ -422,7 +424,8 @@ static int hull_find_large_tetrahedron(BMesh *bm, BMOperator *op,
|
||||
}
|
||||
|
||||
/* Find widest axis */
|
||||
widest_axis_len = 0;
|
||||
widest_axis_len = 0.0f;
|
||||
widest_axis = 0; /* set here in the unlikey case this isn't set below */
|
||||
for (i = 0; i < 3; i++) {
|
||||
float len = (max[i]->co[i] - min[i]->co[i]);
|
||||
if (len >= widest_axis_len) {
|
||||
@@ -439,6 +442,7 @@ static int hull_find_large_tetrahedron(BMesh *bm, BMOperator *op,
|
||||
|
||||
/* Choose third vertex farthest from existing line segment */
|
||||
largest_dist = 0;
|
||||
tetra[2] = NULL;
|
||||
for (i = 0; i < 3; i++) {
|
||||
BMVert *v;
|
||||
float dist;
|
||||
@@ -458,7 +462,13 @@ static int hull_find_large_tetrahedron(BMesh *bm, BMOperator *op,
|
||||
}
|
||||
}
|
||||
|
||||
BMO_elem_flag_enable(bm, tetra[2], HULL_FLAG_TETRA_VERT);
|
||||
if (tetra[2]) {
|
||||
BMO_elem_flag_enable(bm, tetra[2], HULL_FLAG_TETRA_VERT);
|
||||
}
|
||||
else {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Check for colinear vertices */
|
||||
if (largest_dist < 0.0001)
|
||||
return TRUE;
|
||||
@@ -476,7 +486,13 @@ static int hull_find_large_tetrahedron(BMesh *bm, BMOperator *op,
|
||||
}
|
||||
}
|
||||
|
||||
BMO_elem_flag_enable(bm, tetra[3], HULL_FLAG_TETRA_VERT);
|
||||
if (tetra[3]) {
|
||||
BMO_elem_flag_enable(bm, tetra[3], HULL_FLAG_TETRA_VERT);
|
||||
}
|
||||
else {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (largest_dist < 0.0001)
|
||||
return TRUE;
|
||||
|
||||
@@ -488,7 +504,7 @@ static int hull_find_large_tetrahedron(BMesh *bm, BMOperator *op,
|
||||
/**************************** Final Output ****************************/
|
||||
|
||||
static void hull_remove_overlapping(BMesh *bm, GHash *hull_triangles,
|
||||
HullFinalEdges *final_edges)
|
||||
HullFinalEdges *final_edges)
|
||||
{
|
||||
GHashIterator hull_iter;
|
||||
|
||||
@@ -514,7 +530,7 @@ static void hull_remove_overlapping(BMesh *bm, GHash *hull_triangles,
|
||||
/* Note: can't change ghash while iterating, so mark
|
||||
with 'skip' flag rather than deleting triangles */
|
||||
if (BM_vert_in_face(f, t->v[1]) &&
|
||||
BM_vert_in_face(f, t->v[2]) && f_on_hull) {
|
||||
BM_vert_in_face(f, t->v[2]) && f_on_hull) {
|
||||
t->skip = TRUE;
|
||||
BMO_elem_flag_disable(bm, f, HULL_FLAG_INTERIOR_ELE);
|
||||
BMO_elem_flag_enable(bm, f, HULL_FLAG_HOLE);
|
||||
@@ -524,8 +540,8 @@ static void hull_remove_overlapping(BMesh *bm, GHash *hull_triangles,
|
||||
}
|
||||
|
||||
static void hull_mark_interior_elements(BMesh *bm, BMOperator *op,
|
||||
GHash *hull_triangles,
|
||||
HullFinalEdges *final_edges)
|
||||
GHash *hull_triangles,
|
||||
HullFinalEdges *final_edges)
|
||||
{
|
||||
BMVert *v;
|
||||
BMEdge *e;
|
||||
@@ -570,14 +586,14 @@ static void hull_tag_unused(BMesh *bm, BMOperator *op)
|
||||
if (BMO_elem_flag_test(bm, v, HULL_FLAG_INTERIOR_ELE)) {
|
||||
int del = TRUE;
|
||||
|
||||
BM_ITER_ELEM(e, &iter, v, BM_EDGES_OF_VERT) {
|
||||
BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) {
|
||||
if (!BMO_elem_flag_test(bm, e, HULL_FLAG_INPUT)) {
|
||||
del = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BM_ITER_ELEM(f, &iter, v, BM_FACES_OF_VERT) {
|
||||
BM_ITER_ELEM (f, &iter, v, BM_FACES_OF_VERT) {
|
||||
if (!BMO_elem_flag_test(bm, f, HULL_FLAG_INPUT)) {
|
||||
del = FALSE;
|
||||
break;
|
||||
@@ -593,7 +609,7 @@ static void hull_tag_unused(BMesh *bm, BMOperator *op)
|
||||
if (BMO_elem_flag_test(bm, e, HULL_FLAG_INTERIOR_ELE)) {
|
||||
int del = TRUE;
|
||||
|
||||
BM_ITER_ELEM(f, &iter, e, BM_FACES_OF_EDGE) {
|
||||
BM_ITER_ELEM (f, &iter, e, BM_FACES_OF_EDGE) {
|
||||
if (!BMO_elem_flag_test(bm, f, HULL_FLAG_INPUT)) {
|
||||
del = FALSE;
|
||||
break;
|
||||
@@ -619,10 +635,10 @@ void hull_tag_holes(BMesh *bm, BMOperator *op)
|
||||
BMEdge *e;
|
||||
|
||||
/* Unmark any hole faces if they are isolated or part of a
|
||||
border */
|
||||
* border */
|
||||
BMO_ITER (f, &oiter, bm, op, "input", BM_FACE) {
|
||||
if (BMO_elem_flag_test(bm, f, HULL_FLAG_HOLE)) {
|
||||
BM_ITER_ELEM(e, &iter, f, BM_EDGES_OF_FACE) {
|
||||
BM_ITER_ELEM (e, &iter, f, BM_EDGES_OF_FACE) {
|
||||
if (BM_edge_face_count(e) == 1) {
|
||||
BMO_elem_flag_disable(bm, f, HULL_FLAG_HOLE);
|
||||
break;
|
||||
@@ -635,7 +651,7 @@ void hull_tag_holes(BMesh *bm, BMOperator *op)
|
||||
BMO_ITER (e, &oiter, bm, op, "input", BM_EDGE) {
|
||||
int hole = TRUE;
|
||||
|
||||
BM_ITER_ELEM(f, &iter, e, BM_FACES_OF_EDGE) {
|
||||
BM_ITER_ELEM (f, &iter, e, BM_FACES_OF_EDGE) {
|
||||
if (!BMO_elem_flag_test(bm, f, HULL_FLAG_HOLE)) {
|
||||
hole = FALSE;
|
||||
break;
|
||||
@@ -659,16 +675,16 @@ void bmo_convex_hull_exec(BMesh *bm, BMOperator *op)
|
||||
/* Verify that at least four verts in the input */
|
||||
if (BMO_slot_get(op, "input")->len < 4) {
|
||||
BMO_error_raise(bm, op, BMERR_CONVEX_HULL_FAILED,
|
||||
"Requires at least four vertices");
|
||||
"Requires at least four vertices");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Initialize the convex hull by building a tetrahedron. A
|
||||
degenerate tetrahedron can cause problems, so report error and
|
||||
fail if the result is coplanar */
|
||||
* degenerate tetrahedron can cause problems, so report error and
|
||||
* fail if the result is coplanar */
|
||||
if (hull_find_large_tetrahedron(bm, op, tetra)) {
|
||||
BMO_error_raise(bm, op, BMERR_CONVEX_HULL_FAILED,
|
||||
"Input vertices are coplanar");
|
||||
"Input vertices are coplanar");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -679,8 +695,8 @@ void bmo_convex_hull_exec(BMesh *bm, BMOperator *op)
|
||||
edge_pool = BLI_mempool_create(sizeof(HullBoundaryEdge), 128, 128, 0);
|
||||
hull_pool = BLI_mempool_create(sizeof(HullTriangle), 128, 128, 0);
|
||||
hull_triangles = BLI_ghash_new(BLI_ghashutil_ptrhash,
|
||||
BLI_ghashutil_ptrcmp,
|
||||
"hull_triangles");
|
||||
BLI_ghashutil_ptrcmp,
|
||||
"hull_triangles");
|
||||
|
||||
/* Add tetrahedron triangles */
|
||||
hull_add_tetrahedron(hull_triangles, hull_pool, tetra);
|
||||
@@ -721,22 +737,22 @@ void bmo_convex_hull_exec(BMesh *bm, BMOperator *op)
|
||||
hull_tag_unused(bm, op);
|
||||
|
||||
/* Output slot of input elements that ended up inside the hull
|
||||
rather than part of it */
|
||||
* rather than part of it */
|
||||
BMO_slot_buffer_from_enabled_flag(bm, op, "interior_geom", BM_ALL,
|
||||
HULL_FLAG_INTERIOR_ELE);
|
||||
HULL_FLAG_INTERIOR_ELE);
|
||||
|
||||
/* Output slot of input elements that ended up inside the hull and
|
||||
* are are unused by other geometry. */
|
||||
BMO_slot_buffer_from_enabled_flag(bm, op, "unused_geom", BM_ALL,
|
||||
HULL_FLAG_DEL);
|
||||
HULL_FLAG_DEL);
|
||||
|
||||
/* Output slot of faces and edges that were in the input and on
|
||||
the hull (useful for cases like bridging where you want to
|
||||
delete some input geometry) */
|
||||
* the hull (useful for cases like bridging where you want to
|
||||
* delete some input geometry) */
|
||||
BMO_slot_buffer_from_enabled_flag(bm, op, "holes_geom", BM_ALL,
|
||||
HULL_FLAG_HOLE);
|
||||
HULL_FLAG_HOLE);
|
||||
|
||||
/* Output slot of all hull vertices, faces, and edges */
|
||||
BMO_slot_buffer_from_enabled_flag(bm, op, "geomout", BM_ALL,
|
||||
HULL_FLAG_OUTPUT_GEOM);
|
||||
HULL_FLAG_OUTPUT_GEOM);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "DNA_armature_types.h"
|
||||
#include "DNA_constraint_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
@@ -4029,6 +4030,7 @@ void ARMATURE_OT_select_all(wmOperatorType *ot)
|
||||
|
||||
enum {
|
||||
SIMEDBONE_LENGTH = 1,
|
||||
SIMEDBONE_DIRECTION,
|
||||
SIMEDBONE_PREFIX,
|
||||
SIMEDBONE_SUFFIX,
|
||||
SIMEDBONE_LAYER
|
||||
@@ -4036,6 +4038,7 @@ enum {
|
||||
|
||||
static EnumPropertyItem prop_similar_types[] = {
|
||||
{SIMEDBONE_LENGTH, "LENGTH", 0, "Length", ""},
|
||||
{SIMEDBONE_DIRECTION, "DIRECTION", 0, "Direction (Y axis)", ""},
|
||||
{SIMEDBONE_PREFIX, "PREFIX", 0, "Prefix", ""},
|
||||
{SIMEDBONE_SUFFIX, "SUFFIX", 0, "Suffix", ""},
|
||||
{SIMEDBONE_LAYER, "LAYER", 0, "Layer", ""},
|
||||
@@ -4053,13 +4056,13 @@ static void ED_armature_edit_bone_select(EditBone *ebone)
|
||||
}
|
||||
}
|
||||
|
||||
static void select_similar_length(bArmature *arm, EditBone *actBone, const float thresh)
|
||||
static void select_similar_length(bArmature *arm, EditBone *ebone_act, const float thresh)
|
||||
{
|
||||
EditBone *ebone;
|
||||
|
||||
/* thresh is always relative to current length */
|
||||
const float len_min = actBone->length / (1.0f + thresh);
|
||||
const float len_max = actBone->length * (1.0f + thresh);
|
||||
const float len_min = ebone_act->length / (1.0f + thresh);
|
||||
const float len_max = ebone_act->length * (1.0f + thresh);
|
||||
|
||||
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
|
||||
if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
|
||||
@@ -4072,90 +4075,116 @@ static void select_similar_length(bArmature *arm, EditBone *actBone, const float
|
||||
}
|
||||
}
|
||||
|
||||
static void select_similar_layer(bArmature *arm, EditBone *actBone)
|
||||
static void select_similar_direction(bArmature *arm, EditBone *ebone_act, const float thresh)
|
||||
{
|
||||
EditBone *ebone;
|
||||
float dir_act[3];
|
||||
sub_v3_v3v3(dir_act, ebone_act->head, ebone_act->tail);
|
||||
|
||||
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
|
||||
if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
|
||||
if (ebone->layer & actBone->layer) {
|
||||
float dir[3];
|
||||
sub_v3_v3v3(dir, ebone->head, ebone->tail);
|
||||
|
||||
if (angle_v3v3(dir_act, dir) / M_PI < thresh) {
|
||||
ED_armature_edit_bone_select(ebone);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void find_pre_or_suffix(char *outCompare, const char *name, int mode)
|
||||
static void select_similar_layer(bArmature *arm, EditBone *ebone_act)
|
||||
{
|
||||
int len = BLI_strnlen(name, MAX_VGROUP_NAME);
|
||||
EditBone *ebone;
|
||||
|
||||
if (len < 3)
|
||||
return;
|
||||
|
||||
if (mode == SIMEDBONE_SUFFIX) {
|
||||
if (BKE_deform_is_char_sep(name[len - 2])) {
|
||||
BLI_strncpy(outCompare, &name[len - 1], sizeof(outCompare));
|
||||
}
|
||||
}
|
||||
else if (mode == SIMEDBONE_PREFIX) {
|
||||
if (BKE_deform_is_char_sep(name[1])) {
|
||||
BLI_strncpy(outCompare, &name[0], sizeof(outCompare));
|
||||
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
|
||||
if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
|
||||
if (ebone->layer & ebone_act->layer) {
|
||||
ED_armature_edit_bone_select(ebone);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void select_similar_name(bArmature *arm, EditBone *actBone, int mode)
|
||||
static void select_similar_prefix(bArmature *arm, EditBone *ebone_act)
|
||||
{
|
||||
EditBone *ebone;
|
||||
|
||||
char *name = actBone->name;
|
||||
char compare[MAX_VGROUP_NAME] = "";
|
||||
find_pre_or_suffix(compare, name, mode);
|
||||
char body_tmp[MAX_VGROUP_NAME];
|
||||
char prefix_act[MAX_VGROUP_NAME];
|
||||
|
||||
if (compare[0] == '\0')
|
||||
BKE_deform_split_prefix(ebone_act->name, prefix_act, body_tmp);
|
||||
|
||||
if (prefix_act[0] == '\0')
|
||||
return;
|
||||
|
||||
/* Find matches */
|
||||
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
|
||||
if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
|
||||
char tCompare[MAX_VGROUP_NAME] = "";
|
||||
find_pre_or_suffix(tCompare, ebone->name, mode);
|
||||
if (!strcmp(tCompare, compare)) {
|
||||
char prefix_other[MAX_VGROUP_NAME];
|
||||
BKE_deform_split_prefix(ebone->name, prefix_other, body_tmp);
|
||||
if (!strcmp(prefix_act, prefix_other)) {
|
||||
ED_armature_edit_bone_select(ebone);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void select_similar_suffix(bArmature *arm, EditBone *ebone_act)
|
||||
{
|
||||
EditBone *ebone;
|
||||
|
||||
char body_tmp[MAX_VGROUP_NAME];
|
||||
char suffix_act[MAX_VGROUP_NAME];
|
||||
|
||||
BKE_deform_split_suffix(ebone_act->name, body_tmp, suffix_act);
|
||||
|
||||
if (suffix_act[0] == '\0')
|
||||
return;
|
||||
|
||||
/* Find matches */
|
||||
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
|
||||
if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
|
||||
char suffix_other[MAX_VGROUP_NAME];
|
||||
BKE_deform_split_suffix(ebone->name, body_tmp, suffix_other);
|
||||
if (!strcmp(suffix_act, suffix_other)) {
|
||||
ED_armature_edit_bone_select(ebone);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int armature_select_similar_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
bArmature *arm = obedit->data;
|
||||
EditBone *actBone = CTX_data_active_bone(C);
|
||||
EditBone *ebone_act = CTX_data_active_bone(C);
|
||||
|
||||
/* Get props */
|
||||
int type = RNA_enum_get(op->ptr, "type");
|
||||
float thresh = RNA_float_get(op->ptr, "threshold");
|
||||
|
||||
/* Check for active bone */
|
||||
if (actBone == NULL) {
|
||||
if (ebone_act == NULL) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Operation requires an Active Bone");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case SIMEDBONE_LENGTH:
|
||||
select_similar_length(arm, actBone, thresh);
|
||||
select_similar_length(arm, ebone_act, thresh);
|
||||
break;
|
||||
case SIMEDBONE_DIRECTION:
|
||||
select_similar_direction(arm, ebone_act, thresh);
|
||||
break;
|
||||
case SIMEDBONE_PREFIX:
|
||||
select_similar_name(arm, actBone, SIMEDBONE_PREFIX);
|
||||
select_similar_prefix(arm, ebone_act);
|
||||
break;
|
||||
case SIMEDBONE_SUFFIX:
|
||||
select_similar_name(arm, actBone, SIMEDBONE_SUFFIX);
|
||||
select_similar_suffix(arm, ebone_act);
|
||||
break;
|
||||
case SIMEDBONE_LAYER:
|
||||
select_similar_layer(arm, actBone);
|
||||
select_similar_layer(arm, ebone_act);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "DNA_speaker_types.h"
|
||||
#include "DNA_world_types.h"
|
||||
#include "DNA_armature_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_blenlib.h"
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#include "BKE_curve.h"
|
||||
#include "BKE_constraint.h" // for the get_constraint_target function
|
||||
#include "BKE_DerivedMesh.h"
|
||||
#include "BKE_deform.h"
|
||||
#include "BKE_displist.h"
|
||||
#include "BKE_effect.h"
|
||||
#include "BKE_font.h"
|
||||
|
||||
@@ -2867,7 +2867,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
|
||||
/* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */
|
||||
/* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */
|
||||
/* Note: As this list is in alphabetical order, and not defined order,
|
||||
* here is the highest define currently in use: 30 (turkish). */
|
||||
* here is the highest define currently in use: 31 (Hungarian). */
|
||||
static EnumPropertyItem language_items[] = {
|
||||
{ 0, "", 0, N_("Nearly done"), ""},
|
||||
{ 0, "DEFAULT", 0, "Default (Default)", ""},
|
||||
@@ -2889,6 +2889,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
|
||||
{ 6, "FINNISH", 0, "Finnish (Suomi)", "fi_FI"},
|
||||
{ 5, "GERMAN", 0, "German (Deutsch)", "de_DE"},
|
||||
{23, "GREEK", 0, "Greek (Ελληνικά)", "el_GR"},
|
||||
{31, "HUNGARIAN", 0, "Hungarian (magyar)", "hu_HU"},
|
||||
{27, "INDONESIAN", 0, "Indonesian (Bahasa indonesia)", "id_ID"},
|
||||
{ 2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
|
||||
{29, "KYRGYZ", 0, "Kyrgyz (Кыргыз тили)", "ky_KG"},
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "DNA_meshdata_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
|
||||
#include "BLI_kdtree.h"
|
||||
#include "BLI_rand.h"
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_string.h"
|
||||
@@ -39,9 +42,6 @@
|
||||
#include "BKE_texture.h"
|
||||
#include "BKE_colortools.h"
|
||||
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
|
||||
#include "depsgraph_private.h"
|
||||
|
||||
#include "RE_shader_ext.h"
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "../mathutils/mathutils.h"
|
||||
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
@@ -438,7 +438,28 @@ if(UNIX AND NOT APPLE)
|
||||
|
||||
# # doesnt work, todo
|
||||
# install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
|
||||
|
||||
if(WITH_PYTHON_INSTALL_NUMPY)
|
||||
install(
|
||||
DIRECTORY ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/numpy
|
||||
DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/site-packages
|
||||
PATTERN ".svn" EXCLUDE
|
||||
PATTERN "__pycache__" EXCLUDE # * any cache *
|
||||
PATTERN "*.pyc" EXCLUDE # * any cache *
|
||||
PATTERN "*.pyo" EXCLUDE # * any cache *
|
||||
PATTERN "distutils" EXCLUDE # ./distutils
|
||||
PATTERN "oldnumeric" EXCLUDE # ./oldnumeric
|
||||
PATTERN "doc" EXCLUDE # ./doc
|
||||
PATTERN "tests" EXCLUDE # ./tests
|
||||
PATTERN "f2py" EXCLUDE # ./f2py - fortran/python interface code, not fun for blender devs.
|
||||
PATTERN "include" EXCLUDE # include dirs all over, we wont use NumPy/CAPI
|
||||
PATTERN "*.h" EXCLUDE # some includes are not in include dirs
|
||||
PATTERN "*.a" EXCLUDE # ./core/lib/libnpymath.a - for linking, we dont need.
|
||||
)
|
||||
endif()
|
||||
|
||||
unset(_target_LIB)
|
||||
|
||||
endif()
|
||||
endif()
|
||||
elseif(WIN32)
|
||||
|
||||
Reference in New Issue
Block a user