[Bf-blender-cvs] [282a861e11b] master: Fix incorrect custom-data layer access for hide layers

Campbell Barton noreply at git.blender.org
Fri Aug 12 01:16:38 CEST 2022


Commit: 282a861e11b312621dfc9db2be7022e8d3b000c8
Author: Campbell Barton
Date:   Fri Aug 12 09:13:14 2022 +1000
Branches: master
https://developer.blender.org/rB282a861e11b312621dfc9db2be7022e8d3b000c8

Fix incorrect custom-data layer access for hide layers

Error in [0], missed in review.

[0] 2480b55f216c31373a84bc5c5d2b0cc158497c44

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

M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/makesrna/intern/rna_mesh.c

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

diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index cd609f7e8cf..763848574ed 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -370,7 +370,7 @@ static bool edbm_backbuf_check_and_select_faces_obmode(Mesh *me,
 
   if (mpoly) {
     const bool *hide_poly = (const bool *)CustomData_get_layer_named(
-        &me->vdata, CD_PROP_BOOL, ".hide_poly");
+        &me->pdata, CD_PROP_BOOL, ".hide_poly");
 
     for (int index = 0; index < me->totpoly; index++, mpoly++) {
       if (!(hide_poly && hide_poly[index])) {
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 46b6a5d9451..9580c1178ec 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -418,7 +418,7 @@ static void rna_MeshVertex_hide_set(PointerRNA *ptr, bool value)
       &mesh->vdata, CD_PROP_BOOL, ".hide_vert", mesh->totvert);
   if (!hide_vert) {
     if (!value) {
-      /* Skip adding layer if it doesn't exist already anyway and we're not hiding an element.. */
+      /* Skip adding layer if it doesn't exist already anyway and we're not hiding an element. */
       return;
     }
     hide_vert = (bool *)CustomData_add_layer_named(
@@ -552,7 +552,7 @@ static void rna_MeshPolygon_hide_set(PointerRNA *ptr, bool value)
       &mesh->pdata, CD_PROP_BOOL, ".hide_poly", mesh->totpoly);
   if (!hide_poly) {
     if (!value) {
-      /* Skip adding layer if it doesn't exist already anyway and we're not hiding an element.. */
+      /* Skip adding layer if it doesn't exist already anyway and we're not hiding an element. */
       return;
     }
     hide_poly = (bool *)CustomData_add_layer_named(
@@ -1276,7 +1276,7 @@ static bool rna_MeshEdge_hide_get(PointerRNA *ptr)
 {
   const Mesh *mesh = rna_mesh(ptr);
   const bool *hide_edge = (const bool *)CustomData_get_layer_named(
-      &mesh->pdata, CD_PROP_BOOL, ".hide_edge");
+      &mesh->edata, CD_PROP_BOOL, ".hide_edge");
   const int index = rna_MeshEdge_index_get(ptr);
   return hide_edge == NULL ? false : hide_edge[index];
 }
@@ -1288,7 +1288,7 @@ static void rna_MeshEdge_hide_set(PointerRNA *ptr, bool value)
       &mesh->edata, CD_PROP_BOOL, ".hide_edge", mesh->totedge);
   if (!hide_edge) {
     if (!value) {
-      /* Skip adding layer if it doesn't exist already anyway and we're not hiding an element.. */
+      /* Skip adding layer if it doesn't exist already anyway and we're not hiding an element. */
       return;
     }
     hide_edge = (bool *)CustomData_add_layer_named(



More information about the Bf-blender-cvs mailing list