[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3567] trunk/py/scripts/addons/ object_fracture_voroni: material for internal faces.

Campbell Barton ideasman42 at gmail.com
Tue Jul 3 18:06:43 CEST 2012


Revision: 3567
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3567
Author:   campbellbarton
Date:     2012-07-03 16:06:41 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
material for internal faces.

Modified Paths:
--------------
    trunk/py/scripts/addons/object_fracture_voroni/__init__.py
    trunk/py/scripts/addons/object_fracture_voroni/fracture_cell_setup.py

Modified: trunk/py/scripts/addons/object_fracture_voroni/__init__.py
===================================================================
--- trunk/py/scripts/addons/object_fracture_voroni/__init__.py	2012-07-03 15:28:44 UTC (rev 3566)
+++ trunk/py/scripts/addons/object_fracture_voroni/__init__.py	2012-07-03 16:06:41 UTC (rev 3567)
@@ -246,6 +246,12 @@
             default=0.001,
             )
 
+    material_index = IntProperty(
+            name="Material",
+            description="Material index for interior faces",
+            default=0,
+            )
+
     # -------------------------------------------------------------------------
     # Object Options
 
@@ -324,13 +330,15 @@
         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, "material_index")
+        rowsub = col.row()
+        # could be own section, control how we subdiv
+        rowsub.prop(self, "margin")
         rowsub.prop(self, "use_island_split")
-        rowsub.prop(self, "margin")
-        # rowsub.prop(self, "use_island_split")  # TODO
 
         box = layout.box()
         col = box.column()

Modified: trunk/py/scripts/addons/object_fracture_voroni/fracture_cell_setup.py
===================================================================
--- trunk/py/scripts/addons/object_fracture_voroni/fracture_cell_setup.py	2012-07-03 15:28:44 UTC (rev 3566)
+++ trunk/py/scripts/addons/object_fracture_voroni/fracture_cell_setup.py	2012-07-03 16:06:41 UTC (rev 3567)
@@ -124,6 +124,7 @@
                           use_data_match=False,
                           use_debug_points=False,
                           margin=0.0,
+                          material_index=0,
                           ):
     
     from . import fracture_cell_calc
@@ -233,7 +234,11 @@
             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
 



More information about the Bf-extensions-cvs mailing list