SG-43457 [Part2] Migration of MEDM main logic and resources#138
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## ticket/SG-43456_migration_1 #138 +/- ##
===============================================================
+ Coverage 15.40% 19.01% +3.61%
===============================================================
Files 42 42
Lines 3577 4091 +514
===============================================================
+ Hits 551 778 +227
- Misses 3026 3313 +287
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| # { "Maya Scene": ["reference", "import"] } | ||
| actions = mappings.get(publish_type, []) | ||
| actions.extend(mappings.get("All", [])) | ||
| # IMPORTANT: Make a copy to avoid modifying the cached config dict |
There was a problem hiding this comment.
I made this change for poc config specifically. Can we confirm if the original behavior is expected or it is a bug? Because this line of change will require user to change their config to list all actions for each publish_type they defined. The action in All will only append when the publish_type is not defined. I am not sure if this is something we want to add to loader.
cc: @julien-lang
There was a problem hiding this comment.
I didn't understand this comment. Let's catch up later.
There was a problem hiding this comment.
To be confirmed.
| if not PublishHistoryWidget.objectName(): | ||
| PublishHistoryWidget.setObjectName(u"PublishHistoryWidget") | ||
| PublishHistoryWidget.resize(1226, 782) | ||
| PublishHistoryWidget.resize(1226, 130) |
There was a problem hiding this comment.
What is this change about? How is not going to create a regression?
There was a problem hiding this comment.
Same comment for all the UI changes in this PR
There was a problem hiding this comment.
See FFACE-2452
| # Fields to query during model initialization for different entity types for detail panel usage | ||
| ENTITY_TYPE_DETAIL_PANEL_FIELDS = { | ||
| "PublishedFile": [ | ||
| "name", | ||
| "description", | ||
| "entity", | ||
| "project", | ||
| "version_number", | ||
| "version", | ||
| "version.Version.sg_status_list", | ||
| "sg_status_list", | ||
| "task", | ||
| "task.Task.content", | ||
| "task.Task.sg_status_list", | ||
| "task.Task.due_date", | ||
| "path", | ||
| "created_by", | ||
| "created_at", | ||
| "image", | ||
| "created_by.HumanUser.image", | ||
| ], | ||
| "Task": [ | ||
| "content", | ||
| "sg_status_list", | ||
| "assigned_to", | ||
| "due_date", | ||
| "entity", | ||
| "project", | ||
| "step", | ||
| ], | ||
| "Asset": [ | ||
| "name", | ||
| "description", | ||
| "sg_status_list", | ||
| "project", | ||
| "created_by", | ||
| "shots", | ||
| ], | ||
| "Shot": [ | ||
| "name", | ||
| "description", | ||
| "sg_status_list", | ||
| "project", | ||
| "created_by", | ||
| "assets", | ||
| "sg_cut_in", | ||
| "sg_cut_out", | ||
| ], | ||
| } | ||
|
|
||
| # Fields to query for different entity types to display in the middle panel | ||
| ENTITY_TYPE_MIDDLE_PANEL_FIELDS = { | ||
| "PublishedFile": [ | ||
| "name", | ||
| "description", | ||
| "entity", | ||
| "project", | ||
| "version_number", | ||
| "version", | ||
| "version.Version.sg_status_list", | ||
| "sg_status_list", | ||
| "task", | ||
| "task.Task.content", | ||
| "task.Task.sg_status_list", | ||
| "task.Task.due_date", | ||
| "path", | ||
| "created_by", | ||
| "created_at", | ||
| "image", | ||
| "created_by.HumanUser.image", | ||
| ], | ||
| "Asset": ["name", "description", "sg_status_list", "created_by"], | ||
| "Shot": [ | ||
| "name", | ||
| "description", | ||
| "sg_status_list", | ||
| "project", | ||
| "sg_sequence", | ||
| "sg_cut_in", | ||
| "sg_cut_out", | ||
| ], | ||
| } |
There was a problem hiding this comment.
Why do we need all these new things?
There was a problem hiding this comment.
This was initially coming from a request from Kevin to make the loader fields configurable.
Maybe we want to revisit this part of the code
There was a problem hiding this comment.
See FFACE-2461.
I already discussed this with product and he's ok including this to the upstream.
| from .api import LoaderManager # noqa: F401 | ||
| from .open_publish_form import open_publish_browser # noqa: F401 |
There was a problem hiding this comment.
I'm importing these somewhere else, and it's easier to keep all imports consistent from a single source.
| def _clear_stay_on_top(win): | ||
| """ | ||
| Clear WindowStaysOnTopHint so the loader doesn't stay on top of other apps or dialogs. | ||
|
|
||
| Nuke-specific bug: Tested across Maya, Houdini, and Nuke - confirmed this only | ||
| affects Nuke. Window flags comparison via hex(int(win.windowFlags())): | ||
| - Nuke: 0x8013003 (includes Qt.WindowStaysOnTopHint) | ||
| - Maya: 0x8003003 (normal flags) | ||
|
|
||
| In Nuke, Qt reports StaysOnTop = False but the window remains on top because | ||
| Qt injects WS_EX_TOPMOST at the OS level without reflecting it in its own flag | ||
| API (https://qt-project.atlassian.net/browse/QTBUG-36181). On Windows we must clear it directly via SetWindowPos. | ||
|
|
||
| The extra flags (SWP_NOMOVE, SWP_NOSIZE, SWP_NOACTIVATE) prevent accidental | ||
| window movement or resizing during the operation. | ||
| """ | ||
| if win is None or not win.isWidgetType(): | ||
| return | ||
|
|
||
| if sys.platform == "win32": | ||
| try: | ||
| import ctypes |
There was a problem hiding this comment.
I think this needs to be in a dedicated PR with a dedicated Jira ticket.
And also, the code should go in tk-nuke.
There was a problem hiding this comment.
We had a dedicated ticket. See FFACE-2832.
Also, this fix doesn't affect Nuke only, as far as I remember. It fixes desktop loader as well (See FFACE-3085).
a3cd824 to
7b853c6
Compare
* Migrate config hooks * Add type annotations * Wrap `get_am_base_obj` into the loader action manager * Wraps constant * SG-43460 [Part4] Build dialogs and template utils (#140) * Migrate `BuildAssetDialog` and `BuildTemplateDialog` classes * Migrate template helpers * Code review feedback * Update setting name * Change MEDM to FlowAM in comments * Replace MEDM in log messages * SG-43626 Fix bug when details panel collapses/expands (#142) * Fix bug when details panel collapses/expands * SG-43627 Fix empty space gap on the details panel (#143)
fd37232
into
ticket/SG-43456_migration_1
Base branch: #137
Loader core logic
This is where most of the changes were made for displaying information and UI changes.