Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Issue: rs.XformCompare() returns unexpected value

$
0
0

Hi,

The documentation states rs.XformCompare(xform1, xform2) should return “0 if xform1=xform2”.
When I run the snippet below, I sometimes get return value 0 from when the matrices are not identical (R1). I would expect to either return -1 or 1 in that case

best regards,
Tim

def compareXform():

    for itemA in rs.BlockObjects('block_a'):
        for itemB in rs.BlockObjects('block_b'):

            if rs.IsBlockInstance(itemA) and rs.IsBlockInstance(itemB):
                print 'xform_a', rs.BlockInstanceXform(itemA)
                print 'xform_b', rs.BlockInstanceXform(itemB)
                print rs.XformCompare(rs.BlockInstanceXform(itemA), rs.BlockInstanceXform(itemB))

prints:
> xform_a R0=(1,0,0,46.2819005995964), R1=(0,1,0,156.869812703322), R2=(0,0,1,0), R3=(0,0,0,1)
> xform_b R0=(1,0,0,46.2819005995964), R1=(0,1,0,121.084008261567), R2=(0,0,1,0), R3=(0,0,0,1)
> 0

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles