WIP: Refactor Blender Kitsu.Shot Builder #6

Closed
Nick Alberelli wants to merge 0 commits from (deleted):refactor/shot_builder into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

Closes: TinyNick/blender-studio-tools#26

Goal

To refactor the shot_builder sub-module to be more maintainable and simpler. The code's logic is currently heavily dependant on classes. @TinyNick will attempt to refactor the logic into simple and GENERIC functions that can be used to automatically build shots on a large scale or indivudually fix existing shots.

Overall the logic needs to be more modular to be easier to adapt to user requests.

TODO

  • Adapt Exisitng Properties to read Kitsu Data
  • Refactor Create_Built_Steps into classes
Closes: https://projects.blender.org/TinyNick/blender-studio-tools/issues/26 # Goal To refactor the shot_builder sub-module to be more maintainable and simpler. The code's logic is currently heavily dependant on classes. @TinyNick will attempt to refactor the logic into simple and GENERIC functions that can be used to automatically build shots on a large scale or indivudually fix existing shots. Overall the logic needs to be more modular to be easier to adapt to user requests. # TODO - [x] Adapt Exisitng Properties to read Kitsu Data - [ ] Refactor Create_Built_Steps into classes
Nick Alberelli added 4 commits 2023-04-05 21:29:24 +02:00
- Remove _production_shots property
 - Load Shots from gazu.shots.all_shots_for_seq
 - Remove check if shot is in sequence
- Remove _production_seq_id_items property
 - Load Sequences from gazu
- Remove _production_task_type_items property
 - Load Tasks from gazu
- Remove redudant code
 - pass ID as key in all enums
 - adapt existing operator so it runs with this change
Nick Alberelli changed title from WIP: Refactor `Blender Kitsu`'s `Shot Builder` sub-module to WIP: Refactor `Blender Kitsu.Shot Builder` 2023-04-05 21:29:43 +02:00
Nick Alberelli added 1 commit 2023-04-05 23:37:09 +02:00
- Task types are defined both in a class and in Kitsu connector
- current Kitsu definitions dont match ones expected by this addon
- adapt this function to work with the existing code-base temporarily
- add #TODO to improve
- remove no-op code
Nick Alberelli added 1 commit 2023-04-19 15:14:58 +02:00
Squashed commit of the following:

