Import_3ds: Improved distance cue node setup
[blender-addons.git] / object_print3d_utils / __init__.py
blob1fd82c1604b959f609416bd3a4a3dc5f786729bf
1 # SPDX-FileCopyrightText: 2013-2023 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 bl_info = {
6 "name": "3D-Print Toolbox",
7 "author": "Campbell Barton",
8 "blender": (4, 1, 0),
9 "location": "3D View > Sidebar",
10 "description": "Utilities for 3D printing",
11 "doc_url": "{BLENDER_MANUAL_URL}/addons/mesh/3d_print_toolbox.html",
12 "support": 'OFFICIAL',
13 "category": "Mesh",
17 if "bpy" in locals():
18 import importlib
19 importlib.reload(ui)
20 importlib.reload(operators)
21 if "mesh_helpers" in locals():
22 importlib.reload(mesh_helpers)
23 if "export" in locals():
24 importlib.reload(export)
25 else:
26 import math
28 import bpy
29 from bpy.types import PropertyGroup
30 from bpy.props import (
31 StringProperty,
32 BoolProperty,
33 FloatProperty,
34 EnumProperty,
35 PointerProperty,
38 from . import (
39 ui,
40 operators,
44 class SceneProperties(PropertyGroup):
45 use_alignxy_face_area: BoolProperty(
46 name="Face Areas",
47 description="Normalize normals proportional to face areas",
48 default=False,
51 export_format: EnumProperty(
52 name="Format",
53 description="Format type to export to",
54 items=(
55 ('OBJ', "OBJ", ""),
56 ('PLY', "PLY", ""),
57 ('STL', "STL", ""),
58 ('X3D', "X3D", ""),
60 default='STL',
62 use_export_texture: BoolProperty(
63 name="Copy Textures",
64 description="Copy textures on export to the output path",
65 default=False,
67 use_apply_scale: BoolProperty(
68 name="Apply Scale",
69 description="Apply scene scale setting on export",
70 default=False,
72 use_data_layers: BoolProperty(
73 name="Data Layers",
74 description=(
75 "Export normals, UVs, vertex colors and materials for formats that support it "
76 "significantly increasing file size"
79 export_path: StringProperty(
80 name="Export Directory",
81 description="Path to directory where the files are created",
82 default="//",
83 maxlen=1024,
84 subtype="DIR_PATH",
86 thickness_min: FloatProperty(
87 name="Thickness",
88 description="Minimum thickness",
89 subtype='DISTANCE',
90 default=0.001, # 1mm
91 min=0.0,
92 max=10.0,
94 threshold_zero: FloatProperty(
95 name="Threshold",
96 description="Limit for checking zero area/length",
97 default=0.0001,
98 precision=5,
99 min=0.0,
100 max=0.2,
102 angle_distort: FloatProperty(
103 name="Angle",
104 description="Limit for checking distorted faces",
105 subtype='ANGLE',
106 default=math.radians(45.0),
107 min=0.0,
108 max=math.radians(180.0),
110 angle_sharp: FloatProperty(
111 name="Angle",
112 subtype='ANGLE',
113 default=math.radians(160.0),
114 min=0.0,
115 max=math.radians(180.0),
117 angle_overhang: FloatProperty(
118 name="Angle",
119 subtype='ANGLE',
120 default=math.radians(45.0),
121 min=0.0,
122 max=math.radians(90.0),
126 classes = (
127 SceneProperties,
129 ui.VIEW3D_PT_print3d_analyze,
130 ui.VIEW3D_PT_print3d_cleanup,
131 ui.VIEW3D_PT_print3d_edit,
132 ui.VIEW3D_PT_print3d_export,
134 operators.MESH_OT_print3d_info_volume,
135 operators.MESH_OT_print3d_info_area,
136 operators.MESH_OT_print3d_check_degenerate,
137 operators.MESH_OT_print3d_check_distorted,
138 operators.MESH_OT_print3d_check_solid,
139 operators.MESH_OT_print3d_check_intersections,
140 operators.MESH_OT_print3d_check_thick,
141 operators.MESH_OT_print3d_check_sharp,
142 operators.MESH_OT_print3d_check_overhang,
143 operators.MESH_OT_print3d_check_all,
144 operators.MESH_OT_print3d_clean_distorted,
145 # operators.MESH_OT_print3d_clean_thin,
146 operators.MESH_OT_print3d_clean_non_manifold,
147 operators.MESH_OT_print3d_select_report,
148 operators.MESH_OT_print3d_scale_to_volume,
149 operators.MESH_OT_print3d_scale_to_bounds,
150 operators.MESH_OT_print3d_align_to_xy,
151 operators.MESH_OT_print3d_export,
152 operators.MESH_OT_print3d_hollow,
156 def register():
157 for cls in classes:
158 bpy.utils.register_class(cls)
160 bpy.types.Scene.print_3d = PointerProperty(type=SceneProperties)
163 def unregister():
164 for cls in classes:
165 bpy.utils.unregister_class(cls)
167 del bpy.types.Scene.print_3d