[Bf-extensions-cvs] [81b8ca6c] master: remove object_fracture/ unsupported: T63272
meta-androcto
noreply at git.blender.org
Thu Apr 4 10:50:08 CEST 2019
Commit: 81b8ca6cf3e75d8fbf846846c89814e38e93ce31
Author: meta-androcto
Date: Thu Apr 4 19:49:41 2019 +1100
Branches: master
https://developer.blender.org/rBA81b8ca6cf3e75d8fbf846846c89814e38e93ce31
remove object_fracture/ unsupported: T63272
===================================================================
D object_fracture/__init__.py
D object_fracture/data.blend
D object_fracture/fracture_ops.py
D object_fracture/fracture_setup.py
===================================================================
diff --git a/object_fracture/__init__.py b/object_fracture/__init__.py
deleted file mode 100644
index 5dad8801..00000000
--- a/object_fracture/__init__.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-bl_info = {
- "name": "Fracture Tools",
- "author": "pildanovak",
- "version": (2, 0, 1),
- "blender": (2, 72, 0),
- "location": "Search > Fracture Object & Add > Fracture Helper Objects",
- "description": "Fractured Object, Bomb, Projectile, Recorder",
- "warning": "",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Object/Fracture",
- "category": "Object",
-}
-
-
-if "bpy" in locals():
- import importlib
- importlib.reload(fracture_ops)
- importlib.reload(fracture_setup)
-else:
- from . import fracture_ops
- from . import fracture_setup
-
-import bpy
-
-
-class VIEW3D_MT_add_fracture_objects(bpy.types.Menu):
- bl_idname = "VIEW3D_MT_add_fracture_objects"
- bl_label = "Fracture Helper Objects"
-
- def draw(self, context):
- layout = self.layout
- layout.operator_context = 'INVOKE_REGION_WIN'
-
- layout.operator("object.import_fracture_bomb",
- text="Bomb")
- layout.operator("object.import_fracture_projectile",
- text="Projectile")
- layout.operator("object.import_fracture_recorder",
- text="Rigidbody Recorder")
-
-
-def menu_func(self, context):
- self.layout.menu("VIEW3D_MT_add_fracture_objects")
-
-
-def register():
- bpy.utils.register_module(__name__)
-
- # Add the "add fracture objects" menu to the "Add" menu
- bpy.types.VIEW3D_MT_add.append(menu_func)
-
-
-def unregister():
- bpy.utils.unregister_module(__name__)
-
- # Remove "add fracture objects" menu from the "Add" menu.
- bpy.types.VIEW3D_MT_add.remove(menu_func)
-
-
-if __name__ == "__main__":
- register()
diff --git a/object_fracture/data.blend b/object_fracture/data.blend
deleted file mode 100644
index a466e9dd..00000000
Binary files a/object_fracture/data.blend and /dev/null differ
diff --git a/object_fracture/fracture_ops.py b/object_fracture/fracture_ops.py
deleted file mode 100644
index 15a6f8f2..00000000
--- a/object_fracture/fracture_ops.py
+++ /dev/null
@@ -1,507 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-from bpy.props import *
-import os
-import random
-from mathutils import *
-
-
-def create_cutter(context, crack_type, scale, roughness):
- ncuts = 12
- if crack_type == 'FLAT' or crack_type == 'FLAT_ROUGH':
- bpy.ops.mesh.primitive_cube_add(
- view_align=False,
- enter_editmode=False,
- location=(0, 0, 0),
- rotation=(0, 0, 0),
- layers=context.scene.layers)
-
- for v in context.active_object.data.vertices:
- v.co[0] += 1.0
- v.co *= scale
-
- bpy.ops.object.editmode_toggle()
- bpy.ops.mesh.faces_shade_smooth()
- bpy.ops.uv.reset()
-
- if crack_type == 'FLAT_ROUGH':
- bpy.ops.mesh.subdivide(
- number_cuts=ncuts,
- fractal=roughness * 7 * scale,
- smoothness=0)
-
- bpy.ops.mesh.vertices_smooth(repeat=5)
-
- bpy.ops.object.editmode_toggle()
-
- if crack_type == 'SPHERE' or crack_type == 'SPHERE_ROUGH':
- bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=4,
- size=1,
- view_align=False,
- enter_editmode=False,
- location=(0, 0, 0),
- rotation=(0, 0, 0),
- layers=context.scene.layers)
-
- bpy.ops.object.editmode_toggle()
- bpy.ops.mesh.faces_shade_smooth()
- bpy.ops.uv.smart_project(angle_limit=66, island_margin=0)
-
- bpy.ops.object.editmode_toggle()
- for v in context.active_object.data.vertices:
- v.co[0] += 1.0
- v.co *= scale
-
- if crack_type == 'SPHERE_ROUGH':
- for v in context.view_layer.objects.active.data.vertices:
- v.co[0] += roughness * scale * 0.2 * (random.random() - 0.5)
- v.co[1] += roughness * scale * 0.1 * (random.random() - 0.5)
- v.co[2] += roughness * scale * 0.1 * (random.random() - 0.5)
-
- bpy.context.active_object.select_set(True)
-# bpy.context.scene.objects.active.select = True
-
- '''
- # Adding fracture material
- # @todo Doesn't work at all yet.
- sce = bpy.context.scene
- if bpy.data.materials.get('fracture') is None:
- bpy.ops.material.new()
- bpy.ops.object.material_slot_add()
- sce.objects.active.material_slots[0].material.name = 'fracture'
- else:
- bpy.ops.object.material_slot_add()
- sce.objects.active.material_slots[0].material
- = bpy.data.materials['fracture']
- '''
-
-
-#UNWRAP
-def getsizefrommesh(ob):
- bb = ob.bound_box
- return (
- bb[5][0] - bb[0][0],
- bb[3][1] - bb[0][1],
- bb[1][2] - bb[0][2])
-
-
-def getIslands(shard):
- sm = shard.data
- vgroups = []
- fgroups = []
-
- vgi = [-1] * len(sm.vertices)
-
- gindex = 0
- for i in range(len(vgi)):
- if vgi[i] == -1:
- gproc = [i]
- vgroups.append([i])
- fgroups.append([])
-
- while len(gproc) > 0:
- # XXX - is popping the first needed? - pop() without args is fastest - campbell
- i = gproc.pop(0)
- for p in sm.polygons:
- #if i in f.vertices:
- for v in p.vertices:
- if v == i:
- for v1 in p.vertices:
- if vgi[v1] == -1:
- vgi[v1] = gindex
- vgroups[gindex].append(v1)
- gproc.append(v1)
-
- fgroups[gindex].append(p.index)
-
- gindex += 1
-
- #print( gindex)
-
- if gindex == 1:
- shards = [shard]
-
- else:
- shards = []
- for gi in range(0, gindex):
- bpy.ops.object.select_all(action='DESELECT')
- bpy.context.view_layer.objects.active = shard
- shard.select_set(True)
- bpy.ops.object.duplicate(linked=False, mode='DUMMY')
- a = bpy.context.view_layer.objects.active
- sm = a.data
- print (a.name)
-
- bpy.ops.object.editmode_toggle()
- bpy.ops.mesh.select_all(action='DESELECT')
- bpy.ops.object.editmode_toggle()
-
- for x in range(len(sm.vertices) - 1, -1, -1):
- if vgi[x] != gi:
- #print('getIslands: selecting')
- #print('getIslands: ' + str(x))
- a.data.vertices[x].select = True
-
- print(bpy.context.view_layer.objects.active.name)
-
- bpy.ops.object.editmode_toggle()
- bpy.ops.mesh.delete()
- bpy.ops.object.editmode_toggle()
-
- bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
-
- shards.append(a)
-
- bpy.context.collection.objects.unlink(shard)
-
- return shards
-
-
-def boolop(ob, cutter, op):
- sce = bpy.context.scene
-
- fault = 0
- new_shards = []
-
- sizex, sizey, sizez = getsizefrommesh(ob)
- gsize = sizex + sizey + sizez
-
- bpy.ops.object.select_all()
- ob.select_set(True)
- sce.objects.active = ob
- cutter.select_set(False)
-
- bpy.ops.object.modifier_add(type='BOOLEAN')
- a = sce.objects.active
- a.modifiers['Boolean'].object = cutter
- a.modifiers['Boolean'].operation = op
-
- nmesh = a.to_mesh(sce, apply_modifiers=True, settings='PREVIEW')
-
- if len(nmesh.vertices) > 0:
- a.modifiers.remove(a.modifiers['Boolean'])
- bpy.ops.object.duplicate(linked=False, mode='DUMMY')
-
- new_shard = sce.objects.active
- new_shard.data = nmesh
- #scene.objects.link(new_shard)
-
- new_shard.location = a.location
- bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
-
- sizex, sizey, sizez = getsizefrommesh(new_shard)
- gsize2 = sizex + sizey + sizez
-
- if gsize2 > gsize * 1.01: # Size check
- print (gsize2, gsize, ob.name, cutter.name)
- fault = 1
- #print ('boolop: sizeerror')
-
- # This checks whether returned shards are non-manifold.
- # 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(mesh_utils.edge_face_count(nmesh))
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list