import nuke
import datetime
nkfile = nuke.root().name()
ctime = os.stat(nkfile).st_ctime
print str(datetime.datetime.fromtimestamp(ctime))

..which conjoined into a single expression is:

[python str(__import__("datetime").datetime.fromtimestamp(__import__("os").stat(nuke.root().name()).st_ctime))]

On 15/07/16 12:36, bber...@3dmation.com wrote:

Hey folks, I'm trying to automate a write node so it uses the creation
date of the project to write it's frames rather than the regular
computer date.  For simplicity sake, let's just put this code in the
text node, so you can see it displayed on the viewport.

The code I've used for regular date is:

[date %Y]_[date %m]_[date %d]

This works fine for computer time, but when you render over midnight the
date changes.  I'd prefer it to read the date from the nuke files
creation date.  For this, I know you can get the file location of the
project using this:

[value root.name]

I'd like to use this to query the creation date of said file.  I thought
it would be this:

[python (os.path.([value root.name]).ctime]

but that's not correct, any ideas?

Barry

Sent from my HTC on T-Mobile 4G LTE



_______________________________________________
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users


--
ben dickson
2D TD | ben.dick...@rsp.com.au
rising sun pictures | www.rsp.com.au
_______________________________________________
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to