get libraries (outside of poser) :
import xml.etree.cElementTree as ElementTree
def PrefsLocation(version):
if version > 10:
return os.path.join(os.environ["APPDATA"], "poser", str(Version()))
else:
return os.path.join(os.environ["APPDATA"], "poser pro", str(Version()))
def get_libraries( xml_file ):
try:
tree = ElementTree.parse(xml_file)
except Exception as inst:
print( "Unexpected error opening %s: %s" % (xml_file, inst) )
return None
libraries = []
if os.path.exists(xml_file):
root=tree.getroot()
for child in root:
if child.tag=='ContentFolder':
libraries.append(str(child.attrib['folder']))
return libraries
def Version(): # edit to suit your needs
return 12
def get_libraries( xml_file ):
try:
tree = ElementTree.parse(xml_file)
except Exception as inst:
print( "Unexpected error opening %s: %s" % (xml_file, inst) )
return None
libraries = []
if os.path.exists(xml_file):
root=tree.getroot()
for child in root:
if child.tag=='ContentFolder':
libraries.append(str(child.attrib['folder']))
return libraries
PrefsLocation = PrefsLocation(Version())
PrefsFile = "LibraryPrefs.xml"
xml_file = os.path.join(PrefsLocation, PrefsFile)
libraries = get_libraries( xml_file)
for library in libraries:
print(library)
Locked Out