[Bf-blender-cvs] [2ed35a9f933] lanpr-under-gp: LineArt: Collection "no intersection" flag
YimingWu
noreply at git.blender.org
Sun Sep 27 06:58:33 CEST 2020
Commit: 2ed35a9f933fad7e0e9c2cd454119b34747f9d17
Author: YimingWu
Date: Sun Sep 27 11:02:53 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB2ed35a9f933fad7e0e9c2cd454119b34747f9d17
LineArt: Collection "no intersection" flag
===================================================================
M source/blender/editors/lineart/lineart_cpu.c
M source/blender/makesdna/DNA_collection_types.h
M source/blender/makesrna/intern/rna_collection.c
===================================================================
diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c
index 6bb17162f88..4455ad88319 100644
--- a/source/blender/editors/lineart/lineart_cpu.c
+++ b/source/blender/editors/lineart/lineart_cpu.c
@@ -1666,7 +1666,7 @@ static void lineart_geometry_object_load(Depsgraph *dg,
if (usage == OBJECT_LRT_INTERSECTION_ONLY) {
rt->flags |= LRT_TRIANGLE_INTERSECTION_ONLY;
}
- else if (usage == OBJECT_LRT_NO_INTERSECTION) {
+ else if (usage == OBJECT_LRT_NO_INTERSECTION || usage == OBJECT_LRT_OCCLUSION_ONLY) {
rt->flags |= LRT_TRIANGLE_NO_INTERSECTION;
}
@@ -1691,7 +1691,8 @@ int ED_lineart_object_collection_usage_check(Collection *c, Object *ob)
int object_is_used = (ob->lineart.usage == OBJECT_LRT_INCLUDE ||
ob->lineart.usage == OBJECT_LRT_INHERENT ||
- ob->lineart.usage == OBJECT_LRT_INTERSECTION_ONLY);
+ ob->lineart.usage == OBJECT_LRT_INTERSECTION_ONLY ||
+ ob->lineart.usage == OBJECT_LRT_NO_INTERSECTION);
if (object_is_used && (c->lineart_usage != COLLECTION_LRT_INCLUDE)) {
if (BKE_collection_has_object_recursive(c, (Object *)(ob->id.orig_id))) {
@@ -1704,6 +1705,9 @@ int ED_lineart_object_collection_usage_check(Collection *c, Object *ob)
else if (c->lineart_usage == COLLECTION_LRT_INTERSECTION_ONLY) {
return OBJECT_LRT_INTERSECTION_ONLY;
}
+ else if (c->lineart_usage == COLLECTION_LRT_NO_INTERSECTION) {
+ return OBJECT_LRT_NO_INTERSECTION;
+ }
}
}
@@ -1719,6 +1723,9 @@ int ED_lineart_object_collection_usage_check(Collection *c, Object *ob)
else if (c->lineart_usage == COLLECTION_LRT_INTERSECTION_ONLY) {
return OBJECT_LRT_INTERSECTION_ONLY;
}
+ else if (c->lineart_usage == COLLECTION_LRT_NO_INTERSECTION) {
+ return OBJECT_LRT_NO_INTERSECTION;
+ }
else {
return OBJECT_LRT_INHERENT;
}
@@ -3439,7 +3446,7 @@ static void lineart_main_add_triangles(LineartRenderBuffer *rb)
0,
1,
0,
- (!(rt->flags & OBJECT_LRT_NO_INTERSECTION)));
+ (!(rt->flags & LRT_TRIANGLE_NO_INTERSECTION)));
}
}
temp_count++;
diff --git a/source/blender/makesdna/DNA_collection_types.h b/source/blender/makesdna/DNA_collection_types.h
index 2cc052b2f67..d7d4686c40f 100644
--- a/source/blender/makesdna/DNA_collection_types.h
+++ b/source/blender/makesdna/DNA_collection_types.h
@@ -47,6 +47,7 @@ enum CollectionFeatureLine_Usage {
COLLECTION_LRT_OCCLUSION_ONLY = (1 << 0),
COLLECTION_LRT_EXCLUDE = (1 << 1),
COLLECTION_LRT_INTERSECTION_ONLY = (1 << 2),
+ COLLECTION_LRT_NO_INTERSECTION = (1 << 3),
};
typedef struct Collection {
diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c
index 57f2d04537f..1a002a5ba50 100644
--- a/source/blender/makesrna/intern/rna_collection.c
+++ b/source/blender/makesrna/intern/rna_collection.c
@@ -508,13 +508,18 @@ void RNA_def_collections(BlenderRNA *brna)
0,
"Intersection Only",
"Only generate intersection lines with this collection"},
+ {COLLECTION_LRT_NO_INTERSECTION,
+ "NO_INTERSECTION",
+ 0,
+ "No Intersection",
+ "Do not generate intersection lines for this collection"},
{0, NULL, 0, NULL, NULL}};
prop = RNA_def_property(srna, "lineart_usage", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, rna_collection_lineart_usage);
RNA_def_property_ui_text(prop, "Usage", "How to use this collection in LRT");
RNA_def_property_update(prop, NC_SCENE, NULL);
-
+
prop = RNA_def_property(srna, "color_tag", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "color_tag");
RNA_def_property_enum_items(prop, rna_enum_collection_color_items);
More information about the Bf-blender-cvs
mailing list