Skip to content

Commit fa5bd0b

Browse files
committed
Convert dae to usd
1 parent 105f209 commit fa5bd0b

16 files changed

+1248
-16
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies = [
1010
"usd-exchange>=2.2.0rc2", # locked to USD 25.05
1111
"numpy-stl>=3.2",
1212
"tinyobjloader>=2.0.0rc13",
13+
"pycollada>=0.9.2",
1314
]
1415

1516
[project.urls]

tests/data/assets/box.dae

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<asset>
4+
<unit name="meter" meter="1"/>
5+
<up_axis>Z_UP</up_axis>
6+
</asset>
7+
<library_effects>
8+
<effect id="Material-effect">
9+
<profile_COMMON>
10+
<technique sid="common">
11+
<lambert>
12+
<emission>
13+
<color sid="emission">0 0 0 1</color>
14+
</emission>
15+
<diffuse>
16+
<color sid="diffuse">0.8 0.8 0.8 1</color>
17+
</diffuse>
18+
<index_of_refraction>
19+
<float sid="ior">1.45</float>
20+
</index_of_refraction>
21+
</lambert>
22+
</technique>
23+
</profile_COMMON>
24+
</effect>
25+
</library_effects>
26+
<library_images/>
27+
<library_materials>
28+
<material id="Material-material" name="Material">
29+
<instance_effect url="#Material-effect"/>
30+
</material>
31+
</library_materials>
32+
<library_geometries>
33+
<geometry id="Cube-mesh" name="Cube">
34+
<mesh>
35+
<source id="Cube-mesh-positions">
36+
<float_array id="Cube-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>
37+
<technique_common>
38+
<accessor source="#Cube-mesh-positions-array" count="8" stride="3">
39+
<param name="X" type="float"/>
40+
<param name="Y" type="float"/>
41+
<param name="Z" type="float"/>
42+
</accessor>
43+
</technique_common>
44+
</source>
45+
<source id="Cube-mesh-normals">
46+
<float_array id="Cube-mesh-normals-array" count="36">0 0 1 0 -1 0 -1 0 0 0 0 -1 1 0 0 0 1 0 0 0 1 0 -1 0 -1 0 0 0 0 -1 1 0 0 0 1 0</float_array>
47+
<technique_common>
48+
<accessor source="#Cube-mesh-normals-array" count="12" stride="3">
49+
<param name="X" type="float"/>
50+
<param name="Y" type="float"/>
51+
<param name="Z" type="float"/>
52+
</accessor>
53+
</technique_common>
54+
</source>
55+
<source id="Cube-mesh-map-0">
56+
<float_array id="Cube-mesh-map-0-array" count="72">0.875 0.5 0.625 0.75 0.625 0.5 0.625 0.75 0.375 1 0.375 0.75 0.625 0 0.375 0.25 0.375 0 0.375 0.5 0.125 0.75 0.125 0.5 0.625 0.5 0.375 0.75 0.375 0.5 0.625 0.25 0.375 0.5 0.375 0.25 0.875 0.5 0.875 0.75 0.625 0.75 0.625 0.75 0.625 1 0.375 1 0.625 0 0.625 0.25 0.375 0.25 0.375 0.5 0.375 0.75 0.125 0.75 0.625 0.5 0.625 0.75 0.375 0.75 0.625 0.25 0.625 0.5 0.375 0.5</float_array>
57+
<technique_common>
58+
<accessor source="#Cube-mesh-map-0-array" count="36" stride="2">
59+
<param name="S" type="float"/>
60+
<param name="T" type="float"/>
61+
</accessor>
62+
</technique_common>
63+
</source>
64+
<vertices id="Cube-mesh-vertices">
65+
<input semantic="POSITION" source="#Cube-mesh-positions"/>
66+
</vertices>
67+
<triangles material="Material-material" count="12">
68+
<input semantic="VERTEX" source="#Cube-mesh-vertices" offset="0"/>
69+
<input semantic="NORMAL" source="#Cube-mesh-normals" offset="1"/>
70+
<input semantic="TEXCOORD" source="#Cube-mesh-map-0" offset="2" set="0"/>
71+
<p>4 0 0 2 0 1 0 0 2 2 1 3 7 1 4 3 1 5 6 2 6 5 2 7 7 2 8 1 3 9 7 3 10 5 3 11 0 4 12 3 4 13 1 4 14 4 5 15 1 5 16 5 5 17 4 6 18 6 6 19 2 6 20 2 7 21 6 7 22 7 7 23 6 8 24 4 8 25 5 8 26 1 9 27 3 9 28 7 9 29 0 10 30 2 10 31 3 10 32 4 11 33 0 11 34 1 11 35</p>
72+
</triangles>
73+
</mesh>
74+
</geometry>
75+
</library_geometries>
76+
<library_visual_scenes>
77+
<visual_scene id="Scene" name="Scene">
78+
<node id="Cube" name="Cube" type="NODE">
79+
<matrix sid="transform">0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 1</matrix>
80+
<instance_geometry url="#Cube-mesh" name="Cube">
81+
<bind_material>
82+
<technique_common>
83+
<instance_material symbol="Material-material" target="#Material-material">
84+
<bind_vertex_input semantic="UVMap" input_semantic="TEXCOORD" input_set="0"/>
85+
</instance_material>
86+
</technique_common>
87+
</bind_material>
88+
</instance_geometry>
89+
</node>
90+
</visual_scene>
91+
</library_visual_scenes>
92+
<scene>
93+
<instance_visual_scene url="#Scene"/>
94+
</scene>
95+
</COLLADA>

