Scalar Volume From File component icon

Scalar Volume From File

Nickname ScalarVolFromFileMorphe › 3. Scalar Volume › CreateOutputs Scalar Volume Text

Reads the grids of an OpenVDB file as scalar volumes, with the voxel size and the position that the file holds. A remark names each grid that gives no volume, such as a grid of vectors.

How it works

The component reads every grid of the file. A grid of 32-bit or 64-bit floats gives a scalar volume with the voxel size, the position and the band of the grid, in the order the file holds the grids, and Names gives the name of each grid. A grid of any other type, such as a velocity grid of vectors, gives no volume, and neither does a grid with a frustum transform, which widens away from a camera. A remark names each grid that gives no volume.

Inputs

NameNickTypeDefaultDescription
File PathFTextFull path of the .vdb file to read.
ScaleSCNumber1Factor applied to every length read from the file: voxel positions and sizes, and the distance values of level sets. 1000 reads a file in metres into a model drawn in millimetres.
WatchWBooleanFalseReads the file again after each change on disk while true: a save, a replacement or a deletion. The component reads once the file has stayed unchanged for a second.

Outputs

NameNickTypeDescription
Scalar VolumeSScalar VolumelistThe scalar volumes that the grids of the file give, in the order the file holds the grids.
NamesNTextlistThe name of the grid of each scalar volume.

Watching the file

Set Watch to true to read the file again each time it changes on disk, for example while a simulation writes it. The component reads once the file has stayed unchanged for a second, so a save in several writes gives one read. A simulation that writes numbered frames writes a new file for each frame, and the component reads none of the later frames.

Tips

  • Set Scale to 1000 to read a file in metres into a model drawn in millimetres.
  • Morphé treats every scalar volume as a level set, including the density grid of a fog volume. Distance operations such as Offset give no meaningful result on such a volume.
  • Pick one volume with List Item, or find the position of a grid name with Member Index on the Names output.

Messages

What the component may report, shown as a balloon on the canvas.

LevelMessage
ErrorScale must be a positive number.
WarningNo grid of the file gives a scalar volume.
Written for Morphé 1.0 · Rhino 8