You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to add globals like $MM to datetime.datetime.now().month.strftime("%m") but it turned out to be false when being evaluated, so instead of having the current month number, I would get NO-MM in the file name.
I tried to add import datetime in the python file but it doesn't change anything. Could you consider adding support for date time in presets?
I would suggest token naming be following:
"$YYYY": datetime.datetime.now().strftime("%Y"),
"$YY": datetime.datetime.now().strftime("%y"),
"$MM": datetime.datetime.now().strftime("%m"),
"$DD": datetime.datetime.now().strftime("%d"),
"$hh": datetime.datetime.now().strftime("%H"),
"$mm": datetime.datetime.now().strftime("%M"),
"$ss": datetime.datetime.now().strftime("%S"),
The text was updated successfully, but these errors were encountered:
you just forgot to import the datetime module in the first place, see the provided $TIME expression for reference. In this case you can use e.g. time or datetime modules:
$YYYY: exec("import time") or time.strftime("%Y")
$YYYY: exec("from datetime import datetime") or datetime.now().strftime('%Y')
$MM: exec("import time") or time.strftime("%m")
$MM: exec("from datetime import datetime") or datetime.now().strftime('%m')
...
Both expressions resolve to 2023 and 05 as expected and the actual logic should work for all your other requirements as well. Does this help?
Tried it, and it worked as I expected. I'm pretty new to both python and blender and thank you so much for this detailed answer! Have a great week! 🥇 😄
Hi,
Thanks for making this plugin.
I tried to add globals like $MM to datetime.datetime.now().month.strftime("%m") but it turned out to be false when being evaluated, so instead of having the current month number, I would get NO-MM in the file name.
I tried to add import datetime in the python file but it doesn't change anything. Could you consider adding support for date time in presets?
I would suggest token naming be following:
"$YYYY": datetime.datetime.now().strftime("%Y"),
"$YY": datetime.datetime.now().strftime("%y"),
"$MM": datetime.datetime.now().strftime("%m"),
"$DD": datetime.datetime.now().strftime("%d"),
"$hh": datetime.datetime.now().strftime("%H"),
"$mm": datetime.datetime.now().strftime("%M"),
"$ss": datetime.datetime.now().strftime("%S"),
The text was updated successfully, but these errors were encountered: