Merge pull request #15 from Shatur95/add-additional-import-hints

Add additional import hints
This commit is contained in:
K. S. Ernest (iFire) Lee
2020-11-21 10:42:27 -08:00
committed by GitHub
7 changed files with 521 additions and 9 deletions

View File

@@ -4,24 +4,26 @@ import posixpath
import shutil
import os
directory = "blend"
directories = ["blend", "proposal/blend"]
export_types = ["gltf", "obj", "fbx"]
for export_type in export_types:
shutil.rmtree(export_type, ignore_errors=True)
posixpath.os.mkdir(export_type, mode=0o777)
for filename in os.listdir(directory):
if filename.endswith(".blend"):
for directory in directories:
for filename in os.listdir(directory):
if not filename.endswith(".blend"):
continue
for export_type in export_types:
print(filename)
bpy.ops.wm.open_mainfile(filepath="blend/" + filename)
strip_file_name = filename.rsplit(".blend", 1)[0]
bpy.ops.wm.open_mainfile(filepath=os.path.join(directory, filename))
basename = filename.rsplit(".blend", 1)[0]
export_path = os.path.normpath(os.path.join(directory, os.pardir, export_type, basename + "." + export_type))
if export_type == "gltf":
bpy.ops.export_scene.gltf(
filepath=export_type + "/" + strip_file_name + ".gltf",
filepath=export_path,
export_format="GLTF_SEPARATE",
export_copyright="The MIT License (MIT) Copyright (c) 2020 Godot Engine",
)
elif export_type == "fbx":
bpy.ops.export_scene.fbx(filepath=export_type + "/" + strip_file_name + "." + export_type)
bpy.ops.export_scene.fbx(filepath=export_path)
elif export_type == "obj":
bpy.ops.export_scene.obj(filepath=export_type + "/" + strip_file_name + "." + export_type)
bpy.ops.export_scene.obj(filepath=export_path)

View File

