Something like this?
xsi = Application
matLibs = xsi.ActiveProject.ActiveScene.MaterialLibraries
# As a Python list:
allMaterials = [mat for lib in matLibs for mat in lib.Items]
# As an XSICollection:
allMaterials = XSIFactory.CreateObject('XSI.Collection')for lib in matLibs:
allMaterials.AddItems(lib.Items)
# Either way, just select afterwards:
xsi.SelectObj(materials)
On Sun, Nov 10, 2013 at 1:44 AM, Ognjen Vukovic <[email protected]> wrote:
> Hi guys,
> What would be the best way in python to select all the materials in a
> scene,
> I have this ..
>
> matSelection = Application.SelectObj("Sources.Materials.*.*")
> Selection = Application.Selection
>
> But it just seems a bit hacky, and im sure there is a better method of
> doing this.
>
> Cheers,
> Ogi.
>