Пример #1
0
 def __init__(self, thickness_position, thickness_ratio,
              blend, influence, mapping, invert, curve, material_attribute, value_min, value_max):
     ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
     CurveMappingModifier.__init__(self, blend, influence, mapping, invert, curve)
     self.attribute = material_attribute
     self.value = BoundedProperty(value_min, value_max, value_max - value_min)
     self.func = CurveMaterialF0D()
Пример #2
0
 def shade(self, stroke, func=GetShapeF1D(), curvemat=CurveMaterialF0D()):
     shape = func(stroke)[0].id.first
     item = self.shape_map.get(shape)
     if len(stroke) > 2:
         if item is not None:
             item[0].append(stroke)
         else:
             # the shape is not yet present, let's create it.
             material = curvemat(Interface0DIterator(stroke))
             *color, alpha = material.diffuse
             self.shape_map[shape] = ([stroke], color, alpha)
     # make the strokes of the second drawing invisible
     for v in stroke:
         v.attribute.visible = False
Пример #3
0
def diffuse_from_stroke(stroke, curvemat=CurveMaterialF0D()):
    material = curvemat(Interface0DIterator(stroke))
    return material.diffuse
Пример #4
0
 def __init__(self, blend, influence, mapping, invert, curve,
              material_attribute):
     CurveMappingModifier.__init__(self, blend, influence, mapping, invert,
                                   curve)
     self.attribute = material_attribute
     self.func = CurveMaterialF0D()
Пример #5
0
 def __init__(self, blend, influence, ramp, material_attribute, use_ramp):
     ColorRampModifier.__init__(self, blend, influence, ramp)
     self.attribute = material_attribute
     self.use_ramp = use_ramp
     self.func = CurveMaterialF0D()