tom.drastic.net

random maxscript questions

just some random questions i had when starting with a maxscript exporter…

how do i read animated values ?
for printing an object position at time T, do:

print at time T obj.pos.x

getting information about scene animation

animationrange.end
animationrange.start

what is the current framerate ?
use the global variable “frameRate”

how do i rewind or set the max timeline?
use the global variable sliderTime to set it.

sliderTime =0

how to get vertex normals ?
this way your normals look like you wanted them. (”smoothing groups safe”)

for ve = 1 to mesh.numfaces do
(
    norm=meshop.getFaceRNormals mesh ve
    format "% % %" norm[1].x norm[1].y norm[1].z
    format "% % %" norm[2].x norm[2].y norm[2].z
    format "% % %" norm[3].x norm[3].y norm[3].z
)

what is the color i set at rendering->environment->background color ?
use the global variable “backgroundColor” :)

how to test if an object is animated ?
you can check (boolean) “obj.isanimated”.
i think this works not if vertices of the object are animated. only if position/rotation/etc. are animated..
also this is false if the object is linked to a bone, which is animated!

April 10th, 2008 | maxscript, dev, 3d, 3dsmax |


Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.