Cleanup: Remove redundant mesh data mask handling

Byte colors are generic attributes and are therefore included in
CD_MASK_PROP_ALL. Also clarify the use of vertex groups.
They always have to be propagated since they're displayed in
the spreadsheet, etc.
This commit is contained in:
Hans Goudey 2023-01-10 20:07:47 -05:00
parent 8367f2bffc
commit 32812c2cc2
2 changed files with 5 additions and 8 deletions

View File

@ -517,8 +517,7 @@ static int customdata_compare(
{
CustomDataLayer *l1, *l2;
int layer_count1 = 0, layer_count2 = 0, j;
const uint64_t cd_mask_non_generic = CD_MASK_MEDGE | CD_MASK_MPOLY | CD_MASK_PROP_BYTE_COLOR |
CD_MASK_MDEFORMVERT;
const uint64_t cd_mask_non_generic = CD_MASK_MEDGE | CD_MASK_MPOLY | CD_MASK_MDEFORMVERT;
const uint64_t cd_mask_all_attr = CD_MASK_PROP_ALL | cd_mask_non_generic;
const Span<MLoop> loops_1 = m1->loops();
const Span<MLoop> loops_2 = m2->loops();

View File

@ -141,9 +141,9 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o
CustomData_MeshMasks cddata_masks = scene->customdata_mask;
CustomData_MeshMasks_update(&cddata_masks, &CD_MASK_BAREMESH);
/* Custom attributes should not be removed automatically. They might be used by the render
* engine or scripts. They can still be removed explicitly using geometry nodes.
* Crease can be used in generic situations with geometry nodes as well. */
cddata_masks.vmask |= CD_MASK_PROP_ALL | CD_MASK_CREASE;
* engine or scripts. They can still be removed explicitly using geometry nodes. Crease and
* vertex groups can be used in arbitrary situations with geometry nodes as well. */
cddata_masks.vmask |= CD_MASK_PROP_ALL | CD_MASK_CREASE | CD_MASK_MDEFORMVERT;
cddata_masks.emask |= CD_MASK_PROP_ALL | CD_MASK_CREASE;
cddata_masks.fmask |= CD_MASK_PROP_ALL;
cddata_masks.pmask |= CD_MASK_PROP_ALL;
@ -154,12 +154,10 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o
#ifdef WITH_FREESTYLE
cddata_masks.emask |= CD_MASK_FREESTYLE_EDGE;
cddata_masks.pmask |= CD_MASK_FREESTYLE_FACE;
cddata_masks.vmask |= CD_MASK_MDEFORMVERT;
#endif
if (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER) {
/* Always compute UVs, vertex colors as orcos for render. */
cddata_masks.lmask |= CD_MASK_PROP_FLOAT2 | CD_MASK_PROP_BYTE_COLOR;
cddata_masks.vmask |= CD_MASK_ORCO | CD_MASK_PROP_COLOR;
cddata_masks.vmask |= CD_MASK_ORCO;
}
makeDerivedMesh(depsgraph, scene, ob, &cddata_masks); /* was CD_MASK_BAREMESH */
break;