[Bf-extensions-cvs] [80e2be8f] master: object_fracture_crack: minimal update 2.8: T61901
meta-androcto
noreply at git.blender.org
Thu Aug 22 02:12:53 CEST 2019
Commit: 80e2be8ff8e23dad3487d4ceef82ce7067cee412
Author: meta-androcto
Date: Thu Aug 22 10:12:17 2019 +1000
Branches: master
https://developer.blender.org/rBAC80e2be8ff8e23dad3487d4ceef82ce7067cee412
object_fracture_crack: minimal update 2.8: T61901
===================================================================
M object_fracture_crack/__init__.py
M object_fracture_crack/crack_it.py
M object_fracture_crack/materials/materials1.blend
M object_fracture_crack/operator.py
===================================================================
diff --git a/object_fracture_crack/__init__.py b/object_fracture_crack/__init__.py
index 3e3ec838..eb29e1a1 100644
--- a/object_fracture_crack/__init__.py
+++ b/object_fracture_crack/__init__.py
@@ -19,8 +19,8 @@
bl_info = {
"name": "Cell Fracture Crack It",
"author": "Nobuyuki Hirakata",
- "version": (0, 1, 2),
- "blender": (2, 78, 5),
+ "version": (0, 1, 3),
+ "blender": (2, 80, 0),
"location": "View3D > Toolshelf > Create Tab",
"description": "Displaced Cell Fracture Addon",
"warning": "Make sure to enable 'Object: Cell Fracture' Addon",
@@ -45,6 +45,11 @@ from bpy.props import (
IntProperty,
PointerProperty,
)
+from .operator import (
+ CRACKIT_OT_fracture,
+ CRACKIT_OT_material,
+ CRACKIT_PT_main,
+ )
import os
@@ -117,11 +122,14 @@ class CrackItProperties(PropertyGroup):
description="Material Preset",
items=[
('crackit_organic_mud', "Organic Mud", "Mud material"),
- ('crackit_mud1', "Mud", "Mud material"),
- ('crackit_tree1_moss1', "Tree Moss", "Tree Material"),
- ('crackit_tree2_dry1', "Tree Dry", "Tree Material"),
- ('crackit_tree3_red1', "Tree Red", "Tree Material"),
- ('crackit_rock1', "Rock", "Rock Material")
+ ('crackit_mud', "Mud", "Mud material"),
+ ('crackit_tree_moss', "Tree Moss", "Tree Material"),
+ ('crackit_tree_dry', "Tree Dry", "Tree Material"),
+ ('crackit_tree_red', "Tree Red", "Tree Material"),
+ ('crackit_rock', "Rock", "Rock Material"),
+ ('crackit_lava', "Lava", "Lava Material"),
+ ('crackit_wet-paint', "Wet Paint", "Paint Material"),
+ ('crackit_soap', "Soap", "Soap Material"),
]
)
material_lib_name: BoolProperty(
@@ -131,18 +139,25 @@ class CrackItProperties(PropertyGroup):
default=True
)
+classes = (
+ CRACKIT_OT_fracture,
+ CRACKIT_OT_material,
+ CRACKIT_PT_main,
+ CrackItProperties,
+ )
def register():
- bpy.utils.register_module(__name__)
- bpy.types.Scene.crackit = PointerProperty(
- type=CrackItProperties
- )
+ from bpy.utils import register_class
+ for cls in classes:
+ register_class(cls)
+ bpy.types.Scene.crackit = PointerProperty(type=CrackItProperties)
+
def unregister():
- del bpy.types.Scene.crackit
- bpy.utils.unregister_module(__name__)
-
-if __name__ == "__main__":
- register()
+ del bpy.types.Scene.crackit
+
+ from bpy.utils import unregister_class
+ for cls in reversed(classes):
+ unregister_class(cls)
\ No newline at end of file
diff --git a/object_fracture_crack/crack_it.py b/object_fracture_crack/crack_it.py
index 68857908..63ce724c 100644
--- a/object_fracture_crack/crack_it.py
+++ b/object_fracture_crack/crack_it.py
@@ -49,7 +49,6 @@ def makeFracture(child_verts=False, division=100, noise=0.00,
# Get active object name and active layer
active_name = bpy.context.view_layer.objects.active.name
- active_layer = bpy.context.scene.active_layer
# source method of whether use child verts
if child_verts is True:
@@ -65,15 +64,15 @@ def makeFracture(child_verts=False, division=100, noise=0.00,
use_sharp_edges=False, use_sharp_edges_apply=True, use_data_match=True,
use_island_split=True, margin=margin, material_index=0,
use_interior_vgroup=False, mass_mode='VOLUME', mass=1, use_recenter=True,
- use_remove_original=True, use_layer_index=0, use_layer_next=False,
- group_name="", use_debug_points=False, use_debug_redraw=True, use_debug_bool=False
+ use_remove_original=True,
+ collection_name="", use_debug_points=False, use_debug_redraw=True, use_debug_bool=False
)
- _makeJoin(active_name, active_layer)
+ _makeJoin(active_name)
# Join fractures into an object
-def _makeJoin(active_name, active_layer):
+def _makeJoin(active_name):
# Get object by name
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_pattern(pattern=active_name + '_cell*')
diff --git a/object_fracture_crack/materials/materials1.blend b/object_fracture_crack/materials/materials1.blend
index 969f2068..df865ee8 100644
Binary files a/object_fracture_crack/materials/materials1.blend and b/object_fracture_crack/materials/materials1.blend differ
diff --git a/object_fracture_crack/operator.py b/object_fracture_crack/operator.py
index e0dbc5fd..e3b14f56 100644
--- a/object_fracture_crack/operator.py
+++ b/object_fracture_crack/operator.py
@@ -15,7 +15,7 @@ def check_object_cell_fracture():
# Access by bpy.ops.mesh.crackit_fracture
-class FractureOperation(Operator):
+class CRACKIT_OT_fracture(Operator):
bl_idname = "mesh.crackit_fracture"
bl_label = "Crack it!"
bl_description = ("Make cracks using the cell fracture add-on\n"
@@ -63,7 +63,7 @@ class FractureOperation(Operator):
# Apply material preset
# Access by bpy.ops.mesh.crackit_material
-class MaterialOperation(Operator):
+class CRACKIT_OT_material(Operator):
bl_idname = "mesh.crackit_material"
bl_label = "Apply Material"
bl_description = ("Apply a preset material\n"
@@ -101,11 +101,11 @@ class MaterialOperation(Operator):
# Menu settings
-class crackitPanel(Panel):
+class CRACKIT_PT_main(Panel):
bl_label = "Crack it!"
- bl_idname = 'crack_it'
+ bl_idname = 'CRACKIT_PT_main'
bl_space_type = "VIEW_3D"
- bl_region_type = "TOOLS"
+ bl_region_type = "UI"
bl_category = "Create"
bl_context = 'objectmode'
bl_options = {"DEFAULT_CLOSED"}
@@ -130,7 +130,7 @@ class crackitPanel(Panel):
layout.separator()
return
else:
- row.operator(FractureOperation.bl_idname, icon="SPLITSCREEN")
+ row.operator(CRACKIT_OT_fracture.bl_idname)# ,icon="SPLITSCREEN")
row = box.row()
row.prop(crackit, "fracture_childverts")
@@ -161,4 +161,4 @@ class crackitPanel(Panel):
row.prop(crackit, "material_preset")
row = box.row()
- row.operator(MaterialOperation.bl_idname)
+ row.operator(CRACKIT_OT_material.bl_idname)
More information about the Bf-extensions-cvs
mailing list