Forum: Poser Python Scripting


Subject: What path is used for actor.Load/SaveMaterialCollection(FileName) ?

3dcheapskate opened this issue on Jun 14, 2022 ยท 16 posts


3dcheapskate posted Tue, 14 June 2022 at 2:19 AM

While waiting for somebody who knows the answer I found this in a 9 year old script of mine...

import tempfile


# Get the location for writing temporary files
tempPath = tempfile.gettempdir()

...

# Force texture update! [SC]
currentMat = poser.Scene().CurrentMaterial()
poser.Scene().SelectMaterial(mat)
tempMat = os.path.join(tempPath, "temp.mt5");
try:
mat.SaveMaterialSet(tempMat)
mat.LoadMaterialSet(tempMat)
except:
poser.DialogSimple.MessageBox("SC:Mat update fail!")
if not currentMat is None:
poser.Scene().SelectMaterial(currentMat)
...

So maybe the Poser 9 PoserPython manual got it wrong ?

(note to self: Notepad++ EOL conversion to LF; cut-and-paste here - line-spacing screwed; repaste - line spacing okay; delete first paste)



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).