Add Collada format export

This commit is contained in:
Shatur95
2020-11-22 00:27:18 +02:00
parent 259b34b4c2
commit 0c6604777b
10 changed files with 1233 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ import shutil
import os
directories = ["blend", "proposal/blend"]
export_types = ["gltf", "obj", "fbx"]
export_types = ["gltf", "obj", "fbx", "dae"]
for export_type in export_types:
shutil.rmtree(export_type, ignore_errors=True)
posixpath.os.mkdir(export_type, mode=0o777)
@@ -27,3 +27,5 @@ for directory in directories:
bpy.ops.export_scene.fbx(filepath=export_path)
elif export_type == "obj":
bpy.ops.export_scene.obj(filepath=export_path)
elif export_type == "dae":
bpy.ops.wm.collada_export(filepath=export_path)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<asset>
<contributor>
<author>Blender User</author>
<authoring_tool>Blender 2.90.1 commit date:2020-09-23, commit time:06:43, hash:3e85bb34d0d7</authoring_tool>
</contributor>
<created>2020-11-22T00:25:29</created>
<modified>2020-11-22T00:25:29</modified>
<unit name="meter" meter="1"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images/>
<library_visual_scenes>
<visual_scene id="Main_scene" name="Main scene">
<node id="asset-box_002" name="asset-box.002" type="NODE">
<matrix sid="transform">1 0 0 0 0 1 0 0 0 0 1 2.453993 0 0 0 1</matrix>
</node>
<node id="asset-box_001" name="asset-box.001" type="NODE">
<matrix sid="transform">1 0 0 -1.322591 0 1 0 -1.568165 0 0 1 0.258232 0 0 0 1</matrix>
</node>
<node id="asset-box" name="asset-box" type="NODE">
<matrix sid="transform">1 0 0 -1.441835 0 1 0 1.585912 0 0 1 0.258232 0 0 0 1</matrix>
</node>
<node id="Collection_001" name="Collection.001" type="NODE">
<matrix sid="transform">1 0 0 1.379025 0 1 0 -1.586058 0 0 1 0.3035814 0 0 0 1</matrix>
</node>
<node id="Collection" name="Collection" type="NODE">
<matrix sid="transform">1 0 0 1.250447 0 1 0 1.536333 0 0 1 0.3027808 0 0 0 1</matrix>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#Main_scene"/>
</scene>
</COLLADA>

View File

@@ -0,0 +1,264 @@
{
"asset" : {
"copyright" : "The MIT License (MIT) Copyright (c) 2020 Godot Engine",
"generator" : "Khronos glTF Blender I/O v1.3.48",
"version" : "2.0"
},
"scene" : 1,
"scenes" : [
{
"name" : "asset-box",
"nodes" : [
0,
1
]
},
{
"name" : "Main scene",
"nodes" : [
2,
3,
4,
5,
6
]
}
],
"nodes" : [
{
"mesh" : 0,
"name" : "Cube"
},
{
"mesh" : 1,
"name" : "Cube-colonly",
"scale" : [
1.0765352249145508,
1.0765352249145508,
1.0765352249145508
],
"translation" : [
0.003261283040046692,
-0.022743411362171173,
0.02108880504965782
]
},
{
"name" : "Collection",
"translation" : [
1.2504467964172363,
0.3027808368206024,
-1.5363330841064453
]
},
{
"name" : "Collection.001",
"translation" : [
1.379024863243103,
0.3035813570022583,
1.586058259010315
]
},
{
"name" : "asset-box",
"translation" : [
-1.4418349266052246,
0.2582319974899292,
-1.585911512374878
]
},
{
"name" : "asset-box.001",
"translation" : [
-1.322590947151184,
0.2582319974899292,
1.5681648254394531
]
},
{
"name" : "asset-box.002",
"translation" : [
0,
2.4539928436279297,
0
]
}
],
"materials" : [
{
"doubleSided" : true,
"emissiveFactor" : [
0,
0,
0
],
"name" : "Material",
"pbrMetallicRoughness" : {
"baseColorFactor" : [
0.800000011920929,
0.800000011920929,
0.800000011920929,
1
],
"metallicFactor" : 0,
"roughnessFactor" : 0.4000000059604645
}
},
{
"doubleSided" : true,
"emissiveFactor" : [
0,
0,
0
],
"name" : "Material.001",
"pbrMetallicRoughness" : {
"baseColorFactor" : [
0.800000011920929,
0.800000011920929,
0.800000011920929,
1
],
"metallicFactor" : 0,
"roughnessFactor" : 0.4000000059604645
}
}
],
"meshes" : [
{
"name" : "Cube",
"primitives" : [
{
"attributes" : {
"POSITION" : 0,
"NORMAL" : 1,
"TEXCOORD_0" : 2
},
"indices" : 3,
"material" : 0
}
]
},
{
"name" : "Cube.001",
"primitives" : [
{
"attributes" : {
"POSITION" : 4,
"NORMAL" : 5,
"TEXCOORD_0" : 6
},
"indices" : 3,
"material" : 1
}
]
}
],
"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"
}
],
"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
}
],
"buffers" : [
{
"byteLength" : 1608,
"uri" : "43563-asset-collection-test.bin"
}
]
}

