Skip to content

SG-43457 [Part2] Migration of MEDM main logic and resources#138

Merged
carlos-villavicencio-adsk merged 15 commits into
ticket/SG-43456_migration_1from
ticket/SG-43457_migration_2
Jun 10, 2026
Merged

SG-43457 [Part2] Migration of MEDM main logic and resources#138
carlos-villavicencio-adsk merged 15 commits into
ticket/SG-43456_migration_1from
ticket/SG-43457_migration_2

Conversation

@carlos-villavicencio-adsk

@carlos-villavicencio-adsk carlos-villavicencio-adsk commented May 26, 2026

Copy link
Copy Markdown
Contributor

Base branch: #137

Loader core logic

This is where most of the changes were made for displaying information and UI changes.

  • dialog
  • utils
  • delegates (publish list and publish thumb)
  • manager
  • info.yml settings / constants / display info for configurable items
  • Other UI/UX updates.

@carlos-villavicencio-adsk carlos-villavicencio-adsk changed the title SG-43457 Migration of MEDM main logic and resources SG-43457 [Part2] Migration of MEDM main logic and resources May 26, 2026
@codecov

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 9.61538% with 658 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.01%. Comparing base (de8d721) to head (91e4665).

Files with missing lines Patch % Lines
python/tk_multi_loader/dialog.py 4.70% 304 Missing ⚠️
python/tk_multi_loader/ui/dialog.py 0.00% 100 Missing ⚠️
python/tk_multi_loader/utils.py 12.50% 84 Missing ⚠️
python/tk_multi_loader/delegate_publish_list.py 13.55% 51 Missing ⚠️
python/tk_multi_loader/delegate_publish_thumb.py 16.27% 36 Missing ⚠️
python/tk_multi_loader/model_hierarchy.py 3.84% 25 Missing ⚠️
python/tk_multi_loader/__init__.py 19.23% 21 Missing ⚠️
python/tk_multi_loader/model_entity.py 16.66% 10 Missing ⚠️
...ython/tk_multi_loader/ui/widget_publish_history.py 0.00% 6 Missing ⚠️
python/tk_multi_loader/model_latestpublish.py 0.00% 5 Missing ⚠️
... and 5 more
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     
Flag Coverage Δ
Linux 19.01% <9.61%> (+3.61%) ⬆️
Python-3.10 19.01% <9.61%> (+3.61%) ⬆️
Python-3.11 19.01% <9.61%> (+3.61%) ⬆️
Python-3.13 19.01% <9.61%> (+3.61%) ⬆️
Python-3.9 19.01% <9.61%> (+3.61%) ⬆️
Windows 19.01% <9.61%> (+3.61%) ⬆️
macOS 19.01% <9.61%> (+3.61%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chenm1adsk chenm1adsk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The remaining looks good.

Comment thread python/tk_multi_loader/dialog.py
Comment thread python/tk_multi_loader/delegate_publish_list.py Outdated
Comment thread python/tk_multi_loader/delegate_publish_list.py Outdated
Comment thread python/tk_multi_loader/api/manager.py
# { "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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't understand this comment. Let's catch up later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be confirmed.

Comment thread python/tk_multi_loader/model_entity.py Outdated
Comment thread python/tk_multi_loader/model_latestpublish.py
Comment thread python/tk_multi_loader/model_publishhistory.py Outdated
if not PublishHistoryWidget.objectName():
PublishHistoryWidget.setObjectName(u"PublishHistoryWidget")
PublishHistoryWidget.resize(1226, 782)
PublishHistoryWidget.resize(1226, 130)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this change about? How is not going to create a regression?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment for all the UI changes in this PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See FFACE-2452

Comment on lines +16 to +97
# 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",
],
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need all these new things?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See FFACE-2461.

I already discussed this with product and he's ok including this to the upstream.

Comment on lines +11 to +12
from .api import LoaderManager # noqa: F401
from .open_publish_form import open_publish_browser # noqa: F401

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm importing these somewhere else, and it's easier to keep all imports consistent from a single source.

Comment on lines +24 to +45
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be in a dedicated PR with a dedicated Jira ticket.
And also, the code should go in tk-nuke.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@carlos-villavicencio-adsk carlos-villavicencio-adsk force-pushed the ticket/SG-43457_migration_2 branch from a3cd824 to 7b853c6 Compare June 2, 2026 22:29
* 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)
@carlos-villavicencio-adsk carlos-villavicencio-adsk merged commit fd37232 into ticket/SG-43456_migration_1 Jun 10, 2026
9 of 24 checks passed
@carlos-villavicencio-adsk carlos-villavicencio-adsk deleted the ticket/SG-43457_migration_2 branch June 10, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants