0

假设我有一个obj来自 Maya2014 的文件,如下所示

aaaaa.obj

# This file uses centimeters as units for non-parametric coordinates.

mtllib aaaaaa.mtl
g default
v 7.584940 0.000000 3.298261
v 7.416561 0.000000 2.235156
v 6.927905 0.000000 1.276115
v 6.166806 0.000000 0.515016
v 5.207765 0.000000 0.026360
v 4.144660 0.000000 -0.142020
v 3.081555 0.000000 0.026360
v 2.122514 0.000000 0.515016
v 1.361415 0.000000 1.276115
v 0.872759 0.000000 2.235156
v 0.704380 0.000000 3.298261
v 0.872759 0.000000 4.361366
v 1.361415 0.000000 5.320407
v 2.122514 0.000000 6.081506
v 3.081555 0.000000 6.570162
v 4.144660 0.000000 6.738542
v 5.207766 0.000000 6.570162
v 6.166807 0.000000 6.081507
v 6.927906 0.000000 5.320407
v 7.416562 0.000000 4.361366
v 7.584940 6.330827 3.298261
v 7.416561 6.330827 2.235156
v 6.927905 6.330827 1.276115
v 6.166806 6.330827 0.515016
v 5.207765 6.330827 0.026360
v 4.144660 6.330827 -0.142020
v 3.081555 6.330827 0.026360
v 2.122514 6.330827 0.515016
v 1.361415 6.330827 1.276115
v 0.872759 6.330827 2.235156
v 0.704380 6.330827 3.298261
v 0.872759 6.330827 4.361366
v 1.361415 6.330827 5.320407
v 2.122514 6.330827 6.081506
v 3.081555 6.330827 6.570162
v 4.144660 6.330827 6.738542
v 5.207766 6.330827 6.570162
v 6.166807 6.330827 6.081507
v 6.927906 6.330827 5.320407
v 7.416562 6.330827 4.361366
v 9.484939 6.330827 3.298261
v 9.223568 6.330827 1.648023
v 8.465038 6.330827 0.159323
v 7.283598 6.330827 -1.022117
v 5.794897 6.330827 -1.780647
v 4.144660 6.330827 -2.042019
v 2.494423 6.330827 -1.780647
v 1.005722 6.330827 -1.022116
v -0.175717 6.330827 0.159323
v -0.934248 6.330827 1.648024
v -1.195619 6.330827 3.298261
v -0.934248 6.330827 4.948499
v -0.175717 6.330827 6.437199
v 1.005723 6.330827 7.618638
v 2.494424 6.330827 8.377169
v 4.144661 6.330827 8.638540
v 5.794899 6.330827 8.377169
v 7.283599 6.330827 7.618637
v 8.465038 6.330827 6.437198
v 9.223570 6.330827 4.948497
v 9.484939 0.000000 3.298261
v 9.223568 0.000000 1.648023
v 8.465038 0.000000 0.159323
v 7.283598 0.000000 -1.022117
v 5.794897 0.000000 -1.780647
v 4.144660 0.000000 -2.042019
v 2.494423 0.000000 -1.780647
v 1.005722 0.000000 -1.022116
v -0.175717 0.000000 0.159323
v -0.934248 0.000000 1.648024
v -1.195619 0.000000 3.298261
v -0.934248 0.000000 4.948499
v -0.175717 0.000000 6.437199
v 1.005723 0.000000 7.618638
v 2.494424 0.000000 8.377169
v 4.144661 0.000000 8.638540
v 5.794899 0.000000 8.377169
v 7.283599 0.000000 7.618637
v 8.465038 0.000000 6.437198
v 9.223570 0.000000 4.948497
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 63308267520.000000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 0.000000 0.500000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 2.000000 63308267520.000000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vt 0.000000 63308267520.000000
vt 2.000000 0.500000
vn -0.951057 0.000000 0.309017
vn -1.000000 0.000000 0.000001
vn -1.000000 0.000000 0.000001
vn -0.951057 0.000000 0.309017
vn -0.809017 0.000000 0.587785
vn -0.809017 0.000000 0.587785
vn -0.587786 0.000000 0.809017
vn -0.587786 0.000000 0.809017
vn -0.309017 0.000000 0.951057
vn -0.309017 0.000000 0.951057
vn 0.000000 0.000000 1.000000
vn 0.000000 0.000000 1.000000
vn 0.309017 0.000000 0.951057
vn 0.309017 0.000000 0.951057
vn 0.587785 0.000000 0.809017
vn 0.587785 0.000000 0.809017
vn 0.809017 0.000000 0.587785
vn 0.809017 0.000000 0.587785
vn 0.951057 0.000000 0.309017
vn 0.951057 0.000000 0.309017
vn 1.000000 0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 0.951057 0.000000 -0.309017
vn 0.951057 0.000000 -0.309017
vn 0.809017 0.000000 -0.587785
vn 0.809017 0.000000 -0.587785
vn 0.587785 0.000000 -0.809017
vn 0.587785 0.000000 -0.809017
vn 0.309017 0.000000 -0.951056
vn 0.309017 0.000000 -0.951056
vn 0.000000 0.000000 -1.000000
vn 0.000000 0.000000 -1.000000
vn -0.309017 0.000000 -0.951057
vn -0.309017 0.000000 -0.951057
vn -0.587785 0.000000 -0.809017
vn -0.587785 0.000000 -0.809017
vn -0.809017 0.000000 -0.587785
vn -0.809017 0.000000 -0.587785
vn -0.951057 0.000000 -0.309016
vn -0.951057 0.000000 -0.309016
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 -0.000000
vn 0.000000 1.000000 -0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 -0.000000
vn 0.000000 1.000000 -0.000000
vn 0.000000 1.000000 -0.000000
vn 0.000000 1.000000 -0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 -0.000000
vn 0.000000 1.000000 -0.000000
vn 0.000000 1.000000 -0.000000
vn 0.000000 1.000000 -0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.951057 0.000000 -0.309017
vn 1.000000 0.000000 -0.000001
vn 1.000000 0.000000 -0.000001
vn 0.951057 0.000000 -0.309017
vn 0.809017 0.000000 -0.587785
vn 0.809017 0.000000 -0.587785
vn 0.587785 0.000000 -0.809017
vn 0.587785 0.000000 -0.809017
vn 0.309017 0.000000 -0.951057
vn 0.309017 0.000000 -0.951057
vn 0.000000 0.000000 -1.000000
vn 0.000000 0.000000 -1.000000
vn -0.309017 0.000000 -0.951057
vn -0.309017 0.000000 -0.951057
vn -0.587785 0.000000 -0.809017
vn -0.587785 0.000000 -0.809017
vn -0.809017 0.000000 -0.587785
vn -0.809017 0.000000 -0.587785
vn -0.951057 0.000000 -0.309017
vn -0.951057 0.000000 -0.309017
vn -1.000000 0.000000 0.000000
vn -1.000000 0.000000 0.000000
vn -0.951057 0.000000 0.309017
vn -0.951057 0.000000 0.309017
vn -0.809017 0.000000 0.587785
vn -0.809017 0.000000 0.587785
vn -0.587785 0.000000 0.809017
vn -0.587785 0.000000 0.809017
vn -0.309017 0.000000 0.951057
vn -0.309017 0.000000 0.951057
vn -0.000000 0.000000 1.000000
vn -0.000000 0.000000 1.000000
vn 0.309017 0.000000 0.951057
vn 0.309017 0.000000 0.951057
vn 0.587786 0.000000 0.809017
vn 0.587786 0.000000 0.809017
vn 0.809017 0.000000 0.587785
vn 0.809017 0.000000 0.587785
vn 0.951057 0.000000 0.309017
vn 0.951057 0.000000 0.309017
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 -0.000000
vn 0.000000 -1.000000 -0.000000
vn 0.000000 -1.000000 -0.000000
vn 0.000000 -1.000000 -0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 -0.000000
vn 0.000000 -1.000000 -0.000000
vn 0.000000 -1.000000 -0.000000
vn 0.000000 -1.000000 -0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
s 1
g pPipe1
usemtl initialShadingGroup
f 2/1/1 1/2/2 21/61/3 22/62/4
f 3/5/5 2/1/1 22/62/4 23/63/6
f 4/7/7 3/5/5 23/63/6 24/64/8
f 5/9/9 4/7/7 24/64/8 25/65/10
f 6/11/11 5/9/9 25/65/10 26/66/12
f 7/13/13 6/11/11 26/66/12 27/67/14
f 8/15/15 7/13/13 27/67/14 28/68/16
f 9/17/17 8/15/15 28/68/16 29/69/18
f 10/19/19 9/17/17 29/69/18 30/70/20
f 11/21/21 10/19/19 30/70/20 31/71/22
f 12/23/23 11/21/21 31/71/22 32/72/24
f 13/25/25 12/23/23 32/72/24 33/73/26
f 14/27/27 13/25/25 33/73/26 34/74/28
f 15/29/29 14/27/27 34/74/28 35/75/30
f 16/31/31 15/29/29 35/75/30 36/76/32
f 17/33/33 16/31/31 36/76/32 37/77/34
f 18/35/35 17/33/33 37/77/34 38/78/36
f 19/37/37 18/35/35 38/78/36 39/79/38
f 20/39/39 19/37/37 39/79/38 40/80/40
f 1/2/2 20/39/39 40/80/40 21/61/3
s 2
f 22/4/41 21/3/42 41/81/43 42/83/44
f 23/6/45 22/4/41 42/83/44 43/85/46
f 24/8/47 23/6/45 43/85/46 44/87/48
f 25/10/49 24/8/47 44/87/48 45/89/50
f 26/12/51 25/10/49 45/89/50 46/91/52
f 27/14/53 26/12/51 46/91/52 47/93/54
f 28/16/55 27/14/53 47/93/54 48/95/56
f 29/18/57 28/16/55 48/95/56 49/97/58
f 30/20/59 29/18/57 49/97/58 50/99/60
f 31/22/61 30/20/59 50/99/60 51/101/62
f 32/24/63 31/22/61 51/101/62 52/103/64
f 33/26/65 32/24/63 52/103/64 53/105/66
f 34/28/67 33/26/65 53/105/66 54/107/68
f 35/30/69 34/28/67 54/107/68 55/109/70
f 36/32/71 35/30/69 55/109/70 56/111/72
f 37/34/73 36/32/71 56/111/72 57/113/74
f 38/36/75 37/34/73 57/113/74 58/115/76
f 39/38/77 38/36/75 58/115/76 59/117/78
f 40/40/79 39/38/77 59/117/78 60/119/80
f 21/3/42 40/40/79 60/119/80 41/81/43
s 3
f 42/83/81 41/81/82 61/82/83 62/84/84
f 43/85/85 42/83/81 62/84/84 63/86/86
f 44/87/87 43/85/85 63/86/86 64/88/88
f 45/89/89 44/87/87 64/88/88 65/90/90
f 46/91/91 45/89/89 65/90/90 66/92/92
f 47/93/93 46/91/91 66/92/92 67/94/94
f 48/95/95 47/93/93 67/94/94 68/96/96
f 49/97/97 48/95/95 68/96/96 69/98/98
f 50/99/99 49/97/97 69/98/98 70/100/100
f 51/101/101 50/99/99 70/100/100 71/102/102
f 52/103/103 51/101/101 71/102/102 72/104/104
f 53/105/105 52/103/103 72/104/104 73/106/106
f 54/107/107 53/105/105 73/106/106 74/108/108
f 55/109/109 54/107/107 74/108/108 75/110/110
f 56/111/111 55/109/109 75/110/110 76/112/112
f 57/113/113 56/111/111 76/112/112 77/114/114
f 58/115/115 57/113/113 77/114/114 78/116/116
f 59/117/117 58/115/115 78/116/116 79/118/118
f 60/119/119 59/117/117 79/118/118 80/120/120
f 41/81/82 60/119/119 80/120/120 61/82/83
s 4
f 62/42/121 61/41/122 1/2/123 2/1/124
f 63/43/125 62/42/121 2/1/124 3/5/126
f 64/44/127 63/43/125 3/5/126 4/7/128
f 65/45/129 64/44/127 4/7/128 5/9/130
f 66/46/131 65/45/129 5/9/130 6/11/132
f 67/47/133 66/46/131 6/11/132 7/13/134
f 68/48/135 67/47/133 7/13/134 8/15/136
f 69/49/137 68/48/135 8/15/136 9/17/138
f 70/50/139 69/49/137 9/17/138 10/19/140
f 71/51/141 70/50/139 10/19/140 11/21/142
f 72/52/143 71/51/141 11/21/142 12/23/144
f 73/53/145 72/52/143 12/23/144 13/25/146
f 74/54/147 73/53/145 13/25/146 14/27/148
f 75/55/149 74/54/147 14/27/148 15/29/150
f 76/56/151 75/55/149 15/29/150 16/31/152
f 77/57/153 76/56/151 16/31/152 17/33/154
f 78/58/155 77/57/153 17/33/154 18/35/156
f 79/59/157 78/58/155 18/35/156 19/37/158
f 80/60/159 79/59/157 19/37/158 20/39/160
f 61/41/122 80/60/159 20/39/160 1/2/123

