diff --git a/object_fracture_voroni/__init__.py b/object_fracture_voroni/__init__.py index 11f76731358d8ef0d61b5a93905e92edcb54ca26..5122abefcda72df746b09c5d94831476a254efb8 100644 --- a/object_fracture_voroni/__init__.py +++ b/object_fracture_voroni/__init__.py @@ -246,6 +246,12 @@ class FractureCell(Operator): default=0.001, ) + material_index = IntProperty( + name="Material", + description="Material index for interior faces", + default=0, + ) + # ------------------------------------------------------------------------- # Object Options @@ -324,13 +330,15 @@ class FractureCell(Operator): box = layout.box() col = box.column() col.label("Mesh Data") - rowsub = col.row(align=True) + rowsub = col.row() rowsub.prop(self, "use_smooth_faces") rowsub.prop(self, "use_smooth_edges") rowsub.prop(self, "use_data_match") - rowsub.prop(self, "use_island_split") + rowsub.prop(self, "material_index") + rowsub = col.row() + # could be own section, control how we subdiv rowsub.prop(self, "margin") - # rowsub.prop(self, "use_island_split") # TODO + rowsub.prop(self, "use_island_split") box = layout.box() col = box.column() diff --git a/object_fracture_voroni/fracture_cell_setup.py b/object_fracture_voroni/fracture_cell_setup.py index 56b7d4422919ac00cf99653676a7014c22991c92..ee821716b736c93add29f872b3ee9a4230e71e15 100644 --- a/object_fracture_voroni/fracture_cell_setup.py +++ b/object_fracture_voroni/fracture_cell_setup.py @@ -124,6 +124,7 @@ def cell_fracture_objects(scene, obj, use_data_match=False, use_debug_points=False, margin=0.0, + material_index=0, ): from . import fracture_cell_calc @@ -233,6 +234,10 @@ def cell_fracture_objects(scene, obj, for bm_edge in bm.edges: bm_edge.smooth = True + if material_index != 0: + for bm_face in bm.faces: + bm_face.material_index = material_index + # --------------------------------------------------------------------- # MESH