summaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-06-13 15:44:50 -0700
committeryum <yum.food.vr@gmail.com>2025-06-13 15:44:50 -0700
commitf639117b1f743ab2941667b32b190dd1e715d4a5 (patch)
tree4ade9dece93c4a7d94103c395892c44204b87027 /Scripts
parent96af8aa116b3605bccfb0efb643a4a0e20962530 (diff)
More optional passes get discarded when not locked
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/BakeVertexData.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Scripts/BakeVertexData.py b/Scripts/BakeVertexData.py
index 17d4b60..670e087 100644
--- a/Scripts/BakeVertexData.py
+++ b/Scripts/BakeVertexData.py
@@ -503,7 +503,7 @@ class MESH_OT_deduplicate_submeshes(BaseSubmeshOperator, ToleranceOperatorMixin)
class MESH_OT_select_hidden_faces(BaseSubmeshOperator, ToleranceOperatorMixin):
bl_idname = "mesh.select_hidden_faces"
bl_label = "Select Hidden Faces"
- bl_description = "Select faces that are hidden behind other faces (overlapping with opposing normals)"
+ bl_description = "Select faces that are hidden behind other faces (overlapping with opposing normals and same material)"
position_tolerance: FloatProperty(
name="Position Tolerance",
@@ -600,7 +600,8 @@ class MESH_OT_select_hidden_faces(BaseSubmeshOperator, ToleranceOperatorMixin):
face_data[face.index] = {
'normal': face.normal.normalized(),
'face': face,
- 'center': center
+ 'center': center,
+ 'material_index': face.material_index
}
# Hash by center position (with boundary handling)
@@ -631,6 +632,10 @@ class MESH_OT_select_hidden_faces(BaseSubmeshOperator, ToleranceOperatorMixin):
face1_data = face_data[face1_idx]
face2_data = face_data[face2_idx]
+ # Check if faces use the same material
+ if face1_data['material_index'] != face2_data['material_index']:
+ continue
+
# Quick check: opposing normals
dot_product = face1_data['normal'].dot(face2_data['normal'])
if dot_product >= 0:
@@ -679,6 +684,7 @@ class MESH_OT_select_hidden_faces(BaseSubmeshOperator, ToleranceOperatorMixin):
layout.prop(self, "position_tolerance")
layout.prop(self, "normal_tolerance")
layout.label(text="Selects overlapping faces with opposing normals", icon='INFO')
+ layout.label(text="Only considers faces with the same material", icon='INFO')
class UVOperatorMixin: