-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Backlog/framework loader premiere #555
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
Open
lluisCM
wants to merge
6
commits into
backlog/framework-loader
Choose a base branch
from
backlog/framework-loader-premiere
base: backlog/framework-loader
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
95db3fc
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM 8788d36
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM 905d5ba
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM 26c3ae0
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM ccedb18
add loader changes
lluisCM 1b5f9ee
merge with loader
lluisCM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
66 changes: 66 additions & 0 deletions
66
projects/framework-premiere/extensions/plugins/premiere_image_loader.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# :coding: utf-8 | ||
# :copyright: Copyright (c) 2024 ftrack | ||
import os | ||
|
||
from ftrack_framework_core.plugin import BasePlugin | ||
from ftrack_framework_core.exceptions.plugin import PluginExecutionError | ||
|
||
from ftrack_utils.paths import check_image_sequence | ||
from ftrack_utils.string import str_context | ||
from ftrack_utils.rpc import JavascriptRPC | ||
|
||
|
||
class PremiereImageLoaderPlugin(BasePlugin): | ||
name = 'premiere_image_loader' | ||
|
||
def run(self, store): | ||
''' | ||
Expects the path to image to load in *store*, loads the image in Premiere | ||
through RCP call. | ||
''' | ||
|
||
image_path = store.get('component_path') | ||
if not image_path: | ||
raise PluginExecutionError(f'No image path provided in store!') | ||
|
||
try: | ||
# Get existing RPC connection instance | ||
premiere_connection = JavascriptRPC.instance() | ||
|
||
component = self.session.query( | ||
f"Component where id={store['entity_id']}" | ||
).first() | ||
context_path = ( | ||
f"ftrack/{str_context(component['version']['asset'])}/" | ||
f"v{component['version']['version']:03}" | ||
) | ||
if store.get('is_sequence'): | ||
# Compile members | ||
sequence_metadata = check_image_sequence( | ||
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. Use clique instead |
||
image_path, with_members=True | ||
) | ||
sequence_folder = os.path.dirname(image_path) | ||
load_result = premiere_connection.rpc( | ||
'loadAsset', | ||
[ | ||
sequence_folder.replace('\\', '/'), | ||
context_path, | ||
','.join(sequence_metadata['members']), | ||
], | ||
) | ||
else: | ||
load_result = premiere_connection.rpc( | ||
'loadAsset', | ||
[image_path.replace('\\', '/'), context_path, ''], | ||
) | ||
|
||
if not load_result: | ||
raise PluginExecutionError( | ||
f'Failed to load image in Premiere!' | ||
) | ||
|
||
except Exception as e: | ||
self.logger.exception(e) | ||
raise PluginExecutionError(f'Exception loading the image: {e}') | ||
|
||
store['load_result'] = load_result |
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
30 changes: 30 additions & 0 deletions
30
projects/framework-premiere/extensions/tool-configs/premiere-image-loader.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
type: tool_config | ||
name: premiere-image-loader | ||
config_type: loader | ||
compatible: | ||
entity_types: | ||
- FileComponent | ||
supported_file_extensions: | ||
- ".bmp" | ||
- ".gif" | ||
- ".jpg" | ||
- ".jpeg" | ||
- ".psd" | ||
- ".png" | ||
- ".tiff" | ||
- ".tif" | ||
- ".tga" | ||
|
||
|
||
engine: | ||
- type: plugin | ||
tags: | ||
- context | ||
plugin: resolve_entity_path | ||
ui: show_component | ||
|
||
- type: plugin | ||
tags: | ||
- loader | ||
plugin: premiere_image_loader | ||
|
27 changes: 27 additions & 0 deletions
27
projects/framework-premiere/extensions/tool-configs/premiere-movie-loader.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
type: tool_config | ||
name: premiere-movie-loader | ||
config_type: loader | ||
compatible: | ||
entity_types: | ||
- FileComponent | ||
supported_file_extensions: | ||
- ".avi" | ||
- ".mp4" | ||
- ".m4v" | ||
- ".mov" | ||
- ".mpg" | ||
- ".mpeg" | ||
- ".wmv" | ||
|
||
engine: | ||
- type: plugin | ||
tags: | ||
- context | ||
plugin: resolve_entity_path | ||
ui: show_component | ||
|
||
- type: plugin | ||
tags: | ||
- loader | ||
plugin: premiere_image_loader | ||
|
30 changes: 30 additions & 0 deletions
30
projects/framework-premiere/extensions/tool-configs/premiere-sequence-loader.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
type: tool_config | ||
name: premiere-sequence-loader | ||
config_type: loader | ||
compatible: | ||
entity_types: | ||
- SequenceComponent | ||
supported_file_extensions: | ||
- ".bmp" | ||
- ".gif" | ||
- ".jpg" | ||
- ".jpeg" | ||
- ".psd" | ||
- ".png" | ||
- ".tiff" | ||
- ".tif" | ||
- ".tga" | ||
|
||
|
||
engine: | ||
- type: plugin | ||
tags: | ||
- context | ||
plugin: resolve_entity_path | ||
ui: show_component | ||
|
||
- type: plugin | ||
tags: | ||
- loader | ||
plugin: premiere_image_loader | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "ftrack-framework-premiere" | ||
version = "24.6.0" | ||
version = "24.7.0rc1" | ||
description='ftrack Premiere integration' | ||
authors = ["ftrack Integrations Team <[email protected]>"] | ||
readme = "README.md" | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Use clique instead