Skip to content

Conversation

@BigRoy
Copy link
Contributor

@BigRoy BigRoy commented Dec 11, 2025

Changelog Description

Extract Layout: Code restructure for readability and using actual containers as detected by integration

Additional review information

Still draft

Fix #121

Testing notes:

  1. Extract Layout should work
  2. The content should be loaded correctly.

@BigRoy BigRoy self-assigned this Dec 11, 2025
@BigRoy BigRoy added the type: enhancement Improvement of existing functionality or minor addition label Dec 11, 2025
@BigRoy BigRoy requested review from antirotor and moonyuet December 12, 2025 08:34
@BigRoy
Copy link
Contributor Author

BigRoy commented Dec 12, 2025

@antirotor @moonyuet can you let me know what you think of these code changes to clean this up? This also fixes #121 (although purely that fix would've been smaller) but a lot of the code was quite unclear what it tried to do.

This PR does remove the usage of the groupLoadedAssets toggle since I couldn't really figure out what it did. It felt like it was solely used to detect containers in a group? But was that because there were the default parent asset groups above them from loading AYON references? Or was there a particular use case there @moonyuet ?

@moonyuet
Copy link
Member

@antirotor @moonyuet can you let me know what you think of these code changes to clean this up? This also fixes #121 (although purely that fix would've been smaller) but a lot of the code was quite unclear what it tried to do.

This PR does remove the usage of the groupLoadedAssets toggle since I couldn't really figure out what it did. It felt like it was solely used to detect containers in a group? But was that because there were the default parent asset groups above them from loading AYON references? Or was there a particular use case there @moonyuet ?

@antirotor would know a bit more about the use case. I usually turn this off and publish.

@moonyuet
Copy link
Member

I tested with publishing layout with this PR, it is successful but.
https://github.com/user-attachments/assets/703cdaaa-e64a-4e02-ad59-b4050e92d791

It might be helpful if you can take a look at the data below
the v006 layout is published from layout extractor in the develop branch
il_lib_layoutWorkfileArt_v006.json

the latest version is published from layout extractor in this branch
il_lib_layoutWorkfileArt_v008.json

@BigRoy
Copy link
Contributor Author

BigRoy commented Dec 15, 2025

Thanks @moonyuet - I fixed the matrix basis being integers, now they are floats again. I didn't care much about the empty object_transform key existing even if empty. Seems like a good thing if the data structure would remain a bit consistent in that area. Would you like me to pup the key if it is empty instead?

Also, I'm quite surprised it actually worked and this is the only difference in the data 🤯

@BigRoy BigRoy marked this pull request as ready for review December 15, 2025 09:17
@BigRoy BigRoy requested a review from LiborBatek December 15, 2025 09:18
Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

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

with the groupLoadedAsset - it is also set in Create Multishot Layout but used only here. I am ok to remove it and observe. In case it will be missed by someone, lets clearly define what it should do, implement and document it again.

import re
import uuid
from typing import List
import attr
Copy link
Member

Choose a reason for hiding this comment

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

I'd say we don't need that anymore. We can use pure dataclasses, no? I think the idea was to eventually get rid of this dependency.

Copy link
Contributor Author

@BigRoy BigRoy Dec 15, 2025

Choose a reason for hiding this comment

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

I'd say we don't need that anymore. We can use pure dataclasses, no? I think the idea was to eventually get rid of this dependency.

Unfortunately - I think we'd then face that pyblish mixed with dataclasses and from __future__ import annotations issue, right? That's why I went for attr here.

Copy link
Member

Choose a reason for hiding this comment

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

This was fixed already in pyblish-base - pyblish/pyblish-base#403

Copy link
Member

Choose a reason for hiding this comment

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

.... ah but not released! 😱

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merging this as is @antirotor - I think we can improve later if need be.

Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

Works for me...both .ma and .json been working without any glitches.

LGTM

@BigRoy BigRoy merged commit 49ce5dd into ynput:develop Dec 17, 2025
1 check passed
@BigRoy BigRoy deleted the 121-extract-layout-code-needs-cleanup-to-avoid-hard-to-find-bugs branch December 17, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract Layout: Code needs cleanup to avoid hard to find bugs

4 participants