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

Merged
Nick Alberelli merged 28 commits from :feature/upload_render_to_kitsu into master 2023-04-17 19:02:15 +02:00
Member

Closes: TinyNick/blender-studio-tools#6

Goal

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

image

First Implementation

How it works

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

UI & Placement

I have put this in the VSE UI area.

image

Operator Options

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

Special Considerations

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 to increase code-reuse

Demo

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

Know Limitations

  • 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
Closes: https://projects.blender.org/TinyNick/blender-studio-tools/issues/6 # Goal 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) # First Implementation ### How it works 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` # UI & Placement I have put this in the VSE UI area. ![image](/attachments/6ddf24c2-a3f3-4120-a462-aaf20adece9a) ## Operator Options 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) ## **Special Considerations** 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 # Demo 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) # Know Limitations - 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
Nick Alberelli changed title from WIP: Render & Send to Kitsu to WIP: Publish VSE Edit as Revision on Kitsu 2023-04-13 21:41:53 +02:00
Nick Alberelli changed title from WIP: Publish VSE Edit as Revision on Kitsu to Publish VSE Edit as Revision on Kitsu 2023-04-13 22:18:06 +02:00

Functionality looks good! One feature should be added: the ability to push some custom metadata for the "frame_start" key. This is used by Watchtower to pad the edit in the timeline.

I noticed you added something to the Gazu module. Was this done by fetching the latest version of Gazu from here? https://github.com/cgwire/gazu

Functionality looks good! One feature should be added: the ability to push some custom metadata for the "frame_start" key. This is used by Watchtower to pad the edit in the timeline. I noticed you added something to the Gazu module. Was this done by fetching the latest version of Gazu from here? https://github.com/cgwire/gazu
Author
Member

Functionality looks good! One feature should be added: the ability to push some custom metadata for the "frame_start" key. This is used by Watchtower to pad the edit in the timeline.

I noticed you added something to the Gazu module. Was this done by fetching the latest version of Gazu from here? https://github.com/cgwire/gazu

Sure thing!

TODO

  • frame_start key I can get started on that right now.

Gazu Clarification

Changes to Gazu were made on the addon side. The module is named gazu, but the functions are about accessing data via https://kitsu-api.cg-wire.com/#/Edits API. Described in #7 (comment) I did ensure my server had the latest Gazu version installed when I set it up recently. Does that clarify the gazu question?:

  • Added new functions on tasks.py
    • all_tasks_for_edit()
  • Created edit.py for accessing Edit entries
    • get_all_edits()
    • get_all_edits_with_tasks()
    • get_all_previews_for_edit()
> Functionality looks good! One feature should be added: the ability to push some custom metadata for the "frame_start" key. This is used by Watchtower to pad the edit in the timeline. > > I noticed you added something to the Gazu module. Was this done by fetching the latest version of Gazu from here? https://github.com/cgwire/gazu Sure thing! ### TODO - [x] `frame_start` key I can get started on that right now. ### Gazu Clarification Changes to Gazu were made on the addon side. The module is named gazu, but the functions are about accessing data via https://kitsu-api.cg-wire.com/#/Edits API. Described in https://projects.blender.org/studio/blender-studio-tools/pulls/7#how-it-works I did ensure my server had the latest Gazu version installed when I set it up recently. Does that clarify the gazu question?: - Added new functions on [tasks.py ](https://projects.blender.org/studio/blender-studio-tools/pulls/7/files#diff-112098c7b2c49f9e8aaa6ba8c76b64d8d2419f06) - all_tasks_for_edit() - Created [edit.py](https://projects.blender.org/studio/blender-studio-tools/pulls/7/files#diff-293cd0b59be29a3e8f3a627dbdce0285f48de91a) for accessing Edit entries - get_all_edits() - get_all_edits_with_tasks() - get_all_previews_for_edit()
Author
Member
  • frame_start key I can get started on that right now.

@fsiddi I have added the feature frame_start. I made this optional, incase the production hasn't added this value to their edits (i noticed this on my test server). Commit: 24357f71a1

I have also ensured that during invoke the current frame_start found on the server is used as the 'default'.

Added the following modules to the blender_kitsu.gazu sub-module:

  1. gazu.entity add update_entity() function

  2. gazu.edit add get_edit() function`

These were added because the frame_start value exists within the data of the edit_entity itself not the comment. Comment is used for the rest of the video revision submission logic.


DEMO

In this demo I am updating the frame_start from 111 to 66, the change is view-able on the server after a refresh.

demo_frame_start

> - [x] `frame_start` key I can get started on that right now. @fsiddi I have added the feature `frame_start`. I made this optional, incase the production hasn't added this value to their edits (i noticed this on my test server). Commit: https://projects.blender.org/studio/blender-studio-tools/commit/24357f71a154859406e2b3d560d4ad7afc362fdb I have also ensured that during invoke the current frame_start found on the server is used as the 'default'. Added the following modules to the `blender_kitsu.gazu` sub-module: 1. [`gazu.entity add update_entity() function`](https://projects.blender.org/studio/blender-studio-tools/commit/dffb807427fc274da3a0c31cef1e9413ea19eff8) 2. [`gazu.edit add get_edit() function`](https://projects.blender.org/studio/blender-studio-tools/commit/09967e564fec79d45d4cf9f160744f3b7093a169)` These were added because the `frame_start` value exists within the data of the edit_entity itself not the comment. Comment is used for the rest of the video revision submission logic. _____ ### DEMO In this demo I am updating the frame_start from `111` to `66`, the change is view-able on the server after a refresh. ![demo_frame_start](/attachments/8f8c717b-fe15-4170-8884-82d8909cd9f0)

Looks good. Let's roll this out ASAP!

Looks good. Let's roll this out ASAP!
Nick Alberelli changed title from Publish VSE Edit as Revision on Kitsu to [Blender_Kitsu] Publish VSE Edit as Revision on Kitsu 2023-04-17 15:30:42 +02:00
Nick Alberelli force-pushed feature/upload_render_to_kitsu from 4d4485c247 to eb52ad51fd 2023-04-17 18:58:54 +02:00 Compare
Nick Alberelli force-pushed feature/upload_render_to_kitsu from eb52ad51fd to 65c173e545 2023-04-17 19:01:28 +02:00 Compare
Nick Alberelli merged commit b9f196122d into master 2023-04-17 19:02:15 +02:00
Konstantin Dmitriev (Morevna Project) reviewed 2023-05-14 16:40:54 +02:00
@ -1408,4 +1408,0 @@
addon_prefs = prefs.addon_prefs_get(bpy.context)
folder_name = addon_prefs.sqe_render_dir
file_name = f"{strip.kitsu.shot_id}_{strip.kitsu.shot_name}.{(task_type.name).lower()}.mp4"
return Path(folder_name).absolute().joinpath(file_name)
First-time contributor

Removal of this function results in error - studio/blender-studio-pipeline#44

Removal of this function results in error - https://projects.blender.org/studio/blender-studio-pipeline/issues/44
Konstantin Dmitriev (Morevna Project) reviewed 2023-05-14 16:43:54 +02:00
@ -1404,11 +1405,7 @@ class KITSU_OT_sqe_push_render(bpy.types.Operator):
logger.info("-END- Pushing Sequence Editor Render")
return {"FINISHED"}
First-time contributor

Removal of the function _gen_output_path (below) results in error - #44

Removal of the function _gen_output_path (below) results in error - #44
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 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#7
No description provided.