tests/data/assets/box_unit_cm.dae

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<asset>
4+
<unit name="meter" meter="0.01"/>
5+
<up_axis>Z_UP</up_axis>
6+
</asset>
7+
<library_effects>
8+
<effect id="Material-effect">
9+
<profile_COMMON>
10+
<technique sid="common">
11+
<lambert>
12+
<emission>
13+
<color sid="emission">0 0 0 1</color>
14+
</emission>
15+
<diffuse>
16+
<color sid="diffuse">0.8 0.8 0.8 1</color>
17+
</diffuse>
18+
<index_of_refraction>
19+
<float sid="ior">1.45</float>
20+
</index_of_refraction>
21+
</lambert>
22+
</technique>
23+
</profile_COMMON>
24+
</effect>
25+
</library_effects>
26+
<library_images/>
27+
<library_materials>
28+
<material id="Material-material" name="Material">
29+
<instance_effect url="#Material-effect"/>
30+
</material>
31+
</library_materials>
32+
<library_geometries>
33+
<geometry id="Cube-mesh" name="Cube">
34+
<mesh>
35+
<source id="Cube-mesh-positions">
36+
<float_array id="Cube-mesh-positions-array" count="24">100 100 100 100 100 -100 100 -100 100 100 -100 -100 -100 100 100 -100 100 -100 -100 -100 100 -100 -100 -100</float_array>
37+
<technique_common>
38+
<accessor source="#Cube-mesh-positions-array" count="8" stride="3">
39+
<param name="X" type="float"/>
40+
<param name="Y" type="float"/>
41+
<param name="Z" type="float"/>
42+
</accessor>
43+
</technique_common>
44+
</source>
45+
<source id="Cube-mesh-normals">
46+
<float_array id="Cube-mesh-normals-array" count="36">0 0 1 0 -1 0 -1 0 0 0 0 -1 1 0 0 0 1 0 0 0 1 0 -1 0 -1 0 0 0 0 -1 1 0 0 0 1 0</float_array>
47+
<technique_common>
48+
<accessor source="#Cube-mesh-normals-array" count="12" stride="3">
49+
<param name="X" type="float"/>
50+
<param name="Y" type="float"/>
51+
<param name="Z" type="float"/>
52+
</accessor>
53+
</technique_common>
54+
</source>
55+
<source id="Cube-mesh-map-0">
56+
<float_array id="Cube-mesh-map-0-array" count="72">0.875 0.5 0.625 0.75 0.625 0.5 0.625 0.75 0.375 1 0.375 0.75 0.625 0 0.375 0.25 0.375 0 0.375 0.5 0.125 0.75 0.125 0.5 0.625 0.5 0.375 0.75 0.375 0.5 0.625 0.25 0.375 0.5 0.375 0.25 0.875 0.5 0.875 0.75 0.625 0.75 0.625 0.75 0.625 1 0.375 1 0.625 0 0.625 0.25 0.375 0.25 0.375 0.5 0.375 0.75 0.125 0.75 0.625 0.5 0.625 0.75 0.375 0.75 0.625 0.25 0.625 0.5 0.375 0.5</float_array>
57+
<technique_common>
58+
<accessor source="#Cube-mesh-map-0-array" count="36" stride="2">
59+
<param name="S" type="float"/>
60+
<param name="T" type="float"/>
61+
</accessor>
62+
</technique_common>
63+
</source>
64+
<vertices id="Cube-mesh-vertices">
65+
<input semantic="POSITION" source="#Cube-mesh-positions"/>
66+
</vertices>
67+
<triangles material="Material-material" count="12">
68+
<input semantic="VERTEX" source="#Cube-mesh-vertices" offset="0"/>
69+
<input semantic="NORMAL" source="#Cube-mesh-normals" offset="1"/>
70+
<input semantic="TEXCOORD" source="#Cube-mesh-map-0" offset="2" set="0"/>
71+
<p>4 0 0 2 0 1 0 0 2 2 1 3 7 1 4 3 1 5 6 2 6 5 2 7 7 2 8 1 3 9 7 3 10 5 3 11 0 4 12 3 4 13 1 4 14 4 5 15 1 5 16 5 5 17 4 6 18 6 6 19 2 6 20 2 7 21 6 7 22 7 7 23 6 8 24 4 8 25 5 8 26 1 9 27 3 9 28 7 9 29 0 10 30 2 10 31 3 10 32 4 11 33 0 11 34 1 11 35</p>
72+
</triangles>
73+
</mesh>
74+
</geometry>
75+
</library_geometries>
76+
<library_visual_scenes>
77+
<visual_scene id="Scene" name="Scene">
78+
<node id="Cube" name="Cube" type="NODE">
79+
<matrix sid="transform">0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 1</matrix>
80+
<instance_geometry url="#Cube-mesh" name="Cube">
81+
<bind_material>
82+
<technique_common>
83+
<instance_material symbol="Material-material" target="#Material-material">
84+
<bind_vertex_input semantic="UVMap" input_semantic="TEXCOORD" input_set="0"/>
85+
</instance_material>
86+
</technique_common>
87+
</bind_material>
88+
</instance_geometry>
89+
</node>
90+
</visual_scene>
91+
</library_visual_scenes>
92+
<scene>
93+
<instance_visual_scene url="#Scene"/>
94+
</scene>
95+
</COLLADA>