aaaaa.mtl

newmtl initialShadingGroup
illum 4
Kd 0.50 0.50 0.50
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
Ni 1.00

当我尝试使用convert_obj_three.py对其进行转换时,出现以下错误。 在此处输入图像描述

我已经正确安装了 Python3.*。

可能是什么问题?如何解决?

4

2 回答 2

0

它给出了语法错误,所以我开始检查语法。发现对python 2. +有效,对3. +无效。然后我刚刚卸载了 python 3.* 它并安装了 2.75。不是它像魅力一样起作用。

于 2013-09-02T13:05:45.443 回答
0

你必须有一个OBJ文件吗?如果没有,我建议使用 THREE.js 源代码附带的 Maya to THREE 导出器。它直接导出为 .JS 格式,无需中间步骤。如果您从 GitHub 下载存储库,您可以在 utils/exporters/maya 中找到导出器文件。

您可以在 THREE.js 官方存储库中找到的导出器仅支持静态模型。我创建了一个更新版本,它还支持导出装配和动画模型。我们有一个将更新的导出器与三个主干集成的拉取请求,但如果您想立即获得新的和改进的导出器,您可以从这个存储库获取它:https ://github.com/BlackTowerEntertainment/three.js/tree /maya_animation_exporter

希望这可以帮助。

于 2014-04-16T21:01:54.537 回答