Skip to content
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

Build shot structure from the database #4

Merged
merged 14 commits into from
Aug 21, 2024

Conversation

antirotor
Copy link
Member

@antirotor antirotor commented Jun 10, 2024

Note

This is port of ynput/ayon-core#25 from ayon-core. For comments and review notes, please have a look at the conversation in the original PR.

Changelog Description

Added a button to build the shot structure as sequences from the database.
Also fixes the folder entity issue which is also implemented : #14

OpenPype PR linked to ynput/OpenPype#6168

@antirotor antirotor added the type: enhancement Improvement of existing functionality or minor addition label Jun 10, 2024
@moonyuet moonyuet marked this pull request as draft July 12, 2024 15:33
@moonyuet moonyuet marked this pull request as ready for review July 12, 2024 15:35
@moonyuet moonyuet requested a review from LiborBatek July 15, 2024 04:36
@iLLiCiTiT iLLiCiTiT force-pushed the enhancement/AY-1066_build-shot-structure-from-db branch from f24b1e3 to 7cac84d Compare July 15, 2024 09:18
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.

Im getting error when triggering the build sequence action as follows

LogPython: Error: Traceback (most recent call last):
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\unreal_0.2.2-dev.1\ayon_unreal\api\hierarchy.py", line 287, in <lambda>
LogPython: Error:     lambda: _on_confirm_clicked(folder_selector, sequence_path, project)
LogPython: Error:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\unreal_0.2.2-dev.1\ayon_unreal\api\hierarchy.py", line 252, in _on_confirm_clicked
LogPython: Error:     _create_sequence(
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\unreal_0.2.2-dev.1\ayon_unreal\api\hierarchy.py", line 172, in _create_sequence
LogPython: Error:     _create_sequence(
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\unreal_0.2.2-dev.1\ayon_unreal\api\hierarchy.py", line 164, in _create_sequence
LogPython: Error:     sequence, frame_range = generate_sequence(name, hierarchy_dir)
LogPython: Error:                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\unreal_0.2.2-dev.1\ayon_unreal\api\pipeline.py", line 633, in generate_sequence
LogPython: Error:     fps = folder_entity["attrib"].get("fps") or 30.0
LogPython: Error:           ~~~~~~~~~~~~~^^^^^^^^^^
LogPython: Error: TypeError: 'NoneType' object is not subscriptable

I have triggered it on top most folder (as starting point), here is my ayon project with that hierarchy selected and shots inside...

image

and here is the outcome in UE editor (shots not present atm)

image

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.

Im getting error when triggering the build sequence action as follows

LogPython: Error: Traceback (most recent call last):
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\unreal_0.2.2-dev.1\ayon_unreal\api\hierarchy.py", line 287, in <lambda>
LogPython: Error:     lambda: _on_confirm_clicked(folder_selector, sequence_path, project)
LogPython: Error:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\unreal_0.2.2-dev.1\ayon_unreal\api\hierarchy.py", line 252, in _on_confirm_clicked
LogPython: Error:     _create_sequence(
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\unreal_0.2.2-dev.1\ayon_unreal\api\hierarchy.py", line 172, in _create_sequence
LogPython: Error:     _create_sequence(
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\unreal_0.2.2-dev.1\ayon_unreal\api\hierarchy.py", line 164, in _create_sequence
LogPython: Error:     sequence, frame_range = generate_sequence(name, hierarchy_dir)
LogPython: Error:                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\unreal_0.2.2-dev.1\ayon_unreal\api\pipeline.py", line 633, in generate_sequence
LogPython: Error:     fps = folder_entity["attrib"].get("fps") or 30.0
LogPython: Error:           ~~~~~~~~~~~~~^^^^^^^^^^
LogPython: Error: TypeError: 'NoneType' object is not subscriptable

I have triggered it on top most folder (as starting point), here is my ayon project with that hierarchy selected and shots inside...

image

and here is the outcome in UE editor (shots not present atm)

image

@moonyuet moonyuet requested a review from LiborBatek July 31, 2024 08:43
@LiborBatek
Copy link
Member

here is my second try selecting the sq01 as root folder...you can see the result on the left in content browser (shots missing even in these circumstances)

image

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.

Now it correctly creates shot structure aka folder hierarchy and corresponding shot seq + level in each shot folder as seen on the pic below
image

One thing to note (probably not within scope of this PR) that when opening parent e.g. episodes_map it does contain all children shots but all being set to default frame ranges and not been correctly positioned on timeline. As this has been mentioned before in ticket for this feature, its a something for future and need to be discussed more - possible OTIO usage etc)

image

@moonyuet
Copy link
Member

@antirotor, I have some discussion with @LiborBatek on the folder structure. Just want to hear your thought on this.
We both think that the shot structure should follow the hierarchy of the project we set in the AYON server.
Let's say the image below. We would have Ayon/{project_name}/episodes/ep01/sq01/sh010 created as the shot structure and sh010 level sequence and sh010_map as level. It seems to align with the project setup and looks more concise.
image

@antirotor
Copy link
Member Author

We both think that the shot structure should follow the hierarchy of the project we set in the AYON server.

I totally agree!

@moonyuet
Copy link
Member

moonyuet commented Aug 7, 2024

@LiborBatek I have implemented the structure similar to what we have discussed. Can you please test again? Thanks!
image

@moonyuet moonyuet requested a review from LiborBatek August 7, 2024 07:32
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.

It looks better now but still there happens to be redundant folder with actual project inside - in my case Quantum_Demo which should not be there as seen in second scnr from Ayon project browser...

image

And how it should look:

image

@moonyuet moonyuet requested a review from LiborBatek August 7, 2024 14:26
@antirotor
Copy link
Member Author

So I have a question. Given:
image

I am running it on already populated (and heavily abused) Unreal project. My point is that:

  • the message complaining about "sequence folder not empty" is just remnant of the state where it was actually loading everything into "Sequences" folder in Unreal, or does it have another meaning?
  • what about updating - if it means that it has to be empty, what about cases where you work on something, but production meanwhile adds a bunch of new shots? At that moment, I need to either delete everything so it can be re-created again, or I need to manually create whatever is added and that is IMO diminishing usefulness of this feature.

@moonyuet
Copy link
Member

moonyuet commented Aug 8, 2024

So I have a question. Given: image

I am running it on already populated (and heavily abused) Unreal project. My point is that:

  • the message complaining about "sequence folder not empty" is just remnant of the state where it was actually loading everything into "Sequences" folder in Unreal, or does it have another meaning?
  • what about updating - if it means that it has to be empty, what about cases where you work on something, but production meanwhile adds a bunch of new shots? At that moment, I need to either delete everything so it can be re-created again, or I need to manually create whatever is added and that is IMO diminishing usefulness of this feature.

So I have a question. Given: image

I am running it on already populated (and heavily abused) Unreal project. My point is that:

  • the message complaining about "sequence folder not empty" is just remnant of the state where it was actually loading everything into "Sequences" folder in Unreal, or does it have another meaning?

This message is irrelevant anymore regarding to the change of the PR. It needs some rephrases.

  • what about updating - if it means that it has to be empty, what about cases where you work on something, but production meanwhile adds a bunch of new shots? At that moment, I need to either delete everything so it can be re-created again, or I need to manually create whatever is added and that is IMO diminishing usefulness of this feature.

We need to improve the message and move some codes a little bit.

@moonyuet moonyuet marked this pull request as draft August 8, 2024 08:47
…ctory creation & support to load the level of the directory if it is already created
@moonyuet moonyuet marked this pull request as ready for review August 8, 2024 14:10
@moonyuet
Copy link
Member

moonyuet commented Aug 8, 2024

@LiborBatek @antirotor I have modified the check on the directory creation and it won't be limited to create level/level sequences anymore but user would receive the message about that. Just FYI there is a case of which the users create the sequence hierarchy with the existing folders and they would receive the warning from default unreal engine. Although the popup warns the users about the creation, it won't block to create the level/level sequence for the shot.

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.

Now this feature Build shot structure from the database correctly creates folder structure and its also possible to re-run the action and the user gets info about already existing folder structure.

Screenshot 2024-08-09 095129

Screenshot 2024-08-09 095209

I guess the editorial aka correct clip in/outs need to be still implemented / done (in separate PR??) @antirotor or?

as all sequences being on the very same clip in/out atm
Screenshot 2024-08-09 095253

@moonyuet moonyuet requested a review from LiborBatek August 13, 2024 14:45
Copy link
Member Author

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

I wanted to say that we can do clipIn/out in next PR, but we are already getting that data, could we just add it there? Like - if it takes more then 20 minutes, I wouldn't do it.

The timeline stuff is something that we'll need to revisit later anyway because we should do it via OTIO.

client/ayon_unreal/api/pipeline.py Outdated Show resolved Hide resolved
@antirotor antirotor assigned moonyuet and unassigned antirotor Aug 21, 2024
@antirotor
Copy link
Member Author

Apparently, because I've transfered the PR and so I am the author, I cannot approve it :D

@moonyuet
Copy link
Member

moonyuet commented Aug 21, 2024

Apparently, because I've transfered the PR and so I am the author, I cannot approve it :D

Ask @LiborBatek for helping.(Or Me?)

@antirotor antirotor merged commit 07ac154 into develop Aug 21, 2024
1 check passed
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.

5 participants