Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

Maxscript problem - Export name,pos & rot to csv.
show user profile  jpedleham
Hi, I have a script working fine that exports a csv containing the name, pos and rot values of objects in my scene. Im encountering a problem though where the rotation values, unless theyre 90 degree increments, come out incorrect. for example

Box004 has rotation values of

26.625,-38.547,-110.464

but in the script it shows

44.1453,13.0084,106.299

The code is simple.

(
path = getSaveFileName caption:"CHOOSE OUTPUT PATH" filename:"Kitlayout" types:"format text (*.csv)"
file = createFile path

for i=1 to selection.count do
(
print selection[i].name

rn = getUserProp selection[i] "Name"
if rn==undefined then rn=selection[i].name

s=selection[i]
rot = QUATTOEULER s.rotation
zrot = rot.z
xrot = rot.x
yrot = rot.y
format "%,%,%,%,%,%,%\n" rn s.position.x s.position.z s.position.y xrot yrot zrot to:file
)
CLOSE FILE
)

The quat to euler code must be the problem but thats the only way i know how to get the absolute rotation values rather than the 0-1 quat values.

Any ideas?
Thanks

Jack
read 466 times
11/4/2015 10:29:23 AM (last edit: 11/4/2015 10:29:23 AM)
show user profile  jpedleham
i solved this by using

s=selection[i]

zrot = in coordsys gimbal s.rotation.z_rotation
xrot = in coordsys gimbal s.rotation.x_rotation
yrot = in coordsys gimbal s.rotation.y_rotation

instead of the quat to euler section
read 440 times
11/5/2015 4:44:42 PM (last edit: 11/5/2015 4:44:42 PM)
#Maxforums IRC
Open chat window


Support Maxforums.org