[Closed] exportFile with "at time" not working
(repost due to wrong forum)
hi everone,
when exporting scene geometry one snapshot per frame using the exportFile function
i noticed that the “at time” value fails to really step through the timeline internally, saving a new snapshot every frame. it just writes the same snapshot (of the currently active frame) over and over again.
with sliderTime, it works correct but slower because of scene redraw (which i know i could suppress, but i would prefer the “at time” silent method)
is the exportFile function somehow connected to the timeslider in a way that “at time” cannot mimic?
any workarounds?
the code is basically this:
suppose the timeslider is at frame 10 but the snapshot should be exported at frame 0
(i use a looped version of this to walk through all the frames, but even the simple version does not work)
file=getSaveFileName()
at time 0 exportFile file —-writes the object as it looks in frame 10
what works is;
sliderTime=0: exportFile file —-writes the object as it looks in frame 0
i use this to export obj files
thanks
When you say “snapshot”, are you ACTUALLY performing a snapshot via MAXScript?
For example by using snapshotAsMesh()? Note that the exportFile allows you to export the selected objects, so you could create a snapshot of the mesh you want and export only it.
Otherwise, advancing the time slider is your only solution because the mesh has to be evaluated on the respective frame to be exported correctly. exportFile() does not respect at time() context. Also, in some cases you HAVE to advance the time slider to create a snapshot, for example when getting the mesh or particle positions from Particle Flow.
So, some more info on what you are actually doing in your code would be useful…
hey bobo
that already answered my question since in fact i am not really snapshotting.
when i use the slidertime max exports the obj at that frame like a snapshot because, as you clarified, it evaluates the mesh before writing the file.
unlike ‘at time’. i didn’t know this.
so slidertime, it is
thanks for you help