Hi,
@zipit said in GetAllTextures from materials only:
Hi,
no, I do not have any external render engines here. But you can filter stuff, you just have to compose ar
of objects you want to include.
my_filter = [obj for obj in doc.GetMaterials()
if obj.CheckType(c4d.Mterrain)]
for _, path in doc.GetAllTextures(ar=my_filter):
print path, "is a texture path in a terrain material."
You can throw everything that is a c4d.C4DAtom into ar. You could try some of the BaseObjects for example that have a texture path.
That's a great example! Thank you!
For external renderer materials: have you confirmed that they are actually included in doc.GetMaterials()?
Yep, I've tried it and can confirm that the materials are included. Following your example:
OCTANE_MAT_ID = 1029501
my_filter = [obj for obj in doc.GetMaterials()
if obj.CheckType(OCTANE_MAT_ID)]
for _, path in doc.GetAllTextures(ar=my_filter):
print path, "is a texture path in an Octane material."
Does not print anything.
Also writing a little script, that extracts all bitmap path attributes from a GeListNode
(i.e. a shader tree) tree is not too hard either. I think someone asked a similar question in combination with Octane just recently.
It may have been me! I do have the script but was curious to understand the GetAllTextures function, which you explained to me really well.
Thanks again!