[Bf-blender-cvs] [605f4922375] soc-2019-npr: LANPR: make format.
YimingWu
noreply at git.blender.org
Thu Jun 27 10:41:11 CEST 2019
Commit: 605f49223754b4ad4ddbdc6b372d21421480fe85
Author: YimingWu
Date: Thu Jun 27 16:40:56 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rB605f49223754b4ad4ddbdc6b372d21421480fe85
LANPR: make format.
===================================================================
M release/scripts/startup/bl_ui/properties_render.py
M source/blender/blenloader/intern/versioning_280.c
M source/blender/draw/engines/lanpr/lanpr_access.c
M source/blender/draw/engines/lanpr/lanpr_chain.c
M source/blender/draw/engines/lanpr/lanpr_data_types.h
M source/blender/draw/engines/lanpr/lanpr_ops.c
M source/blender/makesdna/DNA_collection_types.h
M source/blender/makesrna/intern/rna_collection.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index 09f680c94e3..5449d266b37 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -739,6 +739,10 @@ class RENDER_PT_lanpr(RenderButtonsPanel, Panel):
row.prop(lanpr,'auto_update',toggle=True,text='Auto')
if not lanpr.auto_update:
row.operator("scene.lanpr_calculate", icon='RENDER_STILL', text='Update')
+
+ layout.label(text = "CAUTION: this bakes ALL frames!")
+ row=layout.row()
+ row.operator("scene.lanpr_bake_gp_strokes", icon='RENDER_ANIMATION', text='Bake GPencil Strokes')
if mode == "DPIX" or mode == "SOFTWARE":
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index b2aac37ec91..3b70d6582cc 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3545,7 +3545,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
sce->lanpr.chaining_image_threshold = 0.01;
sce->lanpr.chaining_geometry_threshold = 0.1;
}
- for (Collection* co = bmain->collections.first;co;co=co->id.next){
+ for (Collection *co = bmain->collections.first; co; co = co->id.next) {
co->lanpr.types = COLLECTION_FEATURE_LINE_ALL;
}
}
diff --git a/source/blender/draw/engines/lanpr/lanpr_access.c b/source/blender/draw/engines/lanpr/lanpr_access.c
index 4c380623485..3d3af4352e0 100644
--- a/source/blender/draw/engines/lanpr/lanpr_access.c
+++ b/source/blender/draw/engines/lanpr/lanpr_access.c
@@ -82,7 +82,7 @@ void lanpr_generate_gpencil_from_chain(Depsgraph *depsgraph,
if (!rlc->object_ref) {
continue; /* intersection lines are lost! */
}
- if(!(rlc->type & types)){
+ if (!(rlc->type & types)) {
continue;
}
if (rlc->level > qi_end || rlc->level < qi_begin) {
diff --git a/source/blender/draw/engines/lanpr/lanpr_chain.c b/source/blender/draw/engines/lanpr/lanpr_chain.c
index dccccdb9acd..eaecdc04609 100644
--- a/source/blender/draw/engines/lanpr/lanpr_chain.c
+++ b/source/blender/draw/engines/lanpr/lanpr_chain.c
@@ -53,7 +53,7 @@ LANPR_RenderLine *lanpr_get_connected_render_line(LANPR_BoundingArea *ba,
continue;
}
- if(match_flag && ((nrl->flags & LANPR_EDGE_FLAG_ALL_TYPE)&match_flag)==0){
+ if (match_flag && ((nrl->flags & LANPR_EDGE_FLAG_ALL_TYPE) & match_flag) == 0) {
continue;
}
@@ -265,7 +265,7 @@ void lanpr_NO_THREAD_chain_feature_lines(LANPR_RenderBuffer *rb)
N,
rl->flags,
rls->occlusion);
- while (ba && (new_rl = lanpr_get_connected_render_line(ba, new_rv, &new_rv,rl->flags))) {
+ while (ba && (new_rl = lanpr_get_connected_render_line(ba, new_rv, &new_rv, rl->flags))) {
new_rl->flags |= LANPR_EDGE_FLAG_CHAIN_PICKED;
N[0] = N[1] = N[2] = 0;
@@ -363,7 +363,7 @@ void lanpr_NO_THREAD_chain_feature_lines(LANPR_RenderBuffer *rb)
/* below already done in step 2 */
/* lanpr_push_render_line_chain_point(rb,rlc,new_rv->fbcoord[0],new_rv->fbcoord[1],rl->flags,0);
*/
- while (ba && (new_rl = lanpr_get_connected_render_line(ba, new_rv, &new_rv,rl->flags))) {
+ while (ba && (new_rl = lanpr_get_connected_render_line(ba, new_rv, &new_rv, rl->flags))) {
new_rl->flags |= LANPR_EDGE_FLAG_CHAIN_PICKED;
/* fix leading vertex type */
@@ -641,7 +641,7 @@ void lanpr_connect_chains(LANPR_RenderBuffer *rb, int do_geometry_space)
continue;
}
if (cre->rlc == rlc ||
- ((LANPR_RenderLineChainItem *)cre->rlc->chain.first)->occlusion != occlusion||
+ ((LANPR_RenderLineChainItem *)cre->rlc->chain.first)->occlusion != occlusion ||
(cre->rlc->type != rlc->type)) {
continue;
}
@@ -688,7 +688,7 @@ void lanpr_connect_chains(LANPR_RenderBuffer *rb, int do_geometry_space)
continue;
}
if (cre->rlc == rlc ||
- ((LANPR_RenderLineChainItem *)cre->rlc->chain.first)->occlusion != occlusion||
+ ((LANPR_RenderLineChainItem *)cre->rlc->chain.first)->occlusion != occlusion ||
(cre->rlc->type != rlc->type)) {
continue;
}
diff --git a/source/blender/draw/engines/lanpr/lanpr_data_types.h b/source/blender/draw/engines/lanpr/lanpr_data_types.h
index ef00f5a67df..a77a755be75 100644
--- a/source/blender/draw/engines/lanpr/lanpr_data_types.h
+++ b/source/blender/draw/engines/lanpr/lanpr_data_types.h
@@ -127,7 +127,7 @@ typedef struct LANPR_RenderLineChain {
float length; /* calculated before draw cmd. */
char picked; /* used when re-connecting and gp stroke generation */
char level;
- int type; /* Chain now only contains one type of segments */
+ int type; /* Chain now only contains one type of segments */
struct Object *object_ref;
} LANPR_RenderLineChain;
diff --git a/source/blender/draw/engines/lanpr/lanpr_ops.c b/source/blender/draw/engines/lanpr/lanpr_ops.c
index 053ef534e50..f48220af0f4 100644
--- a/source/blender/draw/engines/lanpr/lanpr_ops.c
+++ b/source/blender/draw/engines/lanpr/lanpr_ops.c
@@ -327,7 +327,7 @@ int lanpr_line_crosses_bounding_area(LANPR_RenderBuffer *fb,
if (((converted[0] = (real)ba->l) > MAX2(l[0], r[0])) ||
((converted[1] = (real)ba->r) < MIN2(l[0], r[0])) ||
((converted[2] = (real)ba->b) > MAX2(l[1], r[1])) ||
- ((converted[3] = (real)ba->u) < MIN2(l[1], r[1]))){
+ ((converted[3] = (real)ba->u) < MIN2(l[1], r[1]))) {
return 0;
}
@@ -377,20 +377,20 @@ int lanpr_triangle_covers_bounding_area(LANPR_RenderBuffer *fb,
if ((FBC1[0] >= p1[0] && FBC1[0] <= p2[0] && FBC1[1] >= p1[1] && FBC1[1] <= p3[1]) ||
(FBC2[0] >= p1[0] && FBC2[0] <= p2[0] && FBC2[1] >= p1[1] && FBC2[1] <= p3[1]) ||
- (FBC3[0] >= p1[0] && FBC3[0] <= p2[0] && FBC3[1] >= p1[1] && FBC3[1] <= p3[1])){
+ (FBC3[0] >= p1[0] && FBC3[0] <= p2[0] && FBC3[1] >= p1[1] && FBC3[1] <= p3[1])) {
return 1;
}
if (lanpr_point_inside_triangled(p1, FBC1, FBC2, FBC3) ||
lanpr_point_inside_triangled(p2, FBC1, FBC2, FBC3) ||
lanpr_point_inside_triangled(p3, FBC1, FBC2, FBC3) ||
- lanpr_point_inside_triangled(p4, FBC1, FBC2, FBC3)){
+ lanpr_point_inside_triangled(p4, FBC1, FBC2, FBC3)) {
return 1;
}
if ((lanpr_line_crosses_bounding_area(fb, FBC1, FBC2, ba)) ||
(lanpr_line_crosses_bounding_area(fb, FBC2, FBC3, ba)) ||
- (lanpr_line_crosses_bounding_area(fb, FBC3, FBC1, ba))){
+ (lanpr_line_crosses_bounding_area(fb, FBC3, FBC1, ba))) {
return 1;
}
@@ -4155,7 +4155,7 @@ void lanpr_software_draw_scene(void *vedata, GPUFrameBuffer *dfb, int is_render)
int lanpr_compute_feature_lines_internal(Depsgraph *depsgraph)
{
LANPR_RenderBuffer *rb;
- Scene* s = DEG_get_evaluated_scene(depsgraph);
+ Scene *s = DEG_get_evaluated_scene(depsgraph);
SceneLANPR *lanpr = &s->lanpr;
if (!lanpr->enabled) {
@@ -4558,9 +4558,9 @@ int lanpr_bake_gp_strokes_exec(struct bContext *C, struct wmOperator *op)
int frame_begin = scene->r.sfra;
int frame_end = scene->r.efra;
- for(frame = frame_begin;frame<=frame_end;frame++){
- //BKE_scene_frame_set(scene,frame);
- DEG_evaluate_on_framechange(CTX_data_main(C),dg,frame);
+ for (frame = frame_begin; frame <= frame_end; frame++) {
+ // BKE_scene_frame_set(scene,frame);
+ DEG_evaluate_on_framechange(CTX_data_main(C), dg, frame);
lanpr_compute_feature_lines_internal(dg);
@@ -4571,8 +4571,6 @@ int lanpr_bake_gp_strokes_exec(struct bContext *C, struct wmOperator *op)
lanpr_update_gp_strokes_collection(dg, scene->master_collection, frame);
}
-
-
return OPERATOR_FINISHED;
}
@@ -4679,4 +4677,3 @@ void SCENE_OT_lanpr_bake_gp_strokes(struct wmOperatorType *ot)
ot->exec = lanpr_bake_gp_strokes_exec;
}
-
diff --git a/source/blender/makesdna/DNA_collection_types.h b/source/blender/makesdna/DNA_collection_types.h
index 2ca7b326d3a..33bdaf13bec 100644
--- a/source/blender/makesdna/DNA_collection_types.h
+++ b/source/blender/makesdna/DNA_collection_types.h
@@ -75,8 +75,9 @@ enum CollectionFeatureLine_TypeFlag {
};
#define COLLECTION_FEATURE_LINE_ALL \
- (COLLECTION_FEATURE_LINE_CONTOUR | COLLECTION_FEATURE_LINE_CREASE | COLLECTION_FEATURE_LINE_MARK | \
- COLLECTION_FEATURE_LINE_MATERIAL | COLLECTION_FEATURE_LINE_INTERSECTION)
+ (COLLECTION_FEATURE_LINE_CONTOUR | COLLECTION_FEATURE_LINE_CREASE | \
+ COLLECTION_FEATURE_LINE_MARK | COLLECTION_FEATURE_LINE_MATERIAL | \
+ COLLECTION_FEATURE_LINE_INTERSECTION)
/* CollectionLANPR->mode */
enum {
diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c
index c4b917ee7b3..12fdebbb8ca 100644
--- a/source/blender/makesrna/intern/rna_collection.c
+++ b/source/blender/makesrna/intern/rna_collection.c
@@ -385,7 +385,6 @@ static void rna_def_collection_lanpr(BlenderRNA *brna, StructRNA *srna)
RNA_def_property_ui_text(prop, "Usage", "How to use this collection in LANPR");
RNA_def_property_update(prop, NC_SCENE, NULL);
-
prop = RNA_def_property(srna, "enable_contour", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "types", COLLECTION_FEATURE_LINE_CONTOUR);
RNA_def_property_ui_text(prop, "Contour", "Contour lines");
More information about the Bf-blender-cvs
mailing list