@@ -0,0 +1,349 @@
{
"asset" : {
"copyright" : "The MIT License (MIT) Copyright (c) 2020 Godot Engine",
"generator" : "Khronos glTF Blender I/O v1.3.48",
"version" : "2.0"
},
"scene" : 0,
"scenes" : [
{
"name" : "Scene",
"nodes" : [
0,
1,
2,
3,
4,
5,
6,
7,
8
]
}
],
"nodes" : [
{
"mesh" : 0,
"name" : "cube-shape",
"translation" : [
0,
0,
-4
]
},
{
"mesh" : 1,
"name" : "cube-shapeonly",
"translation" : [
0,
0,
-8
]
},
{
"mesh" : 2,
"name" : "cube-convshapeonly",
"translation" : [
0,
0,
-12
]
},
{
"name" : "cube_empty-shapeonly",
"translation" : [
0,
0,
-16.017648696899414
]
},
{
"mesh" : 3,
"name" : "cube-convshape",
"translation" : [
0,
0,
-12
]
},
{
"name" : "arrow_empty-shapeonly",
"translation" : [
0,
0,
-19.096826553344727
]
},
{
"name" : "image_empty-shapeonly",
"translation" : [
0,
0,
-21.12411880493164
]
},
{
"name" : "sphere_empty-shapeonly",
"translation" : [
0,
0,
-23.037099838256836
]
},
{
"name" : "other_empty-shapeonly",
"translation" : [
0,
0,
-25.03607940673828
]
}
],
"meshes" : [
{
"name" : "Cube.001",
"primitives" : [
{
"attributes" : {
"POSITION" : 0,
"NORMAL" : 1,
"TEXCOORD_0" : 2
},
"indices" : 3
}
]
},
{
"name" : "Cube.002",
"primitives" : [
{
"attributes" : {
"POSITION" : 4,
"NORMAL" : 5,
"TEXCOORD_0" : 6
},
"indices" : 3
}
]
},
{
"name" : "Cube.003",
"primitives" : [
{
"attributes" : {
"POSITION" : 7,
"NORMAL" : 8,
"TEXCOORD_0" : 9
},
"indices" : 3
}
]
},
{
"name" : "Cube.007",
"primitives" : [
{
"attributes" : {
"POSITION" : 10,
"NORMAL" : 11,
"TEXCOORD_0" : 12
},
"indices" : 3
}
]
}
],
"accessors" : [
{
"bufferView" : 0,
"componentType" : 5126,
"count" : 24,
"max" : [
1,
1,
1
],
"min" : [
-1,
-1,
-1
],
"type" : "VEC3"
},
{
"bufferView" : 1,
"componentType" : 5126,
"count" : 24,
"type" : "VEC3"
},
{
"bufferView" : 2,
"componentType" : 5126,
"count" : 24,
"type" : "VEC2"
},
{
"bufferView" : 3,
"componentType" : 5123,
"count" : 36,
"type" : "SCALAR"
},
{
"bufferView" : 4,
"componentType" : 5126,
"count" : 24,
"max" : [
1,
1,
1
],
"min" : [
-1,
-1,
-1
],
"type" : "VEC3"
},
{
"bufferView" : 5,
"componentType" : 5126,
"count" : 24,
"type" : "VEC3"
},
{
"bufferView" : 6,
"componentType" : 5126,
"count" : 24,
"type" : "VEC2"
},
{
"bufferView" : 7,
"componentType" : 5126,
"count" : 24,
"max" : [
1,
1,
1
],
"min" : [
-1,
-1,
-1
],
"type" : "VEC3"
},
{
"bufferView" : 8,
"componentType" : 5126,
"count" : 24,
"type" : "VEC3"
},
{
"bufferView" : 9,
"componentType" : 5126,
"count" : 24,
"type" : "VEC2"
},
{
"bufferView" : 10,
"componentType" : 5126,
"count" : 24,
"max" : [
1,
1,
1
],
"min" : [
-1,
-1,
-1
],
"type" : "VEC3"
},
{
"bufferView" : 11,
"componentType" : 5126,
"count" : 24,
"type" : "VEC3"
},
{
"bufferView" : 12,
"componentType" : 5126,
"count" : 24,
"type" : "VEC2"
}
],
"bufferViews" : [
{
"buffer" : 0,
"byteLength" : 288,
"byteOffset" : 0
},
{
"buffer" : 0,
"byteLength" : 288,
"byteOffset" : 288
},
{
"buffer" : 0,
"byteLength" : 192,
"byteOffset" : 576
},
{
"buffer" : 0,
"byteLength" : 72,
"byteOffset" : 768
},
{
"buffer" : 0,
"byteLength" : 288,
"byteOffset" : 840
},
{
"buffer" : 0,
"byteLength" : 288,
"byteOffset" : 1128
},
{
"buffer" : 0,
"byteLength" : 192,
"byteOffset" : 1416
},
{
"buffer" : 0,
"byteLength" : 288,
"byteOffset" : 1608
},
{
"buffer" : 0,
"byteLength" : 288,
"byteOffset" : 1896
},
{
"buffer" : 0,
"byteLength" : 192,
"byteOffset" : 2184
},
{
"buffer" : 0,
"byteLength" : 288,
"byteOffset" : 2376
},
{
"buffer" : 0,
"byteLength" : 288,
"byteOffset" : 2664
},
{
"buffer" : 0,
"byteLength" : 192,
"byteOffset" : 2952
}
],
"buffers" : [
{
"byteLength" : 3144,
"uri" : "39105-additional-import-hints.bin"
}
]
}

View File

@@ -0,0 +1,10 @@
# Blender MTL File: '39105-additional-import-hints.blend'
# Material Count: 1
newmtl None
Ns 500
Ka 0.8 0.8 0.8
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2

View File

