There are two ways to change clothes on an avatar during an animation sequence or at runtime:
- By enabling/disabling specific garments. This method is suitable when all the garments are pre-set for the avatar beforehand and can be switched on and off during the simulation/animation.
- By explicitly specifying garment folders. This method allows loading garments dynamically at runtime without setting all the garments beforehand.
See also Changing clothes during animation with uDraper video tutorial.
In order to implement these method, you can use the following functions and variables.
Draper Simulation: Reload - puts changed garment properties into effect. Must be called after changing garment properties. E.g.
Draper Garment: Reset - Modifies the following Garment parameters:
- Folder (Directory Path) - specifies a path to the garment folder.
- Disable (Boolean) - if True, disables the garment.
- No Wrap (Boolean) - if True, disables garment wrapping.
- No Simulate (Boolean) - if True, disables garment simulation.
- Draper Garment: Enable (Boolean) - Enables/Disables Garment.
- Draper Garment: Simulate (Boolean) - Enables/Disables Garment simulation.
- Draper Garment: Order (Integer) - Garment's order in relation to an avatar's body. Garment with Order 0 is the closest to the body.
Draper Garment: Resnap - returns garment to its wrapped position. It may be useful if garment falls or gets teared during animation.
Depending on your scenario, you can combine these functions to achieve a desired result. E.g. this ChangeGarment function sets Enable, Simulate and Order parameters:
This ChangeGarment function combines Reset and Set order functions:
You can use this functionality in your Sequencer by adding corresponding Garments' and Simulation' tracks along with the Events Trigger Tracks and setting these functions in the Directors Blueprint.