File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,12 +36,20 @@ PYBIND11_MODULE(tinyobj, tobj_module)
3636 .def_readonly (" lines" , &shape_t ::lines)
3737 .def_readonly (" points" , &shape_t ::points);
3838
39+ py::class_<index_t >(tobj_module, " index_t" )
40+ .def (py::init<>())
41+ .def_readonly (" vertex_index" , &index_t ::vertex_index)
42+ .def_readonly (" normal_index" , &index_t ::normal_index)
43+ .def_readonly (" texcoord_index" , &index_t ::texcoord_index)
44+ ;
45+
3946 // TODO(syoyo): write more bindings
4047 py::class_<material_t >(tobj_module, " material_t" )
4148 .def (py::init<>());
4249
4350 py::class_<mesh_t >(tobj_module, " mesh_t" )
44- .def (py::init<>());
51+ .def (py::init<>())
52+ .def_readonly (" indices" , &mesh_t ::indices);
4553
4654 py::class_<lines_t >(tobj_module, " lines_t" )
4755 .def (py::init<>());
Original file line number Diff line number Diff line change 2121# TODO(syoyo): print mesh
2222for shape in reader .GetShapes ():
2323 print (shape .name )
24- print (len (shape .mesh .indices ))
24+ for idx in shape .mesh .indices :
25+ print ("v_idx " , idx .vertex_index )
You can’t perform that action at this time.
0 commit comments