Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

Contents



The texture manager has one simple role: convert images to RenderMan's texture format.

User interface

Settings

Number of processes: How many txmake processes will be launched at the same time. The default is 2 but it is often 

Fallback Texture Path: By default, the texture manager saves the texture next to the source image. If, for any reason, it is impossible to save in that directory, the fallback texture path will be used.

Always Fallback: Always save converted textures in the fallback texture directory.

Show Advanced Options: Show more advanced options in the user interface.

Texture extensions: All texture file extensions so the texture manage knows which files can be marked as already converted.

Txmake Configuration

The texture manager uses a set of rules to choose optimal txmake parameters based on:

  • The type of node using the texture: pattern, light, lightfilter or imageplane.
  • A set of base parameters for that type of node
  • one or more rules to modify the base parameters when considering the file's name, the bit depth, etc.

These settings are defined in a $RMANTREE/etc/txmanager_rules.json.

JSON structure

Here is a very basic example. See $RMANTREE/etc/txmanager_rules.json for the real rules.

{
    "pattern": {
        "args": {
            "texture_type": "regular",
            "smode": "periodic",
            "tmode": "periodic",
            "texture_format": "pixar",
            "texture_filter": "catmull-rom",
            "resize": "up-",
            "data_type": null,
            "compression": "lossless",
            "compression_level": null
        },
        "rules": {
            "'_i8t' in '%(img_name)s'": {
                "args": {
                    "texture_format": "tiff",
                    "data_type": "byte"
                }
            }
		}
	}
}

Category

Here, the category is pattern, but there are other pre-defined categories: light, lightfilter and imageplane.

args

This section is a dictionary representing default txmake parameter values for the current category. The key names (texture_type, smode, tmode, etc) are coming from the TxParams class of the txmanager python module.

rules

Here we define a set of rules that will all be executed in the file's order. The key string should evaluate as a python expression once substituted.

There are a number of available substitution tokens:

tokencontents
node_typethe node type (PxrDiskLight, PxrTexture, etc).
img_atlasTrue if the texture is a UDIM or Mudbox texture set.
img_namethe image name, without its file extension.
img_extthe image's file extension, with its leading dot.
img_typethe image's data type: int or float
img_depththe image's bit depth: 8, 16, 32

In the example above, the rule:

"'_i8t' in '%(img_name)s'": {
	"args": {
		"texture_format": "tiff",
		"data_type": "byte"
	}
}

matches "_i8t" in the image name, which is interpreted as shorthand for "8 bits integer tiff format" and sets the texture format to "tiff" and the image to "byte" (8 bits integer, see txmake documentation).

The standard rules tend to rely on the node_type, img_type and img_depth to pick the best file format and compression algorithm.