[Bf-blender-cvs] [ff29428e0d3] temp-lineart-contained: Merge remote-tracking branch 'origin/master' into temp-lineart-contained

YimingWu noreply at git.blender.org
Wed Jun 30 04:55:16 CEST 2021


Commit: ff29428e0d352c592d9b4548fb4daf031f015bd2
Author: YimingWu
Date:   Wed Jun 30 10:54:53 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rBff29428e0d352c592d9b4548fb4daf031f015bd2

Merge remote-tracking branch 'origin/master' into temp-lineart-contained

===================================================================



===================================================================

diff --cc source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index c9eceb4893f,9593a1364e7..687efe31a44
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@@ -744,12 -653,8 +742,14 @@@ static void panelRegister(ARegionType *
                                       material_mask_panel_draw_header,
                                       material_mask_panel_draw,
                                       occlusion_panel);
 +  gpencil_modifier_subpanel_register(region_type,
 +                                     "intersection",
 +                                     "",
 +                                     intersection_panel_draw_header,
 +                                     intersection_panel_draw,
 +                                     panel_type);
+   gpencil_modifier_subpanel_register(
+       region_type, "intersection", "Intersection", NULL, intersection_panel_draw, panel_type);
    gpencil_modifier_subpanel_register(
        region_type, "face_mark", "", face_mark_panel_draw_header, face_mark_panel_draw, panel_type);
    gpencil_modifier_subpanel_register(
diff --cc source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
index 1d1c91cf5c2,247b0b3f57b..5c84f7b11d7
--- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
@@@ -393,9 -378,9 +394,9 @@@ typedef struct LineartObjectInfo 
    double model_view_proj[4][4];
    double model_view[4][4];
    double normal[4][4];
 -  LineartElementLinkNode *v_eln;
 +  LineartElementLinkNode *eln;
    int usage;
-   unsigned char override_intersection_mask;
+   uint8_t override_intersection_mask;
    int global_i_offset;
  
    bool free_use_mesh;
diff --cc source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 52e45438f43,c05749061a9..7771c1c66b0
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@@ -2009,40 -1932,25 +2009,44 @@@ static void lineart_object_load_worker(
    }
  }
  
- static bool _lineart_object_not_in_source_collection(Collection *source, Object *ob)
+ static uchar lineart_intersection_mask_check(Collection *c, Object *ob)
  {
-   CollectionChild *cc;
-   Collection *c = source->id.orig_id ? (Collection *)source->id.orig_id : source;
-   if (BKE_collection_has_object_recursive_instanced(c, (Object *)(ob->id.orig_id))) {
-     return false;
+   LISTBASE_FOREACH (CollectionChild *, cc, &c->children) {
+     uchar result = lineart_intersection_mask_check(cc->collection, ob);
+     if (result) {
+       return result;
+     }
    }
-   for (cc = source->children.first; cc; cc = cc->next) {
-     if (!_lineart_object_not_in_source_collection(cc->collection, ob)) {
-       return false;
+ 
+   if (c->children.first == NULL) {
+     if (BKE_collection_has_object(c, (Object *)(ob->id.orig_id))) {
+       if (c->lineart_flags & COLLECTION_LRT_USE_INTERSECTION_MASK) {
+         return c->lineart_intersection_mask;
+       }
      }
    }
-   return true;
+   return 0;
  }
  
 +static uchar lineart_intersection_mask_check(Collection *c, Object *ob)
 +{
 +  LISTBASE_FOREACH (CollectionChild *, cc, &c->children) {
 +    uchar result = lineart_intersection_mask_check(cc->collection, ob);
 +    if (result) {
 +      return result;
 +    }
 +  }
 +
 +  if (c->children.first == NULL) {
 +    if (BKE_collection_has_object(c, (Object *)(ob->id.orig_id))) {
 +      if (c->lineart_flags & COLLECTION_LRT_USE_INTERSECTION_MASK) {
 +        return c->lineart_intersection_mask;
 +      }
 +    }
 +  }
 +  return 0;
 +}
 +
  /**
   * See if this object in such collection is used for generating line art,
   * Disabling a collection for line art will doable all objects inside.
diff --cc source/blender/makesrna/intern/rna_gpencil_modifier.c
index bdaa844a9ba,3e6048e30c4..503feb37058
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@@ -3078,15 -3011,9 +3078,15 @@@ static void rna_def_modifier_gpencillin
    prop = RNA_def_property(srna, "use_material_mask_bits", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "material_mask_bits", 1);
    RNA_def_property_array(prop, 8);
-   RNA_def_property_ui_text(prop, "Masks", "");
+   RNA_def_property_ui_text(prop, "Masks", "Mask bits to match from Material Line Art settings");
    RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
  
 +  prop = RNA_def_property(srna, "use_intersection_filter", PROP_BOOLEAN, PROP_NONE);
 +  RNA_def_property_boolean_sdna(prop, NULL, "mask_switches", LRT_GPENCIL_INTERSECTION_FILTER);
 +  RNA_def_property_ui_text(
 +      prop, "Flter Intersection", "Filter intersection lines using mask bits");
 +  RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
 +
    prop = RNA_def_property(srna, "use_intersection_match", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "mask_switches", LRT_GPENCIL_INTERSECTION_MATCH);
    RNA_def_property_ui_text(
@@@ -3096,30 -3023,9 +3096,30 @@@
    prop = RNA_def_property(srna, "use_intersection_mask", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "intersection_mask", 1);
    RNA_def_property_array(prop, 8);
-   RNA_def_property_ui_text(prop, "Masks", "");
+   RNA_def_property_ui_text(prop, "Masks", "Mask bits to match from Collection Line Art settings");
    RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
  
 +  prop = RNA_def_property(srna, "use_crease_on_smooth", PROP_BOOLEAN, PROP_NONE);
 +  RNA_def_property_boolean_sdna(
 +      prop, NULL, "calculation_flags", LRT_USE_CREASE_ON_SMOOTH_SURFACES);
 +  RNA_def_property_ui_text(
 +      prop, "Crease On Smooth Surfaces", "Allow crease edges to show inside smooth surfaces");
 +  RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
 +
 +  prop = RNA_def_property(srna, "use_crease_on_sharp", PROP_BOOLEAN, PROP_NONE);
 +  RNA_def_property_boolean_sdna(prop, NULL, "calculation_flags", LRT_USE_CREASE_ON_SHARP_EDGES);
 +  RNA_def_property_ui_text(prop, "Crease On Sharp Edges", "Allow crease to show on sharp edges");
 +  RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
 +
 +  prop = RNA_def_property(srna, "use_back_face_culling", PROP_BOOLEAN, PROP_NONE);
 +  RNA_def_property_boolean_sdna(prop, NULL, "calculation_flags", LRT_USE_BACK_FACE_CULLING);
 +  RNA_def_property_ui_text(
 +      prop,
 +      "Back Face Culling",
 +      "Remove all back faces to speed up calculation, this will create edges in "
 +      "different occlusion levels than when disabled");
 +  RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
 +
    RNA_define_lib_overridable(false);
  }



More information about the Bf-blender-cvs mailing list