Test for missing maps

   2166   2   2
User Avatar
Member
221 posts
Joined: 7月 2005
Offline
Is there a way to check for the existence of a map in vex? I'd like to be able to try to load a texture map and use a default value if the map doesn't exist (rather than the reddish pink that shows up normally).

I can check if the attribute is bound to the geometry, but I can't find a way to check if the file exists before loading it.

In python you can do:
import os
os.path.exists(filename)

And then do something with the boolean.

Dave
User Avatar
Member
702 posts
Joined:
Offline
have a look at the teximport vex function

http://www.sidefx.com/docs/houdini12.5/vex/functions/teximport [sidefx.com]
User Avatar
Member
221 posts
Joined: 7月 2005
Offline
Thanks, that's what SESI suggested too.

That works, except for I'm still getting “Unable to load texture” messages because texinfo can't load the texture. Oh well, it was worth a try.

I ended up creating dummy textures with the right names, but only a few pixels in them.

Dave
  • Quick Links