-
Notifications
You must be signed in to change notification settings - Fork 4
/
DUtils.py
73 lines (59 loc) · 2.29 KB
/
DUtils.py
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
# ##### 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
import os
from bpy_extras.io_utils import ImportHelper
#from dna_demo import load_dna
#import dnacalib_demo
class TestFunc(bpy.types.Operator):
bl_idname = "object.test_dpanels"
bl_label = "Create test text curve"
bl_description = ("Create a test text curve")
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
font_curve = bpy.data.curves.new(type="FONT", name="numberPlate")
font_curve.body = "Blender functionality test"
obj = bpy.data.objects.new(name="Font Object", object_data=font_curve)
obj.location = (0, 0, 0)
bpy.context.scene.collection.objects.link(obj)
return {'FINISHED'}
class ImportDNA(bpy.types.Operator, ImportHelper):
bl_idname = "io.import_dna"
bl_label = "Import metahuman DNA"
bl_description = "Import metahuman DNA"
bl_options = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return True
def execute(self, context):
filedir = self.properties.filepath
with open(filedir, 'rb') as freader:
print(freader)
#dnareader = load_dna(freader)
root_path = os.path.dirname(os.path.realpath(__file__))
print(root_path)
bpy.ops.wm.console_toggle()
#load_bvh(res_db, root_path, gender)
return{'FINISHED'}
classes = [TestFunc, ImportDNA]
def register():
for cls in classes:
bpy.utils.register_class(cls)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)