Merge branch 'master' into blender2.8

This commit is contained in:
2018-02-21 10:30:50 +01:00
8 changed files with 42 additions and 29 deletions

View File

@@ -106,7 +106,7 @@ class SEQUENCER_HT_header(Header):
layout.prop(st, "preview_channels", expand=True, text="") layout.prop(st, "preview_channels", expand=True, text="")
layout.prop(st, "display_channel", text="Channel") layout.prop(st, "display_channel", text="Channel")
ed = context.scene.sequence_editor ed = scene.sequence_editor
if ed: if ed:
row = layout.row(align=True) row = layout.row(align=True)
row.prop(ed, "show_overlay", text="", icon='GHOST_ENABLED') row.prop(ed, "show_overlay", text="", icon='GHOST_ENABLED')
@@ -1076,7 +1076,7 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
sequencer = context.scene.sequence_editor ed = context.scene.sequence_editor
strip = act_strip(context) strip = act_strip(context)
@@ -1084,9 +1084,9 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
proxy = strip.proxy proxy = strip.proxy
flow = layout.column_flow() flow = layout.column_flow()
flow.prop(sequencer, "proxy_storage", text="Storage") flow.prop(ed, "proxy_storage", text="Storage")
if sequencer.proxy_storage == 'PROJECT': if ed.proxy_storage == 'PROJECT':
flow.prop(sequencer, "proxy_dir", text="Directory") flow.prop(ed, "proxy_dir", text="Directory")
else: else:
flow.prop(proxy, "use_proxy_custom_directory") flow.prop(proxy, "use_proxy_custom_directory")
flow.prop(proxy, "use_proxy_custom_file") flow.prop(proxy, "use_proxy_custom_file")
@@ -1192,7 +1192,7 @@ class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
layout = self.layout layout = self.layout
strip = act_strip(context) strip = act_strip(context)
sequencer = context.scene.sequence_editor ed = context.scene.sequence_editor
layout.prop(strip, "use_linear_modifiers") layout.prop(strip, "use_linear_modifiers")
@@ -1223,9 +1223,9 @@ class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
row.prop(mod, "input_mask_type", expand=True) row.prop(mod, "input_mask_type", expand=True)
if mod.input_mask_type == 'STRIP': if mod.input_mask_type == 'STRIP':
sequences_object = sequencer sequences_object = ed
if sequencer.meta_stack: if ed.meta_stack:
sequences_object = sequencer.meta_stack[-1] sequences_object = ed.meta_stack[-1]
box.prop_search(mod, "input_mask_strip", sequences_object, "sequences", text="Mask") box.prop_search(mod, "input_mask_strip", sequences_object, "sequences", text="Mask")
else: else:
box.prop(mod, "input_mask_id") box.prop(mod, "input_mask_id")

View File

