...
コード ブロック | ||
---|---|---|
| ||
import Atoms
import Atoms.ui.constants
from Atoms.singletons import get_atoms_variation_filters_singleton
import random
class VariationFilter:
def filter(self, variations, atomsNode, origin_data):
atv = variations.getAgentTypeVariation("atomsRobot")
if atv:
for mat in atv.getMaterialNames():
material = atv.getMaterial(mat)
if material:
material.setDiffuseColorBlue(random.randint(0,255))
material.setDiffuseColorGreen(random.randint(0,255))
material.setDiffuseColorRed(random.randint(0,255))
#print variations.toString(True)
print "My variation filter"
return variations
filters = get_atoms_variation_filters_singleton()
filters.append(VariationFilter())
|
...