View File

@@ -0,0 +1,22 @@
# Blender MTL File: '43563-asset-collection-test.blend'
# Material Count: 2
newmtl Material
Ns 323.999994
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
newmtl Material.001
Ns 323.999994
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2

View File

@@ -1,4 +1,4 @@
# Blender v2.83.1 OBJ File: '43563-asset-collection-test.blend'
# Blender v2.90.1 OBJ File: '43563-asset-collection-test.blend'
# www.blender.org
mtllib 43563-asset-collection-test.mtl
o Cube

View File

@@ -0,0 +1,222 @@
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<asset>
<contributor>
<author>Blender User</author>
<authoring_tool>Blender 2.90.1 commit date:2020-09-23, commit time:06:43, hash:3e85bb34d0d7</authoring_tool>
</contributor>
<created>2020-11-22T00:25:29</created>
<modified>2020-11-22T00:25:29</modified>
<unit name="meter" meter="1"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images/>
<library_geometries>
<geometry id="Cube_007-mesh" name="Cube.007">
<mesh>
<source id="Cube_007-mesh-positions">
<float_array id="Cube_007-mesh-positions-array" count="24">-1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 1 -1 1 1 1 -1 1 1 1</float_array>
<technique_common>
<accessor source="#Cube_007-mesh-positions-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Cube_007-mesh-normals">
<float_array id="Cube_007-mesh-normals-array" count="18">-1 0 0 0 1 0 1 0 0 0 -1 0 0 0 -1 0 0 1</float_array>
<technique_common>
<accessor source="#Cube_007-mesh-normals-array" count="6" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Cube_007-mesh-map-0">
<float_array id="Cube_007-mesh-map-0-array" count="72">0.625 0 0.375 0.25 0.375 0 0.625 0.25 0.375 0.5 0.375 0.25 0.625 0.5 0.375 0.75 0.375 0.5 0.625 0.75 0.375 1 0.375 0.75 0.375 0.5 0.125 0.75 0.125 0.5 0.875 0.5 0.625 0.75 0.625 0.5 0.625 0 0.625 0.25 0.375 0.25 0.625 0.25 0.625 0.5 0.375 0.5 0.625 0.5 0.625 0.75 0.375 0.75 0.625 0.75 0.625 1 0.375 1 0.375 0.5 0.375 0.75 0.125 0.75 0.875 0.5 0.875 0.75 0.625 0.75</float_array>
<technique_common>
<accessor source="#Cube_007-mesh-map-0-array" count="36" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Cube_007-mesh-vertices">
<input semantic="POSITION" source="#Cube_007-mesh-positions"/>
</vertices>
<triangles count="12">
<input semantic="VERTEX" source="#Cube_007-mesh-vertices" offset="0"/>
<input semantic="NORMAL" source="#Cube_007-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#Cube_007-mesh-map-0" offset="2" set="0"/>
<p>1 0 0 2 0 1 0 0 2 3 1 3 6 1 4 2 1 5 7 2 6 4 2 7 6 2 8 5 3 9 0 3 10 4 3 11 6 4 12 0 4 13 2 4 14 3 5 15 5 5 16 7 5 17 1 0 18 3 0 19 2 0 20 3 1 21 7 1 22 6 1 23 7 2 24 5 2 25 4 2 26 5 3 27 1 3 28 0 3 29 6 4 30 4 4 31 0 4 32 3 5 33 1 5 34 5 5 35</p>
</triangles>
</mesh>
</geometry>
<geometry id="Cube_003-mesh" name="Cube.003">
<mesh>
<source id="Cube_003-mesh-positions">
<float_array id="Cube_003-mesh-positions-array" count="24">-1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 1 -1 1 1 1 -1 1 1 1</float_array>
<technique_common>
<accessor source="#Cube_003-mesh-positions-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Cube_003-mesh-normals">
<float_array id="Cube_003-mesh-normals-array" count="18">-1 0 0 0 1 0 1 0 0 0 -1 0 0 0 -1 0 0 1</float_array>
<technique_common>
<accessor source="#Cube_003-mesh-normals-array" count="6" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Cube_003-mesh-map-0">
<float_array id="Cube_003-mesh-map-0-array" count="72">0.625 0 0.375 0.25 0.375 0 0.625 0.25 0.375 0.5 0.375 0.25 0.625 0.5 0.375 0.75 0.375 0.5 0.625 0.75 0.375 1 0.375 0.75 0.375 0.5 0.125 0.75 0.125 0.5 0.875 0.5 0.625 0.75 0.625 0.5 0.625 0 0.625 0.25 0.375 0.25 0.625 0.25 0.625 0.5 0.375 0.5 0.625 0.5 0.625 0.75 0.375 0.75 0.625 0.75 0.625 1 0.375 1 0.375 0.5 0.375 0.75 0.125 0.75 0.875 0.5 0.875 0.75 0.625 0.75</float_array>
<technique_common>
<accessor source="#Cube_003-mesh-map-0-array" count="36" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Cube_003-mesh-vertices">
<input semantic="POSITION" source="#Cube_003-mesh-positions"/>
</vertices>
<triangles count="12">
<input semantic="VERTEX" source="#Cube_003-mesh-vertices" offset="0"/>
<input semantic="NORMAL" source="#Cube_003-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#Cube_003-mesh-map-0" offset="2" set="0"/>
<p>1 0 0 2 0 1 0 0 2 3 1 3 6 1 4 2 1 5 7 2 6 4 2 7 6 2 8 5 3 9 0 3 10 4 3 11 6 4 12 0 4 13 2 4 14 3 5 15 5 5 16 7 5 17 1 0 18 3 0 19 2 0 20 3 1 21 7 1 22 6 1 23 7 2 24 5 2 25 4 2 26 5 3 27 1 3 28 0 3 29 6 4 30 4 4 31 0 4 32 3 5 33 1 5 34 5 5 35</p>
</triangles>
</mesh>
</geometry>
<geometry id="Cube_002-mesh" name="Cube.002">
<mesh>
<source id="Cube_002-mesh-positions">
<float_array id="Cube_002-mesh-positions-array" count="24">-1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 1 -1 1 1 1 -1 1 1 1</float_array>
<technique_common>
<accessor source="#Cube_002-mesh-positions-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Cube_002-mesh-normals">
<float_array id="Cube_002-mesh-normals-array" count="18">-1 0 0 0 1 0 1 0 0 0 -1 0 0 0 -1 0 0 1</float_array>
<technique_common>
<accessor source="#Cube_002-mesh-normals-array" count="6" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Cube_002-mesh-map-0">
<float_array id="Cube_002-mesh-map-0-array" count="72">0.625 0 0.375 0.25 0.375 0 0.625 0.25 0.375 0.5 0.375 0.25 0.625 0.5 0.375 0.75 0.375 0.5 0.625 0.75 0.375 1 0.375 0.75 0.375 0.5 0.125 0.75 0.125 0.5 0.875 0.5 0.625 0.75 0.625 0.5 0.625 0 0.625 0.25 0.375 0.25 0.625 0.25 0.625 0.5 0.375 0.5 0.625 0.5 0.625 0.75 0.375 0.75 0.625 0.75 0.625 1 0.375 1 0.375 0.5 0.375 0.75 0.125 0.75 0.875 0.5 0.875 0.75 0.625 0.75</float_array>
<technique_common>
<accessor source="#Cube_002-mesh-map-0-array" count="36" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Cube_002-mesh-vertices">
<input semantic="POSITION" source="#Cube_002-mesh-positions"/>
</vertices>
<triangles count="12">
<input semantic="VERTEX" source="#Cube_002-mesh-vertices" offset="0"/>
<input semantic="NORMAL" source="#Cube_002-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#Cube_002-mesh-map-0" offset="2" set="0"/>
<p>1 0 0 2 0 1 0 0 2 3 1 3 6 1 4 2 1 5 7 2 6 4 2 7 6 2 8 5 3 9 0 3 10 4 3 11 6 4 12 0 4 13 2 4 14 3 5 15 5 5 16 7 5 17 1 0 18 3 0 19 2 0 20 3 1 21 7 1 22 6 1 23 7 2 24 5 2 25 4 2 26 5 3 27 1 3 28 0 3 29 6 4 30 4 4 31 0 4 32 3 5 33 1 5 34 5 5 35</p>
</triangles>
</mesh>
</geometry>
<geometry id="Cube_001-mesh" name="Cube.001">
<mesh>
<source id="Cube_001-mesh-positions">
<float_array id="Cube_001-mesh-positions-array" count="24">-1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 1 -1 1 1 1 -1 1 1 1</float_array>
<technique_common>
<accessor source="#Cube_001-mesh-positions-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Cube_001-mesh-normals">
<float_array id="Cube_001-mesh-normals-array" count="18">-1 0 0 0 1 0 1 0 0 0 -1 0 0 0 -1 0 0 1</float_array>
<technique_common>
<accessor source="#Cube_001-mesh-normals-array" count="6" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Cube_001-mesh-map-0">
<float_array id="Cube_001-mesh-map-0-array" count="72">0.625 0 0.375 0.25 0.375 0 0.625 0.25 0.375 0.5 0.375 0.25 0.625 0.5 0.375 0.75 0.375 0.5 0.625 0.75 0.375 1 0.375 0.75 0.375 0.5 0.125 0.75 0.125 0.5 0.875 0.5 0.625 0.75 0.625 0.5 0.625 0 0.625 0.25 0.375 0.25 0.625 0.25 0.625 0.5 0.375 0.5 0.625 0.5 0.625 0.75 0.375 0.75 0.625 0.75 0.625 1 0.375 1 0.375 0.5 0.375 0.75 0.125 0.75 0.875 0.5 0.875 0.75 0.625 0.75</float_array>
<technique_common>
<accessor source="#Cube_001-mesh-map-0-array" count="36" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Cube_001-mesh-vertices">
<input semantic="POSITION" source="#Cube_001-mesh-positions"/>
</vertices>
<triangles count="12">
<input semantic="VERTEX" source="#Cube_001-mesh-vertices" offset="0"/>
<input semantic="NORMAL" source="#Cube_001-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#Cube_001-mesh-map-0" offset="2" set="0"/>
<p>1 0 0 2 0 1 0 0 2 3 1 3 6 1 4 2 1 5 7 2 6 4 2 7 6 2 8 5 3 9 0 3 10 4 3 11 6 4 12 0 4 13 2 4 14 3 5 15 5 5 16 7 5 17 1 0 18 3 0 19 2 0 20 3 1 21 7 1 22 6 1 23 7 2 24 5 2 25 4 2 26 5 3 27 1 3 28 0 3 29 6 4 30 4 4 31 0 4 32 3 5 33 1 5 34 5 5 35</p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="Scene" name="Scene">
<node id="other_empty-shapeonly" name="other_empty-shapeonly" type="NODE">
<matrix sid="transform">1 0 0 0 0 1 0 25.03608 0 0 1 0 0 0 0 1</matrix>
</node>
<node id="sphere_empty-shapeonly" name="sphere_empty-shapeonly" type="NODE">
<matrix sid="transform">1 0 0 0 0 1 0 23.0371 0 0 1 0 0 0 0 1</matrix>
</node>
<node id="image_empty-shapeonly" name="image_empty-shapeonly" type="NODE">
<matrix sid="transform">1 0 0 0 0 1 0 21.12412 0 0 1 0 0 0 0 1</matrix>
</node>
<node id="arrow_empty-shapeonly" name="arrow_empty-shapeonly" type="NODE">
<matrix sid="transform">1 0 0 0 0 1 0 19.09683 0 0 1 0 0 0 0 1</matrix>
</node>
<node id="cube-convshape" name="cube-convshape" type="NODE">
<matrix sid="transform">1 0 0 0 0 1 0 12 0 0 1 0 0 0 0 1</matrix>
<instance_geometry url="#Cube_007-mesh" name="cube-convshape"/>
</node>
<node id="cube_empty-shapeonly" name="cube_empty-shapeonly" type="NODE">
<matrix sid="transform">1 0 0 0 0 1 0 16.01765 0 0 1 0 0 0 0 1</matrix>
</node>
<node id="cube-convshapeonly" name="cube-convshapeonly" type="NODE">
<matrix sid="transform">1 0 0 0 0 1 0 12 0 0 1 0 0 0 0 1</matrix>
<instance_geometry url="#Cube_003-mesh" name="cube-convshapeonly"/>
</node>
<node id="cube-shapeonly" name="cube-shapeonly" type="NODE">
<matrix sid="transform">1 0 0 0 0 1 0 8 0 0 1 0 0 0 0 1</matrix>
<instance_geometry url="#Cube_002-mesh" name="cube-shapeonly"/>
</node>
<node id="cube-shape" name="cube-shape" type="NODE">
<matrix sid="transform">1 0 0 0 0 1 0 4 0 0 1 0 0 0 0 1</matrix>
<instance_geometry url="#Cube_001-mesh" name="cube-shape"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#Scene"/>
</scene>
</COLLADA>