def shade(self, stroke, attributes={'DIFF', 'SPEC'}):
     it = Interface0DIterator(stroke)
     if not self.use_ramp and self.attribute in attributes:
         for svert in it:
             material = self.func(it)
             a = svert.attribute.color
             b = material.diffuse[0:3] if self.attribute == 'DIFF' else material.specular[0:3]
             svert.attribute.color = self.blend_ramp(a, b)
     else:
         for svert, value in iter_material_value(stroke, self.func, self.attribute):
             a = svert.attribute.color
             b = self.evaluate(value)
             svert.attribute.color = self.blend_ramp(a, b)
Exemplo n.º 2
0
 def shade(self, stroke, attributes={'DIFF', 'SPEC', 'LINE'}):
     it = Interface0DIterator(stroke)
     if not self.use_ramp and self.attribute in attributes:
         for svert in it:
             material = self.func(it)
             if self.attribute == 'LINE':
                 b = material.line[0:3] 
             elif self.attribute == 'DIFF':
                 b = material.diffuse[0:3]
             else:
                 b = material.specular[0:3]
             a = svert.attribute.color
             svert.attribute.color = self.blend_ramp(a, b)
     else:
         for svert, value in iter_material_value(stroke, self.func, self.attribute):
             a = svert.attribute.color
             b = self.evaluate(value)
             svert.attribute.color = self.blend_ramp(a, b)
Exemplo n.º 3
0
 def shade(self, stroke):
     for svert, value in iter_material_value(stroke, self.func, self.attribute):
         b = self.value.min + self.evaluate(value) * self.value.delta
         self.blend_thickness(svert, b)
Exemplo n.º 4
0
 def shade(self, stroke):
     for svert, value in iter_material_value(stroke, self.func, self.attribute):
         a = svert.attribute.alpha
         b = self.evaluate(value)
         svert.attribute.alpha = self.blend(a, b)
Exemplo n.º 5
0
 def shade(self, stroke):
     for svert, value in iter_material_value(stroke, self.func,
                                             self.attribute):
         b = self.value.min + self.evaluate(value) * self.value.delta
         self.blend_thickness(svert, b)
Exemplo n.º 6
0
 def shade(self, stroke):
     for svert, value in iter_material_value(stroke, self.func,
                                             self.attribute):
         a = svert.attribute.alpha
         b = self.evaluate(value)
         svert.attribute.alpha = self.blend(a, b)