tests/data/assets/name_test.dae

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<asset>
4+
<unit name="meter" meter="1"/>
5+
<up_axis>Z_UP</up_axis>
6+
</asset>
7+
<library_effects>
8+
<effect id="Material-effect">
9+
<profile_COMMON>
10+
<technique sid="common">
11+
<lambert>
12+
<emission>
13+
<color sid="emission">0 0 0 1</color>
14+
</emission>
15+
<diffuse>
16+
<color sid="diffuse">0.8 0.8 0.8 1</color>
17+
</diffuse>
18+
<index_of_refraction>
19+
<float sid="ior">1.45</float>
20+
</index_of_refraction>
21+
</lambert>
22+
</technique>
23+
</profile_COMMON>
24+
</effect>
25+
</library_effects>
26+
<library_images/>
27+
<library_materials>
28+
<material id="Material-material" name="Material">
29+
<instance_effect url="#Material-effect"/>
30+
</material>
31+
</library_materials>
32+
<library_geometries>
33+
<geometry id="Cube-mesh" name="Cube">
34+
<mesh>
35+
<source id="Cube-mesh-positions">
36+
<float_array id="Cube-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>
37+
<technique_common>
38+
<accessor source="#Cube-mesh-positions-array" count="8" stride="3">
39+
<param name="X" type="float"/>
40+
<param name="Y" type="float"/>
41+
<param name="Z" type="float"/>
42+
</accessor>
43+
</technique_common>
44+
</source>
45+
<source id="Cube-mesh-normals">
46+
<float_array id="Cube-mesh-normals-array" count="36">0 0 1 0 -1 0 -1 0 0 0 0 -1 1 0 0 0 1 0 0 0 1 0 -1 0 -1 0 0 0 0 -1 1 0 0 0 1 0</float_array>
47+
<technique_common>
48+
<accessor source="#Cube-mesh-normals-array" count="12" stride="3">
49+
<param name="X" type="float"/>
50+
<param name="Y" type="float"/>
51+
<param name="Z" type="float"/>
52+
</accessor>
53+
</technique_common>
54+
</source>
55+
<source id="Cube-mesh-map-0">
56+
<float_array id="Cube-mesh-map-0-array" count="72">0.875 0.5 0.625 0.75 0.625 0.5 0.625 0.75 0.375 1 0.375 0.75 0.625 0 0.375 0.25 0.375 0 0.375 0.5 0.125 0.75 0.125 0.5 0.625 0.5 0.375 0.75 0.375 0.5 0.625 0.25 0.375 0.5 0.375 0.25 0.875 0.5 0.875 0.75 0.625 0.75 0.625 0.75 0.625 1 0.375 1 0.625 0 0.625 0.25 0.375 0.25 0.375 0.5 0.375 0.75 0.125 0.75 0.625 0.5 0.625 0.75 0.375 0.75 0.625 0.25 0.625 0.5 0.375 0.5</float_array>
57+
<technique_common>
58+
<accessor source="#Cube-mesh-map-0-array" count="36" stride="2">
59+
<param name="S" type="float"/>
60+
<param name="T" type="float"/>
61+
</accessor>
62+
</technique_common>
63+
</source>
64+
<vertices id="Cube-mesh-vertices">
65+
<input semantic="POSITION" source="#Cube-mesh-positions"/>
66+
</vertices>
67+
<triangles material="Material-material" count="12">
68+
<input semantic="VERTEX" source="#Cube-mesh-vertices" offset="0"/>
69+
<input semantic="NORMAL" source="#Cube-mesh-normals" offset="1"/>
70+
<input semantic="TEXCOORD" source="#Cube-mesh-map-0" offset="2" set="0"/>
71+
<p>4 0 0 2 0 1 0 0 2 2 1 3 7 1 4 3 1 5 6 2 6 5 2 7 7 2 8 1 3 9 7 3 10 5 3 11 0 4 12 3 4 13 1 4 14 4 5 15 1 5 16 5 5 17 4 6 18 6 6 19 2 6 20 2 7 21 6 7 22 7 7 23 6 8 24 4 8 25 5 8 26 1 9 27 3 9 28 7 9 29 0 10 30 2 10 31 3 10 32 4 11 33 0 11 34 1 11 35</p>
72+
</triangles>
73+
</mesh>
74+
</geometry>
75+
</library_geometries>
76+
<library_visual_scenes>
77+
<visual_scene id="Scene" name="Scene">
78+
<node id="Cube" name="Cube:1" type="NODE">
79+
<matrix sid="transform">0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 1</matrix>
80+
<instance_geometry url="#Cube-mesh" name="Cube">
81+
<bind_material>
82+
<technique_common>
83+
<instance_material symbol="Material-material" target="#Material-material">
84+
<bind_vertex_input semantic="UVMap" input_semantic="TEXCOORD" input_set="0"/>
85+
</instance_material>
86+
</technique_common>
87+
</bind_material>
88+
</instance_geometry>
89+
</node>
90+
</visual_scene>
91+
</library_visual_scenes>
92+
<scene>
93+
<instance_visual_scene url="#Scene"/>
94+
</scene>
95+
</COLLADA>

0 commit comments

Comments
 (0)