Jump to content

VEX function to see if a file is readable


Sam Hodge

Recommended Posts

Hi shady people,

In 3delight, I would use the following function:

http://www.3delight.com/en/uploads/docs/3delight/3delight_35.html#SEC137

color C;
if( textureinfo(texturename, "exists", 0) )
    C = texture(texturename);
else
    C = errorcolor;

But Alas I am now using Mantra and I cant do this.

Which part of the friendly manual did I miss reading?

Sam

Link to comment
Share on other sites

I'm grad I could help. Note, that texture() emits "warning" color by default when it can't open the file. It's a bright ping as you may have noticed. It can also be overwritten with HOUDINI_DEFAULT_TEXTURE_COLOR variable:

~$ hconfig -h HOUDINI_DEFAULT_TEXTURE_COLOR

Specifies the default color to use when texture maps cannot be found while rendering. This can be specified as a single string

containing four floating point numbers representing the red, green, blue and alpha components of the default color. For example:

setenv HOUDINI_DEFAULT_TEXTURE_COLOR "0 0 0 0"

to set it to zero black.

cheers,

skk.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...