Esempio n. 1
0
def scale_anim(target_obj, target_prop, 
    source_output_array, source_in_tangent_array, source_out_tangent_array, 
    up_axis, meter_scale):
    up_axis_in = axis_to_int[target_prop]
    array_output, out_axis = transform.transform_array( \
        source_output_array, up_axis_in, up_axis, 1)
    array_tangent_in, _ = transform.transform_array( \
        source_in_tangent_array, up_axis_in, up_axis, 1)
    array_tangent_out, _ = transform.transform_array( \
        source_out_tangent_array, up_axis_in, up_axis, 1)
    anim_prop = AnimProp.get_scale(out_axis)
    return anim_prop, AnimProp.data_type[anim_prop], array_output, array_tangent_in, array_tangent_out
Esempio n. 2
0
def rotate_anim(axis, target_prop, 
    source_output_array, source_in_tangent_array, source_out_tangent_array, 
    up_axis):
    if target_prop == 'ANGLE':
        rad_scale = math.pi / 180
        array_output, out_axis = transform.transform_array( \
            source_output_array, axis, up_axis, rad_scale)
        array_tangent_in, _ = transform.transform_array( \
            source_in_tangent_array, axis, up_axis, rad_scale)
        array_tangent_out, _ = transform.transform_array( \
            source_out_tangent_array, axis, up_axis, rad_scale)
        anim_prop = AnimProp.get_rotate(out_axis)
        return anim_prop, AnimProp.data_type[anim_prop], array_output, array_tangent_in, array_tangent_out
    else:
        logger.warning('Unsupported rotation (%s) for property "%s"' % (str(target_obj.vector), target))
        return None, None, [], [], [] # TODO