@@ -234,7 +234,7 @@ void BKE_mesh_normals_loop_split(
const struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges, const struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges,
struct MLoop *mloops, float (*r_loopnors)[3], const int numLoops, struct MLoop *mloops, float (*r_loopnors)[3], const int numLoops,
struct MPoly *mpolys, const float (*polynors)[3], const int numPolys, struct 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); MLoopNorSpaceArray *r_lnors_spacearr, short (*clnors_data)[2], int *r_loop_to_poly);
void BKE_mesh_normals_loop_custom_set( void BKE_mesh_normals_loop_custom_set(

View File

@@ -1264,7 +1264,7 @@ void BKE_mesh_normals_loop_split(
const MVert *mverts, const int UNUSED(numVerts), MEdge *medges, const int numEdges, const MVert *mverts, const int UNUSED(numVerts), MEdge *medges, const int numEdges,
MLoop *mloops, float (*r_loopnors)[3], const int numLoops, MLoop *mloops, float (*r_loopnors)[3], const int numLoops,
MPoly *mpolys, const float (*polynors)[3], const int numPolys, 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) 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! */ /* 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); TIMEIT_START_AVERAGED(BKE_mesh_normals_loop_split);
#endif #endif
if (check_angle) { const float split_angle_cos = check_angle ? cosf(split_angle) : -1.0f;
split_angle = cosf(split_angle);
}
if (!r_lnors_spacearr && clnors_data) { if (!r_lnors_spacearr && clnors_data) {
/* We need to compute lnor spacearr if some custom lnor data are given to us! */ /* 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) || if (!(mp->flag & ME_SMOOTH) || (medges[ml_curr->e].flag & ME_SHARP) ||
ml_curr->v == mloops[e2l[0]].v || 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 ;) */ /* Note: we are sure that loop != 0 here ;) */
e2l[1] = INDEX_INVALID; e2l[1] = INDEX_INVALID;

View File

@@ -62,7 +62,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal)
{ {
MVert *mv, *mvert; MVert *mv, *mvert;
MEdge *me, *medge; MEdge *me, *medge;
MPoly /* *mpoly, */ /* UNUSED */ *mp; MPoly *mpoly, *mp;
MLoop *mloop; MLoop *mloop;
BMVert *v, **vtable; BMVert *v, **vtable;
BMEdge *e, **etable; BMEdge *e, **etable;
@@ -70,7 +70,6 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal)
BMFace *f; BMFace *f;
int i, j, totvert, totedge /* , totface */ /* UNUSED */ ; int i, j, totvert, totedge /* , totface */ /* UNUSED */ ;
bool is_init = (bm->totvert == 0) && (bm->totedge == 0) && (bm->totface == 0); 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; char has_orig_htype = 0;
int cd_vert_bweight_offset; 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__); etable = MEM_mallocN(sizeof(*etable) * totedge, __func__);
/*do verts*/ /*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++) { for (i = 0; i < totvert; i++, mv++) {
v = BM_vert_create(bm, mv->co, NULL, BM_CREATE_SKIP_CD); v = BM_vert_create(bm, mv->co, NULL, BM_CREATE_SKIP_CD);
normal_short_to_float_v3(v->no, mv->no); 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; *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; if (is_init) bm->elem_index_dirty &= ~BM_VERT;
/*do edges*/ /*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++) { for (i = 0; i < totedge; i++, me++) {
//BLI_assert(BM_edge_exists(vtable[me->v1], vtable[me->v2]) == NULL); //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); 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; *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; if (is_init) bm->elem_index_dirty &= ~BM_EDGE;
/* do faces */ /* do faces */
/* note: i_alt is aligned with bmesh faces which may not always align with mpolys */ /* note: i_alt is aligned with bmesh faces which may not always align with mpolys */
mp = dm->getPolyArray(dm); bool poly_allocated, loop_allocated;
mloop = dm->getLoopArray(dm); 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); face_normals = (dm->dirty & DM_DIRTY_NORMALS) ? NULL : CustomData_get_layer(&dm->polyData, CD_NORMAL);
for (i = 0; i < dm->numPolyData; i++, mp++) { for (i = 0; i < dm->numPolyData; i++, mp++) {
BMLoop *l_iter; 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; *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); if (is_init) bm->elem_index_dirty &= ~(BM_FACE | BM_LOOP);
MEM_freeN(vtable); MEM_freeN(vtable);

View File

@@ -394,7 +394,7 @@ void psys_apply_child_modifiers(ParticleThreadContext *ctx, struct ListBase *mod
get_strand_normal(ma, ornor, cur_length, (key-1)->vel); 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]; float dvec[3];
/* check if path needs to be cut before actual end of data points */ /* 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)) { if (!check_path_length(k, keys, key, max_length, step_length, &cur_length, dvec)) {

View File

@@ -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) { else if (seq->type == SEQ_TYPE_IMAGE) {
fname[0] = 0; 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_append(dir, sizeof(dir), fname);
BLI_path_abs(name, G.main->name); BLI_path_abs(name, G.main->name);
} }

View File

@@ -1207,17 +1207,17 @@ void BKE_texture_get_value(
BKE_texture_get_value_ex(scene, texture, tex_co, texres, NULL, use_color_management); 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) { for (bNode *node = ntree->nodes.first; node; node = node->next) {
if (node->type == SH_NODE_TEX_IMAGE && node->id != NULL) { if (node->type == SH_NODE_TEX_IMAGE && node->id != NULL) {
Image *image = (Image *)node->id; 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) { else if (node->type == NODE_GROUP && node->id != NULL) {
/* TODO(sergey): Do we need to control recursion here? */ /* TODO(sergey): Do we need to control recursion here? */
bNodeTree *nested_tree = (bNodeTree *)node->id; 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) void BKE_texture_fetch_images_for_pool(Tex *texture, struct ImagePool *pool)
{ {
if (texture->nodetree != NULL) { if (texture->nodetree != NULL) {
texture_nodes_fetch_images_for_pool(texture->nodetree, pool); texture_nodes_fetch_images_for_pool(texture, texture->nodetree, pool);
} }
else { else {
if (texture->type == TEX_IMAGE) { if (texture->type == TEX_IMAGE) {
if (texture->ima != NULL) { if (texture->ima != NULL) {
BKE_image_pool_acquire_ibuf(texture->ima, NULL, pool); BKE_image_pool_acquire_ibuf(texture->ima, &texture->iuser, pool);
} }
} }
} }

View File

@@ -87,6 +87,7 @@ void deg_graph_detect_cycles(Depsgraph *graph)
BLI_Stack *traversal_stack = BLI_stack_new(sizeof(StackEntry), BLI_Stack *traversal_stack = BLI_stack_new(sizeof(StackEntry),
"DEG detect cycles stack"); "DEG detect cycles stack");
int num_cycles = 0;
foreach (OperationDepsNode *node, graph->operations) { foreach (OperationDepsNode *node, graph->operations) {
bool has_inlinks = false; bool has_inlinks = false;
foreach (DepsRelation *rel, node->inlinks) { foreach (DepsRelation *rel, node->inlinks) {
@@ -136,6 +137,7 @@ void deg_graph_detect_cycles(Depsgraph *graph)
} }
/* TODO(sergey): So called russian roulette cycle solver. */ /* TODO(sergey): So called russian roulette cycle solver. */
rel->flag |= DEPSREL_FLAG_CYCLIC; rel->flag |= DEPSREL_FLAG_CYCLIC;
++num_cycles;
} }
else if (to_state == NODE_NOT_VISITED) { else if (to_state == NODE_NOT_VISITED) {
StackEntry new_entry; StackEntry new_entry;
@@ -157,6 +159,10 @@ void deg_graph_detect_cycles(Depsgraph *graph)
} }
BLI_stack_free(traversal_stack); BLI_stack_free(traversal_stack);
if (num_cycles != 0) {
printf("Detected %d dependency cycles\n", num_cycles);
}
} }
} // namespace DEG } // namespace DEG