-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert addon for new ayon core #2
Changes from all commits
2999990
622b51e
3fe8d02
b0b50de
294c4e7
22e5510
d965592
8d8b9b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import logging | ||
|
||
import rv | ||
from openpype.pipeline.context_tools import get_current_project_asset | ||
from ayon_core.pipeline.context_tools import get_current_folder_entity | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
def reset_frame_range(): | ||
""" Set timeline frame range. | ||
""" | ||
asset_doc = get_current_project_asset() | ||
asset_name = asset_doc["name"] | ||
asset_data = asset_doc["data"] | ||
folder_entity = get_current_folder_entity(fields={"path", "attrib"}) | ||
folder_path = folder_entity["path"] | ||
folder_attribs = folder_entity["attrib"] | ||
|
||
frame_start = asset_data.get("frameStart") | ||
frame_end = asset_data.get("frameEnd") | ||
frame_start = folder_attribs.get("frameStart") | ||
frame_end = folder_attribs.get("frameEnd") | ||
|
||
if frame_start is None or frame_end is None: | ||
log.warning("No edit information found for {}".format(asset_name)) | ||
log.warning("No edit information found for {}".format(folder_path)) | ||
Comment on lines
19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I know folder entities in AYON always have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do with task entity PR :) |
||
return | ||
|
||
rv.commands.setFrameStart(frame_start) | ||
|
@@ -28,7 +28,7 @@ def reset_frame_range(): | |
def set_session_fps(): | ||
""" Set session fps. | ||
""" | ||
asset_doc = get_current_project_asset() | ||
asset_data = asset_doc["data"] | ||
fps = float(asset_data.get("fps", 25)) | ||
folder_entity = get_current_folder_entity(fields={"attrib"}) | ||
|
||
fps = float(folder_entity["attrib"].get("fps", 25)) | ||
rv.commands.setFPS(fps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since AYON core refactoring many other DCCs swapped this out with using the attributes from the Task Entity instead. Should this as well?
get_current_task_entity
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted, but then I was like: That should be different PR, it can be in changelog.