Merge branch 'master' into blender2.8
This commit is contained in:
@@ -1264,7 +1264,7 @@ void BKE_mesh_normals_loop_split(
|
||||
const MVert *mverts, const int UNUSED(numVerts), MEdge *medges, const int numEdges,
|
||||
MLoop *mloops, float (*r_loopnors)[3], const int numLoops,
|
||||
MPoly *mpolys, const float (*polynors)[3], const int numPolys,
|
||||
const bool use_split_normals, float split_angle,
|
||||
const bool use_split_normals, const float split_angle,
|
||||
MLoopNorSpaceArray *r_lnors_spacearr, short (*clnors_data)[2], int *r_loop_to_poly)
|
||||
{
|
||||
/* For now this is not supported. If we do not use split normals, we do not generate anything fancy! */
|
||||
@@ -1325,9 +1325,7 @@ void BKE_mesh_normals_loop_split(
|
||||
TIMEIT_START_AVERAGED(BKE_mesh_normals_loop_split);
|
||||
#endif
|
||||
|
||||
if (check_angle) {
|
||||
split_angle = cosf(split_angle);
|
||||
}
|
||||
const float split_angle_cos = check_angle ? cosf(split_angle) : -1.0f;
|
||||
|
||||
if (!r_lnors_spacearr && clnors_data) {
|
||||
/* We need to compute lnor spacearr if some custom lnor data are given to us! */
|
||||
@@ -1371,7 +1369,7 @@ void BKE_mesh_normals_loop_split(
|
||||
*/
|
||||
if (!(mp->flag & ME_SMOOTH) || (medges[ml_curr->e].flag & ME_SHARP) ||
|
||||
ml_curr->v == mloops[e2l[0]].v ||
|
||||
(check_angle && dot_v3v3(polynors[loop_to_poly[e2l[0]]], polynors[mp_index]) < split_angle))
|
||||
(check_angle && dot_v3v3(polynors[loop_to_poly[e2l[0]]], polynors[mp_index]) < split_angle_cos))
|
||||
{
|
||||
/* Note: we are sure that loop != 0 here ;) */
|
||||
e2l[1] = INDEX_INVALID;
|
||||
|
||||
@@ -62,7 +62,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal)
|
||||
{
|
||||
MVert *mv, *mvert;
|
||||
MEdge *me, *medge;
|
||||
MPoly /* *mpoly, */ /* UNUSED */ *mp;
|
||||
MPoly *mpoly, *mp;
|
||||
MLoop *mloop;
|
||||
BMVert *v, **vtable;
|
||||
BMEdge *e, **etable;
|
||||
@@ -70,7 +70,6 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal)
|
||||
BMFace *f;
|
||||
int i, j, totvert, totedge /* , totface */ /* UNUSED */ ;
|
||||
bool is_init = (bm->totvert == 0) && (bm->totedge == 0) && (bm->totface == 0);
|
||||
bool is_cddm = (dm->type == DM_TYPE_CDDM); /* duplicate the arrays for non cddm */
|
||||
char has_orig_htype = 0;
|
||||
|
||||
int cd_vert_bweight_offset;
|
||||
@@ -106,7 +105,8 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal)
|
||||
etable = MEM_mallocN(sizeof(*etable) * totedge, __func__);
|
||||
|
||||
/*do verts*/
|
||||
mv = mvert = is_cddm ? dm->getVertArray(dm) : dm->dupVertArray(dm);
|
||||
bool vert_allocated;
|
||||
mv = mvert = DM_get_vert_array(dm, &vert_allocated);;
|
||||
for (i = 0; i < totvert; i++, mv++) {
|
||||
v = BM_vert_create(bm, mv->co, NULL, BM_CREATE_SKIP_CD);
|
||||
normal_short_to_float_v3(v->no, mv->no);
|
||||
@@ -124,11 +124,12 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal)
|
||||
*orig_index = ORIGINDEX_NONE;
|
||||
}
|
||||
}
|
||||
if (!is_cddm) MEM_freeN(mvert);
|
||||
if (vert_allocated) MEM_freeN(mvert);
|
||||
if (is_init) bm->elem_index_dirty &= ~BM_VERT;
|
||||
|
||||
/*do edges*/
|
||||
me = medge = is_cddm ? dm->getEdgeArray(dm) : dm->dupEdgeArray(dm);
|
||||
bool edge_allocated;
|
||||
me = medge = DM_get_edge_array(dm, &edge_allocated);
|
||||
for (i = 0; i < totedge; i++, me++) {
|
||||
//BLI_assert(BM_edge_exists(vtable[me->v1], vtable[me->v2]) == NULL);
|
||||
e = BM_edge_create(bm, vtable[me->v1], vtable[me->v2], NULL, BM_CREATE_SKIP_CD);
|
||||
@@ -147,13 +148,14 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal)
|
||||
*orig_index = ORIGINDEX_NONE;
|
||||
}
|
||||
}
|
||||
if (!is_cddm) MEM_freeN(medge);
|
||||
if (edge_allocated) MEM_freeN(medge);
|
||||
if (is_init) bm->elem_index_dirty &= ~BM_EDGE;
|
||||
|
||||
/* do faces */
|
||||
/* note: i_alt is aligned with bmesh faces which may not always align with mpolys */
|
||||
mp = dm->getPolyArray(dm);
|
||||
mloop = dm->getLoopArray(dm);
|
||||
bool poly_allocated, loop_allocated;
|
||||
mpoly = mp = DM_get_poly_array(dm, &poly_allocated);
|
||||
mloop = DM_get_loop_array(dm, &loop_allocated);
|
||||
face_normals = (dm->dirty & DM_DIRTY_NORMALS) ? NULL : CustomData_get_layer(&dm->polyData, CD_NORMAL);
|
||||
for (i = 0; i < dm->numPolyData; i++, mp++) {
|
||||
BMLoop *l_iter;
|
||||
@@ -194,6 +196,8 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal)
|
||||
*orig_index = ORIGINDEX_NONE;
|
||||
}
|
||||
}
|
||||
if (poly_allocated) MEM_freeN(mpoly);
|
||||
if (loop_allocated) MEM_freeN(mloop);
|
||||
if (is_init) bm->elem_index_dirty &= ~(BM_FACE | BM_LOOP);
|
||||
|
||||
MEM_freeN(vtable);
|
||||
|
||||
@@ -394,7 +394,7 @@ void psys_apply_child_modifiers(ParticleThreadContext *ctx, struct ListBase *mod
|
||||
get_strand_normal(ma, ornor, cur_length, (key-1)->vel);
|
||||
}
|
||||
|
||||
if (use_length_check && k > 1) {
|
||||
if (use_length_check && k > 0) {
|
||||
float dvec[3];
|
||||
/* check if path needs to be cut before actual end of data points */
|
||||
if (!check_path_length(k, keys, key, max_length, step_length, &cur_length, dvec)) {
|
||||
|
||||
@@ -1680,6 +1680,11 @@ static bool seq_proxy_get_fname(Editing *ed, Sequence *seq, int cfra, int render
|
||||
else if (seq->type == SEQ_TYPE_IMAGE) {
|
||||
fname[0] = 0;
|
||||
}
|
||||
else {
|
||||
/* We could make a name here, except non-movie's don't generate proxies,
|
||||
* cancel until other types of sequence strips are supported. */
|
||||
return false;
|
||||
}
|
||||
BLI_path_append(dir, sizeof(dir), fname);
|
||||
BLI_path_abs(name, G.main->name);
|
||||
}
|
||||
|
||||
@@ -1207,17 +1207,17 @@ void BKE_texture_get_value(
|
||||
BKE_texture_get_value_ex(scene, texture, tex_co, texres, NULL, use_color_management);
|
||||
}
|
||||
|
||||
static void texture_nodes_fetch_images_for_pool(bNodeTree *ntree, struct ImagePool *pool)
|
||||
static void texture_nodes_fetch_images_for_pool(Tex *texture, bNodeTree *ntree, struct ImagePool *pool)
|
||||
{
|
||||
for (bNode *node = ntree->nodes.first; node; node = node->next) {
|
||||
if (node->type == SH_NODE_TEX_IMAGE && node->id != NULL) {
|
||||
Image *image = (Image *)node->id;
|
||||
BKE_image_pool_acquire_ibuf(image, NULL, pool);
|
||||
BKE_image_pool_acquire_ibuf(image, &texture->iuser, pool);
|
||||
}
|
||||
else if (node->type == NODE_GROUP && node->id != NULL) {
|
||||
/* TODO(sergey): Do we need to control recursion here? */
|
||||
bNodeTree *nested_tree = (bNodeTree *)node->id;
|
||||
texture_nodes_fetch_images_for_pool(nested_tree, pool);
|
||||
texture_nodes_fetch_images_for_pool(texture, nested_tree, pool);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1226,12 +1226,12 @@ static void texture_nodes_fetch_images_for_pool(bNodeTree *ntree, struct ImagePo
|
||||
void BKE_texture_fetch_images_for_pool(Tex *texture, struct ImagePool *pool)
|
||||
{
|
||||
if (texture->nodetree != NULL) {
|
||||
texture_nodes_fetch_images_for_pool(texture->nodetree, pool);
|
||||
texture_nodes_fetch_images_for_pool(texture, texture->nodetree, pool);
|
||||
}
|
||||
else {
|
||||
if (texture->type == TEX_IMAGE) {
|
||||
if (texture->ima != NULL) {
|
||||
BKE_image_pool_acquire_ibuf(texture->ima, NULL, pool);
|
||||
BKE_image_pool_acquire_ibuf(texture->ima, &texture->iuser, pool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user