blenderproc.python.modules.provider.sampler.Value module

class blenderproc.python.modules.provider.sampler.Value.Value(config)[source]

Bases: blenderproc.python.modules.main.Provider.Provider

Sampling 1-d value of bool, int, or float type.

Example 1: Sample a float value from [10, 30) range.

{
  "provider": "sampler.Value",
  "type": "float",
  "min": 10,
  "max": 30
}

Example 2: Sample a boolean value.

{
  "provider": "sampler.Value",
  "type": "bool"
}

Example 3: Sample a float value from a normal (Gaussian) distribution.

{
  "provider": "sampler.Value",
  "type": "float",
  "mode": "normal",
  "mean": 0.0,
  "std_dev": 0.7
}

Configuration:

Parameter Description Type
type The type of a value to sample. Available: ‘float’, ‘int’, ‘boolean’. string
mode The way of how to sample values. Default: ‘uniform’. Available: ‘uniform’, ‘normal’. string
min The minimum value. Optional. float/int
max The maximum value (excluded frm the defined range of values). float/int
mean Mean (“centre”) of the normal (Gaussian) distribution. float
std_dev Standard deviation (spread or “width”) of the normal (Gaussian) distribution. float
run()[source]
Returns:Sampled value. Type: mathutils.Vector