assetFitSize function

Syntax

  • string assetFitSize(searchQuery, axisSize, maxScaleError)

Parameters

  1. searchQuerystring
    Search query to apply on list of all files in the workspace. See fileSearch / filesSearch for details about the syntax.
  2. axisSizestring
    { "x" | "y" | "z" | "xy" | "xz" | "yz" | "xyz" }—Axes for the current scope.
  3. maxScaleErrorfloat
    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

Random asset (according to axisSize) which is in the maxScaleError range.

Description

The assetFitSize function returns one of the assets in the maxScaleError range, from the file list specified in searchQuery, according to the specified axisSize string.

Related

Examples

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

In this topic