Welcome to mirror list, hosted at ThFree Co, Russian Federation.

__init__.py « io_coat3D - git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a9509c3be481b75f11fea85dc662c5f3547a3021 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# ##### 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": "3D-Coat Applink",
    "author": "Kalle-Samuli Riihikoski (haikalle)",
    "version": (1, 7, 0),
    "blender": (2, 5, 7),
    "api": 35622,
    "location": "Scene > 3D-Coat Applink",
    "description": "Transfer data between 3D-Coat/Blender",
    "warning": "",
    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/" \
        "Scripts/Import-Export/3dcoat_applink",
    "tracker_url": "https://projects.blender.org/tracker/?"\
        "func=detail&aid=24446",
    "category": "Import-Export"}



if "bpy" in locals():
    import imp
    imp.reload(coat)
    imp.reload(tex)
else:
    from . import coat
    from . import tex

import bpy
from bpy.props import *

    
def register():
    bpy.coat3D = dict()
    bpy.coat3D['active_coat'] = ''
    bpy.coat3D['status'] = 0
    bpy.coat3D['kuva'] = 1
    
    class ObjectCoat3D(bpy.types.PropertyGroup):
        objpath = StringProperty(name="Object_Path")
        coatpath = StringProperty(name="Coat_Path")
        objectdir = StringProperty(name="ObjectPath", subtype="FILE_PATH")
        texturefolder = StringProperty(name="Texture folder:", subtype="DIR_PATH")
        path3b = StringProperty(name="3B Path", subtype="FILE_PATH")


    class SceneCoat3D(bpy.types.PropertyGroup):
        exchangedir = StringProperty(
            name="FilePath",
            subtype="DIR_PATH",
        )
        wasactive = StringProperty(
            name="Pass active object",
        )
        import_box = BoolProperty(
            name="Import window",
            description="Allows to skip import dialog.",
            default= True
        )
        export_box = BoolProperty(
            name="Export window",
            description="Allows to skip export dialog.",
            default= True
        )
        export_color = BoolProperty(
            name="Export color",
            description="Export color texture.",
            default= True
        )
        export_spec = BoolProperty(
            name="Export specular",
            description="Export specular texture.",
            default= True
        )
        export_normal = BoolProperty(
            name="Export Normal",
            description="Export normal texture.",
            default= True
        )
        export_disp = BoolProperty(
            name="Export Displacement",
            description="Export displacement texture.",
            default= True
        )
        export_position = BoolProperty(
            name="Export Source Position",
            description="Export source position.",
            default= True
        )
        export_zero_layer = BoolProperty(
            name="Export from Layer 0",
            description="Export mesh from Layer 0",
            default= True
        )
        export_coarse = BoolProperty(
            name="Export Coarse",
            description="Export Coarse.",
            default= True
        )
        export_on = BoolProperty(
            name="Export_On",
            description="Add Modifiers and export.",
            default= False
        )
        smooth_on = BoolProperty(
            name="Auto Smooth",
            description="Add Modifiers and export.",
            default= True
        )
        exportfile = BoolProperty(
            name="No Import File",
            description="Add Modifiers and export.",
            default= False
        )
        importmod = BoolProperty(
            name="Remove Modifiers",
            description="Import and add modifiers.",
            default= True
        )
        exportmod = BoolProperty(
            name="Modifiers",
            description="Export modifiers.",
            default= False
        )
        export_pos = BoolProperty(
            name="Remember Position",
            description="Remember position.",
            default= True
        )
        importtextures = BoolProperty(
            name="Bring Textures",
            description="Import Textures.",
            default= True
        )
        exportover = BoolProperty(
            name="Export Obj",
            description="Import Textures.",
            default= False
        )
        importmesh = BoolProperty(
            name="Mesh",
            description="Import Mesh.",
            default= True
        )

        # copy location
        cursor = FloatVectorProperty(
            name="Cursor",
            description="Location.",
            subtype="XYZ",
            default=(0.0, 0.0, 0.0)
        )
        loca = FloatVectorProperty(
            name="location",
            description="Location.",
            subtype="XYZ",
            default=(0.0, 0.0, 0.0)
        )
        rota = FloatVectorProperty(
            name="location",
            description="Location.",
            subtype="EULER",
            default=(0.0, 0.0, 0.0)
        )
        scal = FloatVectorProperty(
            name="location",
            description="Location.",
            subtype="XYZ",
            default=(0.0, 0.0, 0.0)
        )
        dime = FloatVectorProperty(
            name="dimension",
            description="Dimension.",
            subtype="XYZ",
            default=(0.0, 0.0, 0.0)
        )

        type = EnumProperty( name= "Export Type",
            description= "Diffrent Export Types.",
            items=(("ppp",   "Per-Pixel Painting", ""),
                   ("mv",   "Microvertex Painting", ""),
                   ("ptex",   "Ptex Painting", ""),
                   ("uv",   "UV-Mapping", ""),
                   ("ref",  "Reference Mesh", ""),
                   ("retopo",  "Retopo mesh as new layer", ""),
                   ("vox",  "Mesh As Voxel Object", ""),
                   ("alpha",  "Mesh As New Pen Alpha", ""),
                   ("prim",  "Mesh As Voxel Primitive", ""),
                   ("curv", "Mesh As a Curve Profile", ""),
                   ("autopo",  "Mesh For Auto-retopology", ""),
                   ),
            default= "ppp"
        )

    bpy.utils.register_module(__name__)

    bpy.types.Object.coat3D= PointerProperty(
        name= "Applink Variables",
        type=  ObjectCoat3D,
        description= "Applink variables"
    )

    bpy.types.Scene.coat3D= PointerProperty(
        name= "Applink Variables",
        type=  SceneCoat3D,
        description= "Applink variables"
    )


def unregister():
    import bpy

    del bpy.types.Object.coat3D
    del bpy.types.Scene.coat3D
    del bpy.coat3D
    
    bpy.utils.unregister_module(__name__)


if __name__ == "__main__":
    register()