Skip to content
Snippets Groups Projects
Commit 40372e3a authored by Bastien Montagne's avatar Bastien Montagne
Browse files

*Bug fixes (script thought there was 32 layers, lol).

*Commented out non-manifold check on returned shards, it prevented open meshes to be fractured (e.g. Suzanne).
*Enhanced UI of Fracture Group op.
parent a0b63f1f
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ bl_info = { ...@@ -21,7 +21,7 @@ bl_info = {
"author": "pildanovak", "author": "pildanovak",
"version": (2, 0), "version": (2, 0),
"blender": (2, 5, 7), "blender": (2, 5, 7),
"api": 35622, "api": 36147,
"location": "Search > Fracture Object & Add -> Fracture Helper Objects", "location": "Search > Fracture Object & Add -> Fracture Helper Objects",
"description": "Fractured Object, Bomb, Projectile, Recorder", "description": "Fractured Object, Bomb, Projectile, Recorder",
"warning": "", "warning": "",
......
...@@ -66,9 +66,6 @@ def create_cutter(context, crack_type, scale, roughness): ...@@ -66,9 +66,6 @@ def create_cutter(context, crack_type, scale, roughness):
location=(0, 0, 0), location=(0, 0, 0),
rotation=(0, 0, 0), rotation=(0, 0, 0),
layers=(True, False, False, False, layers=(True, False, False, False,
False, False, False, False,
False, False, False, False,
False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
...@@ -161,7 +158,7 @@ def getIslands(shard): ...@@ -161,7 +158,7 @@ def getIslands(shard):
bpy.ops.object.select_all(action='DESELECT') bpy.ops.object.select_all(action='DESELECT')
bpy.context.scene.objects.active = shard bpy.context.scene.objects.active = shard
shard.select = True shard.select = True
bpy.ops.object.duplicate(linked=False, mode=1) bpy.ops.object.duplicate(linked=False, mode='DUMMY')
a = bpy.context.scene.objects.active a = bpy.context.scene.objects.active
sm = a.data sm = a.data
print (a.name) print (a.name)
...@@ -231,8 +228,11 @@ def boolop(ob, cutter, op): ...@@ -231,8 +228,11 @@ def boolop(ob, cutter, op):
fault = 1 fault = 1
#print ('boolop: sizeerror') #print ('boolop: sizeerror')
elif min(nmesh.edge_face_count) < 2: # Manifold check # This checks whether returned shards are non-manifold.
fault = 1 # Problem is, if org mesh is non-manifold, it will always fail (e.g. with Suzanne).
# And disabling it does not seem to cause any problem…
# elif min(nmesh.edge_face_count) < 2: # Manifold check
# fault = 1
if not fault: if not fault:
new_shards = getIslands(new_shard) new_shards = getIslands(new_shard)
...@@ -407,25 +407,31 @@ class FractureGroup(bpy.types.Operator): ...@@ -407,25 +407,31 @@ class FractureGroup(bpy.types.Operator):
bl_options = {'REGISTER', 'UNDO'} bl_options = {'REGISTER', 'UNDO'}
exe = BoolProperty(name="Execute", exe = BoolProperty(name="Execute",
description="If it shall actually run, for optimal performance...", description="If it shall actually run, for optimal performance...",
default=False) default=False)
e = [] group = StringProperty(name="Group",
for i, g in enumerate(bpy.data.groups): description="Specify the group used for fracturing")
e.append((g.name, g.name, ''))
group = EnumProperty(name='Group (hit F8 to refresh list)', # e = []
items=e, # for i, g in enumerate(bpy.data.groups):
description='Specify the group used for fracturing') # e.append((g.name, g.name, ''))
# group = EnumProperty(name='Group (hit F8 to refresh list)',
# items=e,
# description='Specify the group used for fracturing')
def execute(self, context): def execute(self, context):
#getIslands(context.object) #getIslands(context.object)
if self.exe: if self.exe and self.group:
fracture_group(context, self.group) fracture_group(context, self.group)
return {'FINISHED'} return {'FINISHED'}
def draw(self, context):
layout = self.layout
layout.prop(self, "exe")
layout.prop_search(self, "group", bpy.data, "groups")
##################################################################### #####################################################################
# Import Functions # Import Functions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment