PDA

View Full Version : Object creation time/date


Mr-JosE
03-18-2009, 11:17 AM
Hi,

Is it possible to findout when an object 3ds max was created? Is the time/date stored anywhere within the scene or the object itself?

ZeBoxx2
03-18-2009, 12:37 PM
nope - no such data is stored. At best you can find out if an object was created earlier or later than another object (by checking its handle).. but even that would be iffy, I think.

If you want to tag objects yourself for such purposes, try...

callbacks.addScript #nodeCreated "
-- nodetagger - tags newly-created nodes with computer name, user name and timestamp
obj = (callbacks.notificationparam())[1]
setAppData obj 520 sysinfo.computername
setAppData obj 521 sysinfo.username
setAppData obj 522 (getLocalTime() as string)
" id:#nodeTagger

That sets up a callback that adds the information to an object. I'm using AppData here, you could easily use the user properties buffer or a custom attribute block instead.
Place a file with this code in the 'startup' folder of any machines that you'd want to use this code.
You can make the callback persistent (saves with the scene file and gets run when the scene file is loaded) to make have it continue to work on new machines that wouldn't have the script.

Once the callback is loaded, it should work automatically from there:

newObj = Sphere()
$Sphere:Sphere02 @ [0.000000,0.000000,0.000000]
getAppData newObj 520
"ZB-COMPUTER"
getAppData newObj 521
"Richard Annema"
getAppData newObj 522
"#(2009, 3, 3, 18, 12, 35, 17, 192)"

Mr-JosE
03-18-2009, 01:29 PM
Thanks. I will keep this in mind.

CGTalk Moderation
03-18-2009, 01:29 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.