list materials

Discussion related to the LuxCore functionality, implementations and API.
Post Reply
User avatar
nigec
Posts: 141
Joined: Mon Mar 11, 2019 8:50 am

list materials

Post by nigec »

how do I get the list of materials in a scene (python)
I can't see it in the docs or examples
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: list materials

Post by Dade »

Something along the line of:

Code: Select all

materialNames = scene.ToProperties().GetAllUniqueNames("scene.materials.")
(just out of my memory so syntax/names may be not totally correct)
Support LuxCoreRender project with salts and bounties
User avatar
nigec
Posts: 141
Joined: Mon Mar 11, 2019 8:50 am

Re: list materials

Post by nigec »

there's no GetAllUniqueNames
materialNames = self.scene.ToProperties().GetAllNames("scene.materials.")
gets everything material related
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: list materials

Post by B.Y.O.B. »

User avatar
nigec
Posts: 141
Joined: Mon Mar 11, 2019 8:50 am

Re: list materials

Post by nigec »

yes mate that's the one :
materialNames = self.scene.ToProperties().GetAllUniqueSubNames("scene.materials")
Post Reply