Created
June 10, 2022 08:03
-
-
Save BigRoy/9f5457e88577d6c9c33b1acbba2b4477 to your computer and use it in GitHub Desktop.
OpenPype v3 example queries for recently published versions and representation filepaths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openpype.pipeline import legacy_io | |
import datetime | |
# This is what OpenPype v3 uses for the date it stores on versions (reference) | |
""" | |
def get_formatted_current_time(): | |
return datetime.datetime.now().strftime( | |
"%Y%m%dT%H%M%SZ" | |
) | |
""" | |
date = datetime.datetime.now() - datetime.timedelta(days=1) | |
# Print all latest versions | |
formatted_date = date.strftime("%Y%m%dT%H%M%SZ") | |
for version in legacy_io.find({"type": "version", "data.time": {"$gt": formatted_date}}): | |
print(version) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's getting all representation paths since yesterday: