API v2 2024

This page shows what was added to and changed in the Python API v2 in VRED 2024, compared to 2023.4.

Python version

The Python version was updated to 3.11.3.

VRED’s Python version can be printed from within VRED with:

print(sys.version)

Qt version

The Qt version was updated from Qt 5 to 6.2.

This includes that the PySide module name changes from PySide2 to PySide6, and shiboken2 to shiboken6.

Note

When option “Preferences > Script > Translate script to current Python version” is enabled, the names PySide2 and shiboken2 are automatically replaced by PySide6 and shiboken6 on the fly before executing Python scripts in VRED.

Porting Applications from PySide2 to PySide6

VRED’s Qt version can be printed from within VRED with:

print(PySide6.QtCore.qVersion())

API

New material roughness

In VRED 2024 the material roughness is changed to a perceptually linear behavior and a new value range between 0 and 1. In older VRED versions the behavior was non linear and the maximum value was 40.

When importing older files into VRED, material roughness values are automatically adjusted to the new behavior.

In case you set specific roughness values explicitly via script, for example with vrdPlasticmaterial.setRoughness(roughness), you must adjust the value in the script.

See this snippet for the conversion: snippets/convertRoughness.py