From 659e985488e705b6d749d92194b92e6378abf0bf Mon Sep 17 00:00:00 2001 From: Campbell Barton <ideasman42@gmail.com> Date: Tue, 3 Jul 2012 16:06:41 +0000 Subject: [PATCH] material for internal faces. --- object_fracture_voroni/__init__.py | 14 +++++++++++--- object_fracture_voroni/fracture_cell_setup.py | 5 +++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/object_fracture_voroni/__init__.py b/object_fracture_voroni/__init__.py index 11f767313..5122abefc 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 56b7d4422..ee821716b 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 -- GitLab