Created
February 10, 2011 15:50
-
-
Save mbr/820745 to your computer and use it in GitHub Desktop.
weird behavior with findMaterial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding=utf8 | |
# for output, see https://gist.github.com/820741 | |
import direct.directbase.DirectStart | |
from panda3d.core import MaterialCollection | |
model = loader.loadModel('testmodel.egg') | |
find_terms = ('playerColorA', 'playerColorB', 'nonsense', '') | |
print "all materials" | |
print model.findAllMaterials() | |
for t in find_terms: | |
print "model.findMaterial('%s')" % t | |
print model.findMaterial(t) | |
col = MaterialCollection(model.findAllMaterials()) | |
for t in find_terms: | |
print "col.findMaterial('%s')" % t | |
print col.findMaterial(t) | |
run() | |
# for output, see https://gist.github.com/820741 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
output of script at https://gist.github.com/820741