commit 312e3ffebc
Author: Nick Alberelli <tinynick@noreply.localhost>
Date:   Tue Apr 18 15:41:33 2023 +0200

    [Blender_Kitsu] Playblast shot with user viewport settings (#11)

    Closes: https://projects.blender.org/TinyNick/blender-studio-tools/issues/25
    When using plyblast, shading settings are always overriden to playblast defaults, which conflicts with the pet projects shading settings.
    Add option to pass user viewport shading settings to payblast instead
    ![image](/attachments/69c7da46-a7cf-4055-9194-54559bae279e)
    - Refactor to make changing render settings easier in future
    - Added option to pass viewport shading duriing playblast
    - Set above option to True as default
    - Fix issue where playblast rendered overlays if they weren't hidden by user
    User shading settings are not rendered, some gizmos are visable in render
    ![image](/attachments/b412fd01-4bd0-45db-955c-274daebfd746)
    User shading settings are now rendered, no gizmos are visable in render
    ![image](/attachments/78d9b133-637a-479e-81e6-2d1a1336dc95)

    Co-authored-by: TinyNick <nick@blender.org>
    Reviewed-on: https://projects.blender.org/studio/blender-studio-tools/pulls/11

commit 8664dacaeb
Author: Nick Alberelli <tinynick@noreply.localhost>
Date:   Tue Apr 18 04:59:51 2023 +0200

    [Blender_Kitsu] Publish Edit: Fix Filenames (#13)

    Closes: https://projects.blender.org/TinyNick/blender-studio-tools/issues/35
     - Filenames for "Publish Edit" changed from
          - Old: `{project_name}_{edit-entry}_v{revision}.mp4`
          - New: `{project_name}_v{revision}.mp4`
    - Operator cancels if render file already exists
    - Tooltip includes `will not overwrite existing files` to reflect above change
    ![image](/attachments/edc74330-ef26-4aae-b6ef-cb1a4fa3742b)

    Co-authored-by: TinyNick <nick@blender.org>
    Reviewed-on: https://projects.blender.org/studio/blender-studio-tools/pulls/13

commit 0076748592
Author: Nick Alberelli <tinynick@noreply.localhost>
Date:   Tue Apr 18 03:37:44 2023 +0200

    [Blender_Kitsu] Pub_Edit_Rev: Fix `frame_start` not found on server (#14)

    Closes: https://projects.blender.org/TinyNick/blender-studio-tools/issues/37

    If Kitsu server doesn't contain `frame_start` key within Edit [Blender_Kitsu] returns following

    ```python
    Python: Traceback (most recent call last):
      File "C:\Users\{user}\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blender_kitsu\sqe\ops.py", line 2463, in invoke
        self.frame_start = server_frame_start
      File "c:\Users\{user}\Blender-Studio\Development\Blender-Builds\blender-git\build_windows_x64_vc16_Release\bin\Release\3.6\scripts\modules\bpy_types.py", line 822, in __setattr__
        return setattr(properties, attr, value)
    TypeError: bpy_struct: item.attr = val: KITSU_OT_vse_publish_edit_revision.frame_start expected an int type, not NoneType
    ```

    - [x] Add check if `server_frame_start` is int before invoke

    Co-authored-by: TinyNick <nick@blender.org>
    Reviewed-on: https://projects.blender.org/studio/blender-studio-tools/pulls/14

commit cb709e9943
Author: Nick Alberelli <tinynick@noreply.localhost>
Date:   Mon Apr 17 19:09:06 2023 +0200

    [Blender_Kitsu] Shot_Builder fix lighting task type (#9)

    Closes: https://projects.blender.org/TinyNick/blender-studio-tools/issues/31
    After setup of https://projects.blender.org/studio/blender-studio-tools/pulls/5 some steps meant only for animation tasks are being run on all tasks
    Run the following steps only if task type is animation. I wanted to tackle this during a refactor https://projects.blender.org/studio/blender-studio-tools/pulls/6 so in the meantime I have done a quick solution and added #TODO comments where relevant to improve the code during refactor.
     - Check if Editorial Export path is valid
     - Setup animaton workspace
     - Import Editorial reference
     - Add VSE Area for reference
    In this demo I am comparing an animation task type to a lighting task type.

    ![image](/attachments/8db10e4d-0874-4ad9-b0d2-78f48577d79b)

    Co-authored-by: TinyNick <nick@blender.org>
    Reviewed-on: https://projects.blender.org/studio/blender-studio-tools/pulls/9

commit e0dd4f3d46
Author: Nick Alberelli <tinynick@noreply.localhost>
Date:   Mon Apr 17 19:07:10 2023 +0200

    [Blender_Kitsu] Update 'README.md' with new sub-modules (#10)

    Closes: https://projects.blender.org/TinyNick/blender-studio-tools/issues/29
    Reviewed-on: https://projects.blender.org/studio/blender-studio-tools/pulls/10

commit b9f196122d
Author: Nick Alberelli <tinynick@noreply.localhost>
Date:   Mon Apr 17 19:02:14 2023 +0200

    [Blender_Kitsu] Publish VSE Edit as Revision on Kitsu (#7)

    Closes: https://projects.blender.org/TinyNick/blender-studio-tools/issues/6

    Create a new operator that will upload the entire storyboard as a full edit to the Kitsu EDIT section.

    ![image](/attachments/1a042ff5-a4f4-4510-8adb-236b5e655afd)
    Using the edits from the Kitsu API (added to Gazu) https://kitsu-api.cg-wire.com/#/Edits We are able to query for tasks related to edits. On these tasks is where revisions are submitted for the Kitsu Server's Edit Section (imaged above). Operator will select a task, render the current file and submit this as a revision on the edit's task.

    - We get the tasks from the Kitsu server via `/data/edits/with-tasks/`
    - We can get the existing revisions via `/data/edits/{edit_id}/preview-files`

    I have put this in the VSE UI area.

    ![image](/attachments/6ddf24c2-a3f3-4120-a462-aaf20adece9a)

    These are the options that are set by the User before running the operation

    `Project Name` Set by the active project in Blender_Kitsu addon settings

    `Edit Entries` Are the different tasks on Kitsu related to each version on the edit. Typically a project will just have one but the operator allows for additional entries to be selected. (usually hidden)

    `Edit Entry Tasks` Within each Edit Entry there is 1 or more tasks. Per default the operator will always select the first task, and will cancel if no task is found. If more than one task is avaliable the user will be able to select so from the menu.

    `Comment` Is optional

    `Render Directory` User can set a custom directory, by default the addon will use the active scene's render path (set during invoke.)

    ![image](/attachments/26aa7433-48d3-486a-9935-3b1341c1aa97)

    Operator will use the current path set in pet project edit .blend files. These files have their render path set to `/shared\{project_name}\editorial\export\{project_name}_v{revision}.mp4`.
    > - Addon will re-use exisitng render directory from .blend
    > - Addon will clear any filename out of path

    Current pet project edit .blend files use have a naming convention `{project_name}_v{revision}.mp4` convention.
    > - Operator use this convention: `{project_name}_{edit-entry}_v{revision}.mp4`
    > - This new filename convention  To avoid overwriting any exisiting files on the shared drive when rendering new revisions in case of a mismatch.
    > - Include Kitsu revision in filename to help users understand what operator is doing
    > - We know the file's revision number by checking the number of existing preview files on the server via `/data/edits/{edit_id}/preview-files`

    Blender_Kitsu already contains a playblast module which contains some similar features to what is needed by this operator.
    > - Added a core function and moved some functions out of [playblast.ops](https://projects.blender.org/studio/blender-studio-tools/pulls/7/files#diff-b8b185c120290c23b08dfc4384e3b893c500a762) to increase code-reuse

    In this demo we are going from Revision 2 to Revision 3. I have changed the first frame of the video to make the change more obvious once Revision 3 is uploaded to the task. Notice on Kitsu the additional revision comments added after the operation is complete.

    Filenames that are rendered match the revision numbers in Kitsu.

    ![demo](/attachments/a3183d06-cc18-46b5-a85b-9a6e18924288)
     - Blender freezes without a progressbar or any feedback when uploading preview to Kitsu
     - Edit_Entry must have a task set on Kitsu server. Operator cannot create new tasks
     - Always renders in 1080p h.264 with no option to adjust

    Co-authored-by: TinyNick <nick@blender.org>
    Reviewed-on: https://projects.blender.org/studio/blender-studio-tools/pulls/7

commit f3a3ffb27c
Author: Demeter Dzadik <demeter@blender.org>
Date:   Wed Apr 5 15:50:32 2023 +0200

    SVN: Fix an error parsing the log on Windows

commit 5139fa77e9
Author: Nick Alberelli <tinynick@noreply.localhost>
Date:   Thu Apr 13 16:07:28 2023 +0200

    Fix `Shot_Builder` fails to invoke with correct project root directory (#8)

    Closes: https://projects.blender.org/TinyNick/blender-studio-tools/issues/30
    - [x] Currently expecting `/media/data/pets/pro` we need to accept this instead `/media/data/pets/`
    - [x] Add Error message for similar errors
     - `ensure_loaded_production()` function now expects correct project root directory
     - Meaningful error messages have been added to make the issue more clear in the future
    Shot_Builder is dependant on a filepath that is hard-coded into the project. If Blender-Kitsu already knows the project id than this shouldn't be the case. I would like to address issues like this in my PR https://projects.blender.org/studio/blender-studio-tools/pulls/6
    ![demo.gif](/attachments/aed7878b-944a-40f7-8ed5-1123b4c5e44a)

    Co-authored-by: TinyNick <nick@blender.org>
    Reviewed-on: https://projects.blender.org/studio/blender-studio-tools/pulls/8

commit 074b465b1f
Author: Simon Thommes <simon.thommes@gmx.de>
Date:   Thu Apr 13 12:11:24 2023 +0200

    Add Lighting Overrider info to readme

commit 6df57685a7
Author: Simon Thommes <simon.thommes@gmx.de>
Date:   Wed Apr 12 19:13:44 2023 +0200

    [Lighting Overrider] Fix issue with boolean overrides

commit c3576ec4a2
Author: Simon Thommes <simon.thommes@gmx.de>
Date:   Wed Apr 12 18:50:22 2023 +0200

    [Lighting Overrider] General Improvements/Fixes
    - Fix issue with exec not running in 3.6
    - Better support custom property rna overrides
    - Implemented proper-ish rna parsing
Nick Alberelli added 2 commits 2023-04-19 16:10:58 +02:00
Nick Alberelli added 1 commit 2023-04-19 17:09:06 +02:00
Author
Member
Closing per https://projects.blender.org/TinyNick/blender-studio-tools/issues/26
Nick Alberelli closed this pull request 2023-04-19 17:54:01 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: studio/blender-studio-tools#6
No description provided.