@@ -0,0 +1,151 @@
# Blender v2.90.1 OBJ File: '39105-additional-import-hints.blend'
# www.blender.org
mtllib 39105-additional-import-hints.mtl
o cube-shape_Cube.001
v -1.000000 -1.000000 -3.000000
v -1.000000 1.000000 -3.000000
v -1.000000 -1.000000 -5.000000
v -1.000000 1.000000 -5.000000
v 1.000000 -1.000000 -3.000000
v 1.000000 1.000000 -3.000000
v 1.000000 -1.000000 -5.000000
v 1.000000 1.000000 -5.000000
vt 0.375000 0.000000
vt 0.625000 0.000000
vt 0.625000 0.250000
vt 0.375000 0.250000
vt 0.625000 0.500000
vt 0.375000 0.500000
vt 0.625000 0.750000
vt 0.375000 0.750000
vt 0.625000 1.000000
vt 0.375000 1.000000
vt 0.125000 0.500000
vt 0.125000 0.750000
vt 0.875000 0.500000
vt 0.875000 0.750000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
usemtl None
s off
f 1/1/1 2/2/1 4/3/1 3/4/1
f 3/4/2 4/3/2 8/5/2 7/6/2
f 7/6/3 8/5/3 6/7/3 5/8/3
f 5/8/4 6/7/4 2/9/4 1/10/4
f 3/11/5 7/6/5 5/8/5 1/12/5
f 8/5/6 4/13/6 2/14/6 6/7/6
o cube-shapeonly_Cube.002
v -1.000000 -1.000000 -7.000000
v -1.000000 1.000000 -7.000000
v -1.000000 -1.000000 -9.000000
v -1.000000 1.000000 -9.000000
v 1.000000 -1.000000 -7.000000
v 1.000000 1.000000 -7.000000
v 1.000000 -1.000000 -9.000000
v 1.000000 1.000000 -9.000000
vt 0.375000 0.000000
vt 0.625000 0.000000
vt 0.625000 0.250000
vt 0.375000 0.250000
vt 0.625000 0.500000
vt 0.375000 0.500000
vt 0.625000 0.750000
vt 0.375000 0.750000
vt 0.625000 1.000000
vt 0.375000 1.000000
vt 0.125000 0.500000
vt 0.125000 0.750000
vt 0.875000 0.500000
vt 0.875000 0.750000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
usemtl None
s off
f 9/15/7 10/16/7 12/17/7 11/18/7
f 11/18/8 12/17/8 16/19/8 15/20/8
f 15/20/9 16/19/9 14/21/9 13/22/9
f 13/22/10 14/21/10 10/23/10 9/24/10
f 11/25/11 15/20/11 13/22/11 9/26/11
f 16/19/12 12/27/12 10/28/12 14/21/12
o cube-convshapeonly_Cube.003
v -1.000000 -1.000000 -11.000000
v -1.000000 1.000000 -11.000000
v -1.000000 -1.000000 -13.000000
v -1.000000 1.000000 -13.000000
v 1.000000 -1.000000 -11.000000
v 1.000000 1.000000 -11.000000
v 1.000000 -1.000000 -13.000000
v 1.000000 1.000000 -13.000000
vt 0.375000 0.000000
vt 0.625000 0.000000
vt 0.625000 0.250000
vt 0.375000 0.250000
vt 0.625000 0.500000
vt 0.375000 0.500000
vt 0.625000 0.750000
vt 0.375000 0.750000
vt 0.625000 1.000000
vt 0.375000 1.000000
vt 0.125000 0.500000
vt 0.125000 0.750000
vt 0.875000 0.500000
vt 0.875000 0.750000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
usemtl None
s off
f 17/29/13 18/30/13 20/31/13 19/32/13
f 19/32/14 20/31/14 24/33/14 23/34/14
f 23/34/15 24/33/15 22/35/15 21/36/15
f 21/36/16 22/35/16 18/37/16 17/38/16
f 19/39/17 23/34/17 21/36/17 17/40/17
f 24/33/18 20/41/18 18/42/18 22/35/18
o cube-convshape_Cube.007
v -1.000000 -1.000000 -11.000000
v -1.000000 1.000000 -11.000000
v -1.000000 -1.000000 -13.000000
v -1.000000 1.000000 -13.000000
v 1.000000 -1.000000 -11.000000
v 1.000000 1.000000 -11.000000
v 1.000000 -1.000000 -13.000000
v 1.000000 1.000000 -13.000000
vt 0.375000 0.000000
vt 0.625000 0.000000
vt 0.625000 0.250000
vt 0.375000 0.250000
vt 0.625000 0.500000
vt 0.375000 0.500000
vt 0.625000 0.750000
vt 0.375000 0.750000
vt 0.625000 1.000000
vt 0.375000 1.000000
vt 0.125000 0.500000
vt 0.125000 0.750000
vt 0.875000 0.500000
vt 0.875000 0.750000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
usemtl None
s off
f 25/43/19 26/44/19 28/45/19 27/46/19
f 27/46/20 28/45/20 32/47/20 31/48/20
f 31/48/21 32/47/21 30/49/21 29/50/21
f 29/50/22 30/49/22 26/51/22 25/52/22
f 27/53/23 31/48/23 29/50/23 25/54/23
f 32/47/24 28/55/24 26/56/24 30/49/24