[Bf-blender-cvs] [d9683a5937f] refactor-mesh-hide-generic: Merge branch 'master' into refactor-mesh-hide-generic
Hans Goudey
noreply at git.blender.org
Wed Aug 3 05:24:45 CEST 2022
Commit: d9683a5937fe6e55c309df06a47b9d551902d5bc
Author: Hans Goudey
Date: Tue Aug 2 22:17:46 2022 -0500
Branches: refactor-mesh-hide-generic
https://developer.blender.org/rBd9683a5937fe6e55c309df06a47b9d551902d5bc
Merge branch 'master' into refactor-mesh-hide-generic
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/pbvh.c
index e5bcac6b1d7,dae9788d21c..d3ba53fc310
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@@ -3225,27 -3207,6 +3211,27 @@@ const float (*BKE_pbvh_get_vert_normals
return pbvh->vert_normals;
}
+const bool *BKE_pbvh_get_vert_hide(const PBVH *pbvh)
+{
- BLI_assert(pbvh->type == PBVH_FACES);
++ BLI_assert(pbvh->header.type == PBVH_FACES);
+ return pbvh->hide_vert;
+}
+
+bool *BKE_pbvh_get_vert_hide_for_write(PBVH *pbvh)
+{
- BLI_assert(pbvh->type == PBVH_FACES);
++ BLI_assert(pbvh->header.type == PBVH_FACES);
+ if (pbvh->hide_vert) {
+ return pbvh->hide_vert;
+ }
+ pbvh->hide_vert = CustomData_get_layer_named(&pbvh->mesh->vdata, CD_PROP_BOOL, ".hide_vert");
+ if (pbvh->hide_vert) {
+ return pbvh->hide_vert;
+ }
+ pbvh->hide_vert = (bool *)CustomData_add_layer_named(
+ &pbvh->mesh->vdata, CD_PROP_BOOL, CD_CALLOC, NULL, pbvh->mesh->totvert, ".hide_vert");
+ return pbvh->hide_vert;
+}
+
void BKE_pbvh_subdiv_cgg_set(PBVH *pbvh, SubdivCCG *subdiv_ccg)
{
pbvh->subdiv_ccg = subdiv_ccg;
diff --cc source/blender/gpu/intern/gpu_buffers.c
index 33322fe7988,9e8e75be23b..0b954dbec5e
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@@ -235,14 -233,11 +232,14 @@@ void GPU_pbvh_mesh_buffers_update(PBVHG
GPUAttrRef vcol_refs[MAX_GPU_ATTR];
GPUAttrRef cd_uvs[MAX_GPU_ATTR];
- Mesh me_query;
- BKE_id_attribute_copy_domains_temp(ID_ME, vdata, NULL, ldata, NULL, NULL, &me_query.id);
++ const bool *hide_vert = (bool *)CustomData_get_layer_named(
++ &mesh->vdata, CD_PROP_BOOL, ".hide_vert");
+
- CustomDataLayer *actcol = BKE_id_attributes_active_color_get(&me_query.id);
- eAttrDomain actcol_domain = actcol ? BKE_id_attribute_domain(&me_query.id, actcol) :
+ const CustomDataLayer *actcol = BKE_id_attributes_active_color_get(&mesh->id);
+ eAttrDomain actcol_domain = actcol ? BKE_id_attribute_domain(&mesh->id, actcol) :
ATTR_DOMAIN_AUTO;
- CustomDataLayer *rendercol = BKE_id_attributes_render_color_get(&me_query.id);
+ const CustomDataLayer *rendercol = BKE_id_attributes_render_color_get(&mesh->id);
int totcol;
@@@ -471,8 -464,11 +466,14 @@@ GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers
int i, tottri;
int tot_real_edges = 0;
+ const MPoly *mpoly = mesh->mpoly;
+ const MLoop *mloop = mesh->mloop;
+
buffers = MEM_callocN(sizeof(GPU_PBVH_Buffers), "GPU_Buffers");
++ const bool *hide_vert = (bool *)CustomData_get_layer_named(
++ &mesh->vdata, CD_PROP_BOOL, ".hide_vert");
++
/* smooth or flat for all */
buffers->smooth = mpoly[looptri[face_indices[0]].poly].flag & ME_SMOOTH;
More information about the Bf-blender-cvs
mailing list