assetFitSize function

string assetFitSize(searchQuery, axisSize, maxScaleError)

searchQuery string Search query to apply on list of all files in the workspace. See fileSearch / filesSearch for details about the syntax.

axisSize string

"x", "y", "z", "xy", "xz", "yz", "xyz" Axes for the currect scope.

maxScaleError float Float value to control file selection. If it is 0 all files are allowed. If the value is > 0, only a subset of files is allowed: 0.1 means that maximum +-10% scaling is allowed.

Returns a random asset (according to axisSize) which is in the maxScaleError range.

This function returns one of the assets in the maxScaleError range, from the files specified by searchQuery, according to the specified axisSize string.

Related

Examples

assetFitSize("assets/*.obj", "xz", 0.2)
# result = "assets/chosenAsset.obj"