User guide
129
Metadata on Imported Geometry
Arbitrary metadata can be read in with geometry on import, such as string data containing the texture paths written
out into an Alembic and read in as arbitrary geometry data. This means that assets can be created with additional
metadata, such as by adding string attributes to shape nodes in Maya before writing the data to Alembic.
In Katana the convention is for arbitrary geometry data to be read in as attributes called geometry.arbitrary.xxx,
which are then - by default - also written out as user or primvar data to renderers.
Metadata From Another Source
If texture assignment is specified by other sources in the pipeline, such as by having separate XML files associated
with assets that give the texture paths to be used on any named piece of geometry, that metadata can be added to
objects using AttributeModifiers.
Katana comes with an example Attribute Modifier called AttributeFile that reads data from a simple XML format to
create new attributes at locations in the Scene Graph. One of the demo scenes - houseScene_textured.katana -
makes use of AttributeFile, together with an AttributeScript to read in attribute values then do some additional
processing to turn those attributes into final texture file paths.
In the houseScene_textured example, an AttributeFile_In node brings in an external XML file - houseScene_
textures.xml - which provides two string attributes for each geometry location, channel, and path. For example, the
following excerpt from houseScene_textures.xml specifies that the channel attribute on the scene graph location
doorShape is ColorMap, and the path attribute is door.tx:
<attributeList location="doorShape">
<attribute name="channel" type="string" value="ColorMap"/>
<attribute name="path" type="string" value="door.tx"/>
</attributeList>
The attributes read in through the AttributeFile_In node appear under attributeFile.xxx. Translating these to a
textures.ColMap attribute is performed by an AttributeScript, which reads the value of attributeFile.path at each
target location, and if it is not None, appends that value to the texture path, and writes the attribute
textures.ColMap with the result:
txDir = user.tx_directory
ColMap = GetAttr('attributeFile.path')
if ColMap is not None:
ColMapPath = [txDir[0] + "/" + ColMap[0]]
SetAttr('textures.ColMap', ColMapPath)
17 HANDLING TEXTURES |