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


Featured Threads
  inspiration alert!!!
(36 replies)
  Indespensible MaxScripts, Plugins and 3rd Party Tools
(37 replies)
  The allmighty FREE Resources Thread !
(17 replies)
  spam alert!!!
(4886 replies)
  Maxforums member photo gallery index
(114 replies)
  Maxforums Member Tutorials
(89 replies)
  three cheers to maxforums...
(240 replies)
  101 Things you didnt know in Max...
(198 replies)
  A Face tutorial from MDB101 :D
(95 replies)
  Maxforums.org Members Gallery
(516 replies)
  SON OF POST YOURSELF
(637 replies)
  Dub's Maxscript Tutorial Index
(119 replies)

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 499 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 473 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