I was happily doing op(‘cam1’).worldTransform.invert() in build 1224x, now in 12710 it returns none, same for transpose() and identity().
I saw in the release notes
BACKWARDS COMPATIBILITY ISSUE - To avoid confusion; Matrix/Vector/Position objects no longer return a Matrix/Vector/Position unless it’s a new object, not a reference to themselves.
Not sure what this means and how to get invert() again?
The idea behind the change, and I’m open to discussion on it, was to avoid confusion like this:
m = op('cam1').worldTransform
mInvert = m.invert()
# mInvert is just a reference to m, so they both hold the inverse worldTransform now
I found that looking at this code you may not expect m to also be inverted.
If you are in a script you can just split up your code to 2 lines. Get the worldTransform() and assign it to a variable, then call invert() on that variable. Does that work for you? Or are you doing this in a parameter, where I could see the previous behavior being desired, but maybe I should add a
worldTransformInverse
method.
Ok, got it, sorry I’m a little slow today.
Makes sense, though it adds extra lines of code.
I was doing op(‘…/cam1’).worldTransform.invert()[x,y] to fill a dat table.
Indeed could be nice to have a getInverted() or getTransposed() that returns a inverted/tranposed copy, though I can live without it!
Oh and on a slightly related subject, it would be great to have a dedicated python search on the wiki.
For example if I search for matrix, I get the tscript expression derivative.ca/wiki088/index.php?title=Matrix