Exemplo n.º 1
0
 def get_uniform_value(self, context_values, uniforms):
     return UniformValue(as_mat4=library_definitions.to_mat4(
         context_values.inverse_projection), )
Exemplo n.º 2
0
 def get_uniform_value(self, context_values, uniforms):
     return UniformValue(as_mat4=library_definitions.to_mat4(
         context_values.view), )
Exemplo n.º 3
0
            except:
                return None

    return UniformControlMatAnnotationDescriptor


UniformControlMat2AnnotationDescriptor = _make_UniformControlMatAnnotationDescriptor(
    2, lambda obj: UniformValue(as_mat2=library_definitions.to_mat2(
        obj.matrix_world) if obj else library_definitions.MAT2_IDENTITY, ))

UniformControlMat3AnnotationDescriptor = _make_UniformControlMatAnnotationDescriptor(
    3, lambda obj: UniformValue(as_mat3=library_definitions.to_mat3(
        obj.matrix_world) if obj else library_definitions.MAT3_IDENTITY, ))

UniformControlMat4AnnotationDescriptor = _make_UniformControlMatAnnotationDescriptor(
    4, lambda obj: UniformValue(as_mat4=library_definitions.to_mat4(
        obj.matrix_world) if obj else library_definitions.MAT4_IDENTITY, ))


def _make_UniformControlVecAnnotationDescriptor(size, get_from_value):
    @dataclass
    class UniformControlVecAnnotationDescriptor(
            UniformControlAnnotationDescriptor):
        def add_property(self):
            try:
                args = self._make_args(
                    default=_transform_eval,
                    description=_transform_id,
                    max=_transform_eval,
                    min=_transform_eval,
                    precision=_transform_eval,
                    step=lambda value: _transform_eval(value) * 100,