Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Multiple objects with same material
Forum Update on Monday, May 27th 2025

Multiple objects with same material

Scheduled Pinned Locked Moved Unsolved Qt for Python
1 Posts 1 Posters 158 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Technowsky
    wrote on last edited by
    #1

    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))
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved