fix [#36995] FBX Importer does not import fbx model
[blender-addons.git] / object_print3d_utils / __init__.py
blob7ba258a269fafe65414a3bca8f7c66e7e84aa8c9
1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
19 # <pep8-80 compliant>
21 bl_info = {
22 "name": "3D Print Toolbox",
23 "author": "Campbell Barton",
24 "blender": (2, 65, 0),
25 "location": "3D View > Toolbox",
26 "description": "Utilities for 3D printing",
27 "warning": "",
28 "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
29 "Scripts/Modeling/PrintToolbox",
30 "tracker_url": "",
31 "support": 'OFFICIAL',
32 "category": "Mesh"}
35 if "bpy" in locals():
36 import imp
37 imp.reload(ui)
38 imp.reload(operators)
39 else:
40 import bpy
41 from bpy.props import (StringProperty,
42 BoolProperty,
43 IntProperty,
44 FloatProperty,
45 FloatVectorProperty,
46 EnumProperty,
47 PointerProperty,
49 from bpy.types import (Operator,
50 AddonPreferences,
51 PropertyGroup,
53 from . import ui
54 from . import operators
56 import math
58 class Print3DSettings(PropertyGroup):
59 export_format = EnumProperty(
60 name="Format",
61 description="Format type to export to",
62 items=(('STL', "STL", ""),
63 ('PLY', "PLY", ""),
64 ('WRL', "VRML2", ""),
65 ('X3D', "X3D", ""),
66 ('OBJ', "OBJ", "")),
67 default='STL',
69 use_export_texture = BoolProperty(
70 name="Copy Textures",
71 description="Copy textures on export to the output path",
72 default=False,
74 use_apply_scale = BoolProperty(
75 name="Apply Scale",
76 description="Apply scene scale setting on export",
77 default=False,
79 export_path = StringProperty(
80 name="Export Directory",
81 description="Path to directory where the files are created",
82 default="//", maxlen=1024, subtype="DIR_PATH",
84 thickness_min = FloatProperty(
85 name="Thickness",
86 description="Minimum thickness",
87 subtype='DISTANCE',
88 default=0.001, # 1mm
89 min=0.0, max=10.0,
91 threshold_zero = FloatProperty(
92 name="Threshold",
93 description="Limit for checking zero area/length",
94 default=0.0001,
95 precision=5,
96 min=0.0, max=0.2,
98 angle_distort = FloatProperty(
99 name="Angle",
100 description="Limit for checking distorted faces",
101 subtype='ANGLE',
102 default=math.radians(45.0),
103 min=0.0, max=math.radians(180.0),
105 angle_sharp = FloatProperty(
106 name="Angle",
107 subtype='ANGLE',
108 default=math.radians(160.0),
109 min=0.0, max=math.radians(180.0),
111 angle_overhang = FloatProperty(
112 name="Angle",
113 subtype='ANGLE',
114 default=math.radians(45.0),
115 min=0.0, max=math.radians(90.0),
118 classes = (
119 ui.Print3DToolBarObject,
120 ui.Print3DToolBarMesh,
122 operators.Print3DInfoVolume,
123 operators.Print3DInfoArea,
125 operators.Print3DCheckDegenerate,
126 operators.Print3DCheckDistorted,
127 operators.Print3DCheckSolid,
128 operators.Print3DCheckIntersections,
129 operators.Print3DCheckThick,
130 operators.Print3DCheckSharp,
131 operators.Print3DCheckOverhang,
132 operators.Print3DCheckAll,
134 operators.Print3DCleanIsolated,
135 operators.Print3DCleanDistorted,
136 operators.Print3DCleanThin,
138 operators.Print3DSelectReport,
140 operators.Print3DScaleToVolume,
141 operators.Print3DScaleToBounds,
143 operators.Print3DExport,
145 Print3DSettings,
149 def register():
150 for cls in classes:
151 bpy.utils.register_class(cls)
153 bpy.types.Scene.print_3d = PointerProperty(type=Print3DSettings)
156 def unregister():
157 for cls in classes:
158 bpy.utils.unregister_class(cls)
160 del bpy.types.Scene.print_3d