[Closed] check time of loading scene
I’m struggle with script that will save all objects in selection one by one as max file with this file name and location(just replaced it selfs) and check – count loading time for each of object. Is it possible to do something like this? Please help.
it should look like this:
sceneName = maxFilePath + “OBJTEST.max”
for o in selection do
(
saveNodes o sceneName – <– It seems this don’t work
—- < here I have to check how much time(in digits) past from moment
—- max start save node till max finish save node so HOW MUCH IT TOOK TO SAVE OBJECT
—- here I need something like if loadtime>n then do ()
)
I also try do do action for specific kind of object for instance, different for geometry, lights etc. I triad like this but don’t work.
for o in selection where geometry do
(
modPanel.addModToSelection (Edit_Poly ()) ui:on
)
I would be appreciate for help.
This code works just fine for me:
sceneName = maxFilePath + "OBJTEST.max"
for o in selection do
(
st = timestamp()
saveNodes o sceneName
et = timestamp()
saveTime = (et-st)
format "% | SaveTime : %
" o.name saveTime
)
saveTime is the number of ms it took to save the file, but that has no correlation with loadtime and shouldn’t be used as an assumption for how long a file may take to load.
For your other issue try:
for o in selection where superclassof o == geometryClass do
(
addmodifier o (Edit_Poly ())
)
modpanel.addmodtoselection won’t work as you want as it applies to the selection (everything in the selection array) and not the current loop item.
Of course this is just one way. I am sure denisT can do it all in one line with some magical function.
-Eric
it’s ‘one line’ already… no reason to optimize it. but i can muddle it up:
m = Edit_Poly()
addmodifier selection m
InstanceMgr.MakeModifiersUnique selection m #individual
Work perfect for me thank you. regarding first script, I’m wondering, is it possible to count not only save time but also opening scene time with this models opening one by one without opening new scene:) So i could check open object(access to object) time in this same way I save objects but without leaving my current max scene. Is it possible at all?