Multiple objects with same material
Unsolved
Qt for Python
-
I dynamically generate 3D objects with the same material (around 100 objects). Creating a material for each individual object consumes a significant amount of memory. Is there a way to use one "global" material and apply it to all of the objects? When I attempted to create a material object and add it as a component to the objects, the code didn't work as expected (no errors, but the code turned off immediately after being turned on). I'm using PySide6 with Qt3D and Python 3.11.4.
My current material settings for an object:self.lineMaterial = Qt3DExtras.Qt3DExtras.QDiffuseSpecularMaterial() self.lineMaterial.setDiffuse(QtGui.QColor(255, 0, 212)) self.lineMaterial.setAmbient(QtGui.QColor(255,255,255))