I'm trying to align one object too another at a time which is different from the current time. So I can't use the xform command as I normally would.
Current I'm using the getAttr command with -t flag and doing pointMatrixMult of the translate point and the parentMatrix. Which is returning the worldspace point.
How can I get the world space rotation? I'm thinking that I might need to convert it to a vector....
OR is there some way that I can just apply the worldMatrix..(I tried using setAttr, but to no avail)??
????
(also I have to use mel... so no api solutions please)
darn! I had to read this 3 times ok you want to get an objects ws rotation at a specific time without changing the time. right?
hmm... you could make a proc that looks for the nodes that lead to the root and take every rotation via getAttr -t and then calculate the final rotation.. I don't know if this works .. but as xform doesn't work in time..
Yes well actualy, i was going to tell you a trick regarding this.
set the global timenodes time to whatever you want using setAttr (its important not to uise currentTime), then inside the same proc querry it with xform and then setAttr the current time back to what it was. Its important that you do this all in one script run so no pausing in between or maya will update the viewport. BUT if you do this in one go maya will not, and thius only refreshes the atributes you ask (to this end it gets calculated 2 times unless you turn cache o but ususaly ist not SO expensive). This would work reasonably well even inside a expression but itd be slow.
(if fact if you ever want to querry or bake stuff over time DONT use currentTime because you get mcuh faster interacion without it)
you can notice the time slider glitching every now and then if you bash away on the shelf button The glitch is more frequent if you call the proc multiple times within the same script...
Well if you want to be realy proper ask for the attrinute after you set time back and mark the time fresh and with some luck (more or less not) yyoull be in time to avoid the refresh.