Skip to content

Commit

Permalink
read 2g obj
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhang95 committed Nov 3, 2023
1 parent 76272db commit 49ae5c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zeno/src/nodes/neo/ReadObjPrim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ std::shared_ptr<PrimitiveObject> parse_obj(std::vector<char> &&bin) {

struct ReadObjPrim : INode {
virtual void apply() override {
auto path = get_input<StringObject>("path")->get();
auto binary = file_get_binary<std::vector<char>>(path);
auto path = get_input2<std::string>("path");
std::string native_path = std::filesystem::u8path(path).string();
std::ifstream file(native_path, std::ios::binary);
auto binary = std::vector<char>((std::istreambuf_iterator<char>(file)),
std::istreambuf_iterator<char>());
auto prim = parse_obj(std::move(binary));
if (get_param<bool>("triangulate")) {
primTriangulate(prim.get());
Expand Down

0 comments on commit 49ae5c0

Please sign in to comment.