def test_get_distance(run_with_maya_pymel, setup_path):
    from maya import OpenMaya
    import pymel.core as pm
    from mgear.core.vector import get_distance
    v_1 = [0, 0, 0]
    v_2 = [1, 0, 0]
    assert (get_distance(v_1, v_2) == 1.0)
    v_1 = OpenMaya.MVector(0, 0, 0)
    v_2 = OpenMaya.MVector(1, 0, 0)
    assert (get_distance(v_1, v_2) == 1.0)
    pm.newFile(force=True)
    v_1 = pm.createNode('transform')
    v_2 = pm.createNode('transform')
    v_2.translate.set(10, 5, 7)
    distance = pm.createNode('distanceBetween')
    (v_1.worldMatrix >> distance.inMatrix1)
    (v_2.worldMatrix >> distance.inMatrix2)
    distance_value = distance.distance.get()
    assert (get_distance(v_1, v_2) == distance_value)
def test_get_distance(run_with_maya_pymel, setup_path):
    from maya import OpenMaya
    import pymel.core as pm
    from mgear.core.vector import get_distance
    v_1 = [0, 0, 0]
    v_2 = [1, 0, 0]
    assert (get_distance(v_1, v_2) == 1.0)
    v_1 = OpenMaya.MVector(0, 0, 0)
    v_2 = OpenMaya.MVector(1, 0, 0)
    assert (get_distance(v_1, v_2) == 1.0)
    pm.newFile(force=True)
    v_1 = pm.createNode('transform')
    v_2 = pm.createNode('transform')
    v_2.translate.set(10, 5, 7)
    distance = pm.createNode('distanceBetween')
    (v_1.worldMatrix >> distance.inMatrix1)
    (v_2.worldMatrix >> distance.inMatrix2)
    distance_value = distance.distance.get()
    assert (get_distance(v_1, v_2) == distance_value)