Make alternate material directory UserAppData/Materials

This commit is contained in:
sgrogan 2015-09-14 08:54:35 -04:00 committed by Yorik van Havre
parent 163d206513
commit 7d771c7a36
2 changed files with 4 additions and 4 deletions

View File

@ -237,10 +237,10 @@ class _ArchMaterialTaskPanel:
def fillMaterialCombo(self): def fillMaterialCombo(self):
"fills the combo with the existing FCMat cards" "fills the combo with the existing FCMat cards"
# look for cards in both resources dir and user folder. # look for cards in both resources dir and a Materials sub-folder in the user folder.
# User cards with same name will override system cards # User cards with same name will override system cards
paths = [FreeCAD.getResourceDir() + os.sep + "Mod" + os.sep + "Material" + os.sep + "StandardMaterial"] paths = [FreeCAD.getResourceDir() + os.sep + "Mod" + os.sep + "Material" + os.sep + "StandardMaterial"]
paths.append(FreeCAD.ConfigGet("UserAppData")) paths.append(FreeCAD.ConfigGet("UserAppData") + os.sep + "Materials")
self.cards = {} self.cards = {}
for p in paths: for p in paths:
for f in os.listdir(p): for f in os.listdir(p):

View File

@ -93,10 +93,10 @@ class MaterialEditor(QtGui.QDialog):
def updateCards(self): def updateCards(self):
"updates the contents of the materials combo with existing material cards" "updates the contents of the materials combo with existing material cards"
# look for cards in both resources dir and user folder. # look for cards in both resources dir and a Materials sub-folder in the user folder.
# User cards with same name will override system cards # User cards with same name will override system cards
paths = [FreeCAD.getResourceDir() + os.sep + "Mod" + os.sep + "Material" + os.sep + "StandardMaterial"] paths = [FreeCAD.getResourceDir() + os.sep + "Mod" + os.sep + "Material" + os.sep + "StandardMaterial"]
paths.append(FreeCAD.ConfigGet("UserAppData")) paths.append(FreeCAD.ConfigGet("UserAppData") + os.sep + "Materials")
self.cards = {} self.cards = {}
for p in paths: for p in paths:
for f in os.listdir(p): for f in os.listdir(p):