access its data. """ numProperties = 0 for prop in propList: #print prop numProperties += 1 #print numProperties """ Finally, we have listAllMaterials(), which, as you might expect, lists all the materials in the library_manager by name. """ allMaterials = library_manager.listAllMaterials() """ As in the previous example, if you want to access the variables, you'll need to traverse the list. """ for mat in allMaterials: pass #print mat print "Checking version number: " version = library_manager.checkVersion(username, password) print "Version: " + str(version) library_manager.updateJSON(username, password) print "\nDone with the demo!"
""" Of course, since this is a list, we need to traverse it in order to access its data. """ numProperties = 0 for prop in propList: #print prop numProperties += 1 #print numProperties """ Finally, we have listAllMaterials(), which, as you might expect, lists all the materials in the library_manager by name. """ allMaterials = library_manager.listAllMaterials() """ As in the previous example, if you want to access the variables, you'll need to traverse the list. """ for mat in allMaterials: pass #print mat print "Checking version number: " version = library_manager.checkVersion(username, password) print "Version: " + str(version) library_manager.updateJSON(username, password) print "\nDone with the demo!"
from MaterialLibraryInterface import LibraryManager import uuid import ctypes import os if __name__ == "__main__": #run only if main #get path to public documents path = ctypes.c_wchar_p(chr(0x00) * 256) FOLDERID_Documents = ctypes.c_char_p(uuid.UUID("ED4824AF-DCE4-45A8-81E2-FC7965083634").bytes_le) ctypes.windll.shell32.SHGetKnownFolderPath(FOLDERID_Documents, 0, None, ctypes.byref(path)) libraryLocation = os.path.join(path.value, "META Documents", "MaterialLibrary", "material_library.json") library_manager = LibraryManager(libraryLocation) matList = library_manager.listAllMaterials() matList.sort() for material in matList: print material
from MaterialLibraryInterface import LibraryManager import uuid import ctypes import os if __name__ == "__main__": #run only if main #get path to public documents path = ctypes.c_wchar_p(chr(0x00) * 256) FOLDERID_Documents = ctypes.c_char_p( uuid.UUID("ED4824AF-DCE4-45A8-81E2-FC7965083634").bytes_le) ctypes.windll.shell32.SHGetKnownFolderPath(FOLDERID_Documents, 0, None, ctypes.byref(path)) libraryLocation = os.path.join(path.value, "META Documents", "MaterialLibrary", "material_library.json") library_manager = LibraryManager(libraryLocation) matList = library_manager.listAllMaterials() matList.sort() for material in matList: print material