Share

read_texture

Reads a texture from a file. A texture is made of one or more images, in a texture-atlas (such as "UDIM") space.

File paths

Multiple tokens for path resolution are supported.

UDIM and other texture-atlas file name patterns are supported:

  • filename_<UDIM>.tif
    • Will look for file on disk of the form : filename_1001.tif
  • filename_<uvtile>.tif
    • Will look for file on disk of the form : filename_u0_v0.tif

Environment variables in paths are supported:

  • ${CURRENT_SHOT_RENDERS}/textures/filename.exr, where ${CURRENT_SHOT_RENDERS} is an environment variable.

Frame number is supported for animation (see frame).

  • Use # to include the input frame number. The number of occurences of # determines the amount of padding. For example, file.####.jpg resolves to file.0042.jpg on frame 42.

All of these can be used together, in this example an animated UDIM texture specified with an environment variable.

  • ${CURRENT_SHOT}/filename.<UDIM>.####.exr.

The order of operations for resolution is environment variables, then frame resolution, then texture atlases (such as UDIM). This means UDIM or frame tokens can be specified using environment variables.

Supported file types

For a list of supported file types, see the file browser's list of supported tyles and file extensions. Note these are slightly different for reading and writing.

Inputs

file_path

The path to the image file that will be read and sampled.

file_color_space

The colorspace of the file. If left as the default empty string the node will attempt to determine the colorspace automatically using OpenColorIO. The pixel data will be converted from this colorspace to the scene-referred "working colorspace" (also known as the "rendering colorspace"). Use "raw" to bypass any colorspace conversion.

sampling_type

The sampling strategy:

  • Closest: Closest texel, meaning no pixel values are blended. This can appear pixelated when samples are denser than the image resolution.
  • Bilinear: Bilinear interpolation within the texture. This is a linear blend between the four pixels, where a coordinate exactly at the center of the pixel is the pixel value.
  • Bicubic: Bicubic interpolation within the texture. This is curved interpolation where pixel values blend between the closest 16 values. This is smoother and sampling at the center of the pixel will not reproduce that exact value.

frame

The frame number of an image sequence to read. If the file_path contains an image sequence token (such as file.####.jpg), the frame number will be substituted there. time.frame may be connected here to drive the frame of an image sequence to read.

Outputs

texture

The texture object containing the data from the read image or images.

success

Outputs true if the file was read successfully, and false otherwise.

Was this information helpful?