ScriptSpot

Forum topic · General Scripting

print rotation coords in quaternions

By dizzy · 2010-10-19

Description

Hi. extremely new to this. bit stuck and cant seem to find the info Im looking for anywhere or Im misunderstanding something?

How do I go about printing the rotation coords (in quaternions) for selected objects in the scene in this format RotX, RotY, RotZ, RotW to the listner?

Comments (6)

Graph · 2010-10-20

its 2 mouseclicks and 1 f1 click away so i dont know where the problem is in finding the solution
simply select a function or word you like to research like "quat" and hit F1


for o in selection do 
(
 local tmR = o.transform.rotationPart
 print o.name
 format "% % % %\n" tmR.x tmR.y tmR.z tmR.w
)

and dun worry it didnt read like it otherwise id have you wait a week for the full answer; my way of dealing with someOnes hissyFit ;)

dizzy · 2010-10-20

Thank you for all your help :)

Graph · 2010-10-19

take a look into the maxScript help, its actually usefull ;)

dizzy · 2010-10-20

:P Dont think I dont read it, I have honestly spent more time reading that thing in the last three weeks than doing anything else other than getting errors from max from running my attempts. I just seem to be finding it quite difficult atm

But fair enough I see how it might look (like Im after you doing my work for me) and I should work this stuff out myself or how will I learn. probably was a bit quick to ask for more help on this anyway.

Thanks again for the help you did give though and I dont mean any of this in a rude way in case it reads that way.

dizzy · 2010-10-19

Thanks for your help but how do I get it to print without the brackets and quat? I need to use it amongst other data from objects and for multiple objects

Graph · 2010-10-19

$.transform.rotationpart

format "% \n" $.transform.rotationpart