NEW What's New in Python API V1 and V2

Find what was added and changed in the VRED Python API v2 for each release.

learnMore icon For information on the Python Sandbox and other security information, see Software Security.

What's New in API v2 2024.2

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

Python Version

The Python version was updated to 3.11.6.

Important:

Since the library responsible for automatically updating Python 2 scripts to Python 3 has been deprecated as of Python 3.11, we recommend you update these scripts to Python 3 to avoid any future problems.

Qt Version

Qt has been updated to 6.2.10.

New Environment Variables

These are the new environment variables in 2024.2:

  • VRED_CLUSTERSERVICE_CONFIG
  • VRED_CLUSTERSERVICE_DISABLE_ALL
  • VRED_CLUSTERSERVICE_ENABLE_ALL

Removed Environment Variables

We removed the environment variable, STARVR_SDK.

API

This is a summary of the new functions, classes, and types.

Python API V1 Changes

These are the Python API V1 changes found in 2024.2:

  • vrMovieExport - added the parameters background_pass and volume_pass to setCombinedChannelsRenderPasses, and added the following functions:

    • getDepthMode
    • getDepthRange
    • setDepthMode
    • setDepthRange
    • setOcclusionRange
    • getOcclusionRange
  • vrOSGWidget - added the following functions:

    • setActiveRenderPass - added VOLUME_COLOR_LAYER parameters
    • setDisplayMode - removed VR_DISPLAY_VRHERO_XTAL
  • vrRenderSettings - changed the following functions:

    • setDenoiseAlpha - changed the parameter to denoiseAlpha
    • setRenderPasses - added volume_color to the list of passes

Python API V2 Changes

These are the Python API V2 changes found in 2024.2:

  • vrCADFileTypes - made the following changes:

    • Maya was removed
    • SLP was added
  • vrdAtfSettings - renamed Jt Open (Experimental) to Jt Open for getJtToolkit

  • vrdBaseLightNode - added the following:

    • getVolumeIlluminationMode
    • setVolumeIlluminationMode
  • vrdDeviceInteraction- made changes to the documentation for the following classes:

    • addSupportedInteractionGroup
    • createControllerAction
    • getControllerAction
    • removeControllerAction
    • removeSupportedInteractionGroup
    • setControllerActionMapping (including the mapping parameter that changed)
    • setSupportedInteractionGroups
  • vrDeviceService - made changes to the documentation for the following classes:

    • addBlockedDeviceModelOrSerial
    • createInteraction
    • getBlockedDeviceModelsOrSerials
    • getLeftTrackedHand
    • getRightTrackedHand
    • getVRDeviceBySerialNumber
    • isBlockedDeviceModelOrSerial
    • removeBlockedDeviceModelOrSerial
    • setBlockedDeviceModelsOrSerials
    • setTrackingOrigin
    • deviceCollisionStarted
    • deviceCollisionStopped
    • deviceMoved
  • vrdFileExportSettings - added documentation to all SurfaceExportMode enum entries

  • Renamed the parameter value to enable, with any exceptions noted below, for the following functions:

    • setExportAnimationClips
    • setExportAnimationCurves
    • setExportAnnotations
    • setExportCameras
    • setExportColors
    • setExportEnvironmentGeometries
    • setExportGeometrySwitches
    • setExportInvisibleData
    • setExportLightmaps
    • setExportLights
    • setExportMaterialSwitches
    • setExportMeshes
    • setExportMetadata
    • setExportSceneplates
    • setExportScripts
    • setExportSurfaces - renamed the value parameter to mode
    • setExportTouchSensors
    • setExportTransformVariants
    • setExportVariants
    • setExportVariantSets
    • setExportVertexColors
    • setFbxFormat - renamed the value parameter to format
    • setFbxVersionId - renamed the value parameter to id
    • setInlineTextures
    • setKeepEmptyGeometryNodes - renamed the value parameter to keep
    • setKeepEmptyGroupNodes - renamed the value parameter to keep
    • setKeepEmptyMaterialGroupNodes - renamed the value parameter to keep
    • setKeepEmptyShellNodes - renamed the value parameter to keep
    • setKeepUnusedMaterials - renamed the value parameter to keep
    • setRemoveBSides
    • setStlFormat
  • vrdVertexBakeSettings - updated the setIntensityThreshold function documentation.

  • vrdVRDevice - made changes to the note, regarding the OpenXR mode, for the following:

    • addVirtualButton
    • disableRay
    • enableRay
    • getSerialNumber
    • getWristOrientationAngle
    • pick
    • removeVirtualButton - for both overloaded methods
    • setButtonPressed
    • setButtonTouched
    • setTrackingMatrix
    • signal
    • vibrate
  • vrFileIOService - removed the following signals:

    • addedGeometry

    • addLoadedMaterial

    • preExportGeometry

    • changed the spelling of 'cad' to 'CAD' and 'vred'to 'VRED'

    • added documentation for project

    • updated the documentation for the following functions:

      • checkCadType
      • getImageReadFilter
      • getImageReadFilter
      • importFiles
  • vrGPUService - added gpuStateInfo

  • vrGUIService - added the OpenVDB value to the DialogType enum

  • vrHMDService - removed the following functions:

    • getStarVRRenderSettings
    • setStarVRRenderSettings
  • vrImmersiveInteractionService - changed the setViewpointMode documentation

  • vrLightTypes - added the enum VolumeIlluminationMode

  • vrMaterialTypes - added the following values in MaterialType:

    • VolumeScatter
    • OpenVDBVolume

Removed

We removed support for vrdStarVRRenderSettings.

What's New in API v2 2024.1

Python for Exporting Nodes

We added new methods for exporting nodes. Look at vrFileIoService, vrdFileExportSettings, and vrdFileExportSettings::SurfaceExportMode. Some basic examples have been added to vrFileIOService showing how to import and export files, as well as how to change these settings. See vrdFileExportSettings and vrdFileExportSettings Example for additional information.

Environment Variable Updates

We fixed the following:

  • VRED_COLLABORATION_NO_UPLOAD - fixed ("uupload")
  • VRED_CURRENT_PROJECT_DIR - removed the extra space before '_DIR"

We added the following:

  • VRED_IMPORT_PERFORMANCE_LOG
  • VRED_SECURE_PYTHON
  • VRED_WORKSPACES_PATH

API V1 Updates

We added the following to vrCollision:

  • getCollidingNodes
  • getCollidingTriangleIndices
  • getCollidingTriangles
  • getCollisionInfo
  • getCollisionPoint

API V2 Updates

We added the following classes:

We changed these classes:

  • Changes to vrCADFileTypes:

    • CatiaV5 - Updated the comment to refer to V5
    • C3MF
    • IFC
    • SLP
  • Changes to vrdAtfSettings:

    • getImportColors()
    • setImportColors()
  • Changes to vrdMaterialXProperties:

    • The code example in the class description was updated (PySide2 -> PySide6)
  • Changes to vrdMDLProperties:

    • The code example in the class description was updated (PySide2 -> PySide6)
  • Changes to vrFileIOService:

    • We added the following:
    • abortJobs()

    • exportNodes()

    • getExportSettings()

    • getExportSettingsFromPreferences()

    • setExportSettings()

      • We removed the following signals:
    • addedGeometry

    • addLoadedMaterial

    • importedFile

    • preExportGeometry

    • sequences

  • Changes to vrGUIService:

    • openExportDialog()
    • openExportSceneDialog()
  • Changes to vrLightService:

    • copyLights()
    • getLightsClipboard()
    • isLightsClipboardEmpty()
    • pasteLights()
  • Changes to vrMaterialTypes:

    • MergeOptions
    • For Default, the documentation changed
    • For IgnoreName, the documentation changed
    • For IncludeSwitchMaterials, the documentation changed
    • Added ExcludeXRiteMaterials
  • Changes to vrQueryService:

    • The class documentation was updated and a code example was added

What's New in 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

These are the new functions and classes:

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.