---
title: "PxrRandomTextureManifold"
canonical: "https://rmanwiki-25.pixar.com/space/REN25/20416332/PxrRandomTextureManifold"
format: markdown
---
![image](media://29e97a62-3f20-477e-ac46-57ed0331cdae)

PxrRandomTextureManifold with PxrMultiTexture to assign random textures to many objects:

- Randomly assign up to 10 textures to a group of objects.
- Randomize the texture orientations and offsets.
- Assign textures by setting the value of a primitive variable (see [Adding the textureID primvar in Maya](#PxrRandomTextureManifold-textureIDMaya))

> ❌ PxrRandomTextureManifold can only be used with [PxrMultiTexture](https://renderman.atlassian.net/wiki/spaces/REN25/pages/20416316).

### Input Parameters

#### Number of Textures

The number of texture you want to use. You should have at least one texture and PxrMultiTexture supports up to 10 textures.

#### Texture Order

The order in which PxrMultiTexture will assign its textures to the objects.


| **Value** | **Mode** | **Description** |
| --- | --- | --- |
| 0 | **Ordered** | Textures ordered based on the random source. The number will wrap in the 0->numTextures range.<br>When using the textureID PrimVar, the texture index will match the primvar. |
| 1 | **Random** | Textures randomised based on the random source. |


### Tiling

#### Tiling Mode

Select between Regular and Hexagonal tiling modes

#### Frequency

Texture frequency 

#### Blend Width

Exponentiated blending as described by Burley


### <u>Randomize</u>

#### Random Source

For each object to get a different variation, you need to select something unique about them to create a unique seed. You have a choice between the object's id, the object's name and a "textureID" primitive variable.

| **Value** | **Source** | **Depends on** |
| --- | --- | --- |
| `0` | **Object Id** | `Attribute "identifier" "float id"` |
| `1` | **Object Name** | `Attribute "identifier" "string name"` |
| 2 | **textureID PrimVar** | `"constant float textureID" [0]` |

- The first two attributes are created by the software outputting the RIB and depending on your application (Maya, Katana, etc...), one may work better than the other.
- The textureID primitive variable needs to be created on your scene shapes and set to a value between 0 and 9 (PxrMultitexture supports up to 10 textures). If this mode is selected and the primvar does not exist, the pattern will assume a value of 0, i.e. the first texture.

#### Extra Seed

If you want one of these patterns to compute a different variation, set the randomExtraSeed to a non-zero value. This parameter will only influence the randomization parameters (randomOrientation, randomFlipS, etc).

#### Random Orientation

Randomize the orientation of the textures by randomly swapping s and t.

#### Random S Flip

Randomly flip the direction of s.

#### Random T Flip

Randomly flip the direction of t.

#### Random S Offset

Randomly offset s. You should probably avoid this if your textures are not tiling seamlessly.

#### Random T Offset

Randomly offset t. You should probably avoid this if your textures are not tiling seamlessly.


### <u>Manifold 2D</u>

#### Angle

Global rotation angle around the origin of the st domain.

#### Global Scale

Scale the st domain while preserving the aspect ratio defined by scaleS and scaleT.

#### Scale S

Frequency of the feature in S.

#### Scale T

Frequency of the feature in T

#### Offset S

Offset from origin in S.

#### Offset T

Offset from origin in T.

#### invert T

Invert the direction of T.

#### PrimVar S/ST

Name of custom 1D S or 2D ST primvar.

#### PrimVar T

Name of custom 1D T primvar.


## > Macro (anchor)

Adding the textureID primvar in Maya

### Using MEL

Select the objects you want to add the primvar to and run the MEL below.

```
addAttr -at "float" -ln "rmanFtextureID" -k true -dv 0.0 `ls -sl -dag -shapes`;
```

The "`rmanFtextureID"` will appear in the channel box and the attribute editor so you can set its value and will be exported by RFM as the expected "`float textureID"` primvar.