carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
10.83k stars 3.48k forks source link

Accessing and Modifying Object Materials via Python API #7892

Open ShaharShaki opened 6 days ago

ShaharShaki commented 6 days ago

Hi,

I’m working on a project in the CARLA simulator, and I’m trying to modify the materials of vehicle components using the Python API. Specifically, I want to increase the reflectivity of the headlights on a car.

Is it possible to access and modify materials of objects like headlights through the Python API? If so, could someone provide guidance or examples on how to achieve this?

Thanks!

gsmario commented 3 days ago

Hello! our lights are only 1 mesh/object with 1 material, so you can't actually modify the material of the headlights, and then the blinkers, because one change will affect all the other lights (since its the same mesh/material). You can, in the other hand, modify the values of lights intensity or color of each light via api, (with light i mean the actual light illuminating the scene, not the mesh/material of the car lights).

If thats the case, just tell me and I'll try to help you with that.