Skip to content

Commit e94415a

Browse files
committed
loading obj materials
1 parent d53f285 commit e94415a

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Editor/ZOZeroSimMenu.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,18 @@ static void ImportURDF(MenuCommand menuCommand) {
5353

5454
}
5555

56+
[MenuItem("GameObject/ZeroSim/Import OBJ...", false, 0)]
57+
static void ImportOBJ(MenuCommand menuCommand) {
58+
string filePath = EditorUtility.OpenFilePanel("Import OBJ", ".", "obj");
59+
60+
if (filePath.Length == 0) {
61+
return;
62+
}
63+
64+
ZOImportOBJ.Import(filePath);
65+
66+
}
67+
68+
5669
}
5770
}

Runtime/Scripts/Util/ImportExport/ZOImportOBJ.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ protected static Material[] ImportMTLFile(string mtlFilePath) {
104104
}
105105
}
106106

107-
// if (currentMaterial != null) {
108-
// materials.Add(currentMaterial);
109-
// }
107+
if (currentMaterial != null) {
108+
materials.Add(currentMaterial);
109+
}
110110

111111
return materials.ToArray();
112112
}

0 commit comments

Comments
 (0)