If you're wondering how to add a clothing item from code there's a list of all available items somewhere on the person atom and each has an enabled flag.Is it possible for a button to select a clothing item for a person without using a preset? Like how you'd assign a regular UIButton to select a clothing item for a Person atoms Geometry. I've been trying to figure out how to do that via code, and wondering if you'd done in this plugin
Here's the code to undress everything. If you want to add a specific item just search for the param name and set it to true.
Code:
var storables = atom.GetStorableIDs()
.Select(id => atom.GetStorableByID(id))
.Where(storable => storable.storeId == "geometry");
foreach (var storable in storables)
{
var paramNames = storable.GetBoolParamNames().Where(n => n.Substring(0, 9) == "clothing:");
foreach (var paramName in paramNames)
{
storable.GetBoolJSONParam(paramName)?.val = false;
}
}