Problem loading OBJ in Pi3D - Raspberry Pi Forums


got problem loading obj format model pi3d.
code i'm using load model in same directory code , pi3d files.

mymodel = pi3d.loadmodel("ship.obj","test", 0,-1,-20)

reassuring text suggests in directory department...

loading ship.obj
/home/pi/desktop/stuff/pi3d
materials: {}
numv: [894]
len uv= 151

indices= 894
vertices= 2682
normals= 2682
tex_coords= 1788

...and error message kinda states obvious...

file "include/loaderobj.py", line 19, in parse_mtl
f = open(fname, 'r')
ioerror: [errno 21] directory: '/home/pi/desktop/stuff/pi3d/'

need use obj format files in pi3d (paddyg, you'll know why;) need 'legit' ones work before start generating own appreciated.

i think means it's directory not file! don't know without seeing mtl file error looks couldn't find mtl or texture file. have put them? think loaderobj can cope without textures info message uv implies there 1 specified.

things have using obj files blender, say, export normals (loaderobj doesn't attempt create them) , edit mtl file can find texture files. need have path relative mtl , obj files are. upload demo obj file textures now.

i.e. have had change path png file in .mtl file

code: select all

# blender mtl file: 'none' # material count: 1 newmtl ns 0 ka 0.000000 0.000000 0.000000 kd 0.8 0.8 0.8 ks 0.8 0.8 0.8 d 1 illum 2 map_kd ../textures/raspi256x256.png
nb in github.com/rec/pi3d repository


raspberrypi



Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums