Change existing material¶
material.py¶
1# © 2024 Autodesk, Inc. All rights reserved.
2
3# This example shows how to alter the diffuse and glossy color of a material with API v2.
4print("Executing material script!")
5
6# load a new scene
7examplesDir = vrFileIOService.getVREDExamplesDir()
8vrFileIOService.loadFile(examplesDir + "/geo/teddy.osb")
9
10# find the material we want to change and edit its colors
11furMaterial = vrMaterialService.findMaterials("fur_white")[0]
12furMaterial.setDiffuseColor(QVector3D(0.3, 0.2, 0.5))
13furMaterial.setGlossyColor(QVector3D(0.2, 0.1, 0.8))