Share

write_texture

Writes a texture to a file, or multiple files for a UDIM-style texture atlas.

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 occurrences 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

The image filetype is controlled by the file extension. For example, .jpg or .jpeg will write a jpeg image. For a list of supported file types, see the file browser's list of supported file extensions. Note these are slightly different for reading and writing.

Inputs

texture

The texture object, as produced by compounds such as "read_texture". A texture can contain one or multiple images in a UDIM-style texture atlas.

bit_depth

The bit-depth of the output file. Not all file formats support all bit-depth options. When an unsupported bit-depth/file format combination is chosen, the closest supported bit-depth is used.

When set to Auto a default bit depth for the file format is used.

| Format   | Default        |
|----------|----------------|
| dpx      | 16 bit int     |
| exr      | 16 bit float   |
| fits     | 16 bit int     |
| iff      | 16 bit int     |
| hdr      | 32 bit float * |
| png      | 8 bit int      |
| rla      | 16 bit int     |
| sgi      | 16 bit int     |
| tif      | 16 bit int     |
| tx       | 16 bit float   |
| bmp      | 8 bit int *    |
| ico      | 8 bit int *    |
| jpg      | 8 bit int *    |
| tga      | 8 bit int *    |
| tpic     | 8 bit int *    |

 * This is the only supported data type.

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 colorspace will automatically be determined using OpenColorIO's file rules, if possible. The pixel data will be converted to this colorspace from the scene-referred "working colorspace" (also known as the "rendering colorspace"). Use "raw" to bypass any colorspace conversion.

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

out_texture

The texture passed through. This can be connected to an output to trigger evaluation of this node (and therefore writing of the data).

success

A boolean indicating success or failure.

resolved_file_paths

The file path or paths that were written to. These will have all UDIM tokens, as well as image sequence tokens resolved.

Was this information helpful?