Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
There is no method by that identifier - manual is wrong.
The method is simply called Material.
mat = act.Material("Helmet")
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
I never noticed this because I looked at the section heading, not the example.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Thanks both - even though I noticed that the manual heading was different from the function name I'd never thought to just try 'act.Material("Helmet")'
The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.
*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
# Pre-check to verify that 'act' is a valid actor and 'Helmet' is a valid material
matlist = act.Materials()
for mat in matlist:
print "mat.Name() = "+mat.Name()
print "matlist[3].Name() = "+matlist[3].Name()
# So what's wrong with the following line?
mat = act.FindMaterialByName("Helmet")
mat.Name() = Preview
mat.Name() = ChinStrap
mat.Name() = Flaps
mat.Name() = Helmet
mat.Name() = Decoration
matlist[3].Name() = Helmet
Traceback (most recent call last):
File "E:e frontierPoser 6RuntimePythonposerScripts3DCheapskate!TEST Helmet Smart+.py", line 240, in
mat = act.FindMaterialByName("Helmet") # TEMPORARY - use head mat for A3
AttributeError: 'Actor' object has no attribute 'FindMaterialByName'
** ???**
I remember somebody commenting a long time ago that the PoserPython Methods Manuals were unreliable. Is that the problem here?
(P.S. I've double and triple-checked that I typed FindMaterialByName correctly, even tried cut-and-pasting from the manuals. Both of them!)
The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.
*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).