Blender Kitsu: Rename 'Metastrip' to 'Metadata Strip' #255

Merged
5 changed files with 55 additions and 55 deletions

BIN
docs/media/addons/blender_kitsu/metadata_strip.001.jpg (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

View File

@ -100,18 +100,18 @@ blender-kitsu has many feature and in this documentation they are divided in dif
blender-kitsu sequence editor tools were constructed with the idea in mind to have a relationship between sequence strips and shots on Kitsu. This connection enables the exchange of metadata between the edit and the shots on Kitsu. Some examples are frame ranges of shots can be directly updated from the edit or thumbnails can be rendered and uploaded to Kitsu with a click of a button and many more which you will find out in this section:
##### Metastrips
Metastrips are regular Movie Strips that can be linked to a shot in kitsu. It is a good idea to create a separate meta strip in a separate channel that represents the shot. That gives you the freedom to assemble a shot out of multiple elements, like multiple storyboard pictures, and still have one metastrip that contains the full shot range.
Metastrips are regular Movie Strips that can be linked to a shot in kitsu. It is a good idea to create a separate metadata strip in a separate channel that represents the shot. That gives you the freedom to assemble a shot out of multiple elements, like multiple storyboard pictures, and still have one metadata strip that contains the full shot range.
![image info](/media/addons/blender_kitsu/metastrip.001.jpg)
![image info](/media/addons/blender_kitsu/metadata_strip.001.jpg)
>**Good to know**: A metastrip can have 3 states. It can be **initialized** but **not** linked yet. That means the movie strips knows I am a metastrip but I don't have a relationship to a shot on Kitsu yet. It can be **linked**, which means the strip is already initialized and is linked to a sequence_id and shot_id on Kitsu. Only if a strip is linked you can exchange metadata, push thumbnails etc. The last state is **uninitialized** which basically means it's a regular movie strips and has nothing to do with kitsu.
>**Good to know**: A metadata strip can have 3 states. It can be **initialized** but **not** linked yet. That means the movie strips knows I am a metadata strip but I don't have a relationship to a shot on Kitsu yet. It can be **linked**, which means the strip is already initialized and is linked to a sequence_id and shot_id on Kitsu. Only if a strip is linked you can exchange metadata, push thumbnails etc. The last state is **uninitialized** which basically means it's a regular movie strips and has nothing to do with kitsu.
###### Create a Metastrip
1. Select a sequence strip for which you want to create a metastrip and execute the `Create Metastrip` operator.
This will import a metastrip.mp4 (1000 frame black video) file which is saved in the add-ons repository. The metastrip will be placed one channel above the selected strips. Make sure there is enough space otherwise the metastrip will not be created.
1. Select a sequence strip for which you want to create a metadata strip and execute the `Create Metastrip` operator.
This will create a blank movie strip. The metadata strip will be placed one channel above the selected strips. Make sure there is enough space otherwise the metadata strip will not be created.
###### Initialize a Shot
1. Select a metastrip and open the `Kitsu` tab in the sidebar of the sequence editor. You will find multiple ways on how to initialize your strip.
1. Select a metadata strip and open the `Kitsu` tab in the sidebar of the sequence editor. You will find multiple ways on how to initialize your strip.
![image info](/media/addons/blender_kitsu/sqe_init_shot.jpg)
2. Case A: Shot does **already exist** on Kitsu
@ -162,11 +162,11 @@ In the `Push` panel you will find all the operators that push data to Kitsu. <br
The actual shot frame range (starting at 101) will be saved in `["data"]["3d_start"]` kitsu shot attribute <br/>
>**Thumbnails**: Renders a thumbnail of the selected shots (will be saved to the `Thumbnail Directory` -> see addon preferences) and uploads it to Kitsu. Thumbnails are linked to a task in Kitsu. So you can select the Task Type for which you want to upload the thumbnail with the `Set Thumbnail Task Type` operator. <br/>
If you select multiple metastrips it will always use the middle frame to create the thumbnail. If you have only one selected it will use the frame which is under the cursor (it curser is inside shot range). <br/>
If you select multiple metadata strips it will always use the middle frame to create the thumbnail. If you have only one selected it will use the frame which is under the cursor (it curser is inside shot range). <br/>
**Render**: Renders the shot range out of the sequence editor, saves it to disk and uploads it to Kitsu. Works very similar to the `Push Thumbnail` operator.
##### Pull
In the `Pull` panel you will find all the operators that pull data from Kitsu to a metastrip. <br/>
In the `Pull` panel you will find all the operators that pull data from Kitsu to a metadata strip. <br/>
![image info](/media/addons/blender_kitsu/sqe_pull.jpg)
@ -177,7 +177,7 @@ If you have not sequence selected the `Pull Entire Edit` Operator will appear in
![image info](/media/addons/blender_kitsu/sqe_pull_entire_edit.jpg)
After you selected the channel it will go through all shots on Kitsu, create a metastrip which will be linked to the respective shot and pulls all metadata. <br/>
After you selected the channel it will go through all shots on Kitsu, create a metadata strip which will be linked to the respective shot and pulls all metadata. <br/>
It will use te `frame_in` and `frame_out` attribute on Kitsu to determine the in and out points in the edit. So make sure these are up to date and don't overlap. <br/>
As a result a bigger edit with nice sequence_colors can look pretty cool:
@ -187,7 +187,7 @@ As a result a bigger edit with nice sequence_colors can look pretty cool:
##### Multi Edit
The `Multi Edit` panel only appears when you select multiple metastrips that are all `initialized` but not `linked` yet. <br/>
The `Multi Edit` panel only appears when you select multiple metadata strips that are all `initialized` but not `linked` yet. <br/>
![image info](/media/addons/blender_kitsu/sqe_multi_edit.jpg)
@ -282,7 +282,7 @@ Shot Builder is a Feature of the Blender Kitsu Add-on To automatically build sho
### Getting Started
#### Shot Setup
The Shot Builder requires shot data including Name, Frame Rate, and Duration to be stored on a Kitsu Server. Please follow the [Sequence Editor](#sequence-editor) guide to create metastrips and Push that data to the Kitsu server or follow the [Kitsu First Production](https://kitsu.cg-wire.com/first_production/) to manually enter this data into the Kitsu Server.
The Shot Builder requires shot data including Name, Frame Rate, and Duration to be stored on a Kitsu Server. Please follow the [Sequence Editor](#sequence-editor) guide to create metadata strips and Push that data to the Kitsu server or follow the [Kitsu First Production](https://kitsu.cg-wire.com/first_production/) to manually enter this data into the Kitsu Server.
#### Asset Setup
##### Kitsu Server

View File

@ -1508,15 +1508,15 @@ class KITSU_OT_sqe_push_shot(bpy.types.Operator):
def execute(self, context: bpy.types.Context) -> Set[str]:
active_strip = context.scene.sequence_editor.active_strip
# Find the metastrip of this strip that contains Kitsu information
# Find the metadata strip of this strip that contains Kitsu information
# about what sequence and shot this strip belongs to.
shot_name = active_strip.name.split(bkglobals.DELIMITER)[0]
metastrip = context.scene.sequence_editor.sequences.get(shot_name)
if not metastrip:
# The metastrip should've been created by sqe_create_review_session,
metadata_strip = context.scene.sequence_editor.sequences.get(shot_name)
if not metadata_strip:
# The metadata strip should've been created by sqe_create_review_session,
# if the Kitsu integration is enabled in the add-on preferences,
# the Kitsu add-on is enabled, and valid Kitsu credentials were entered.
self.report({"ERROR"}, f"Could not find Kitsu metastrip: {shot_name}.")
self.report({"ERROR"}, f"Could not find Kitsu metadata strip: {shot_name}.")
return {"CANCELLED"}
if not self.task_status:
@ -1524,8 +1524,8 @@ class KITSU_OT_sqe_push_shot(bpy.types.Operator):
return {"CANCELLED"}
# Set the Kitsu sequence and shot information in the context
cache.sequence_active_set_by_id(context, metastrip.kitsu.sequence_id)
cache.shot_active_set_by_id(context, metastrip.kitsu.shot_id)
cache.sequence_active_set_by_id(context, metadata_strip.kitsu.sequence_id)
cache.shot_active_set_by_id(context, metadata_strip.kitsu.shot_id)
# Save playblast task status id for next time.
context.scene.kitsu.playblast_task_status_id = self.task_status
@ -1778,7 +1778,7 @@ class KITSU_OT_sqe_pull_edit(bpy.types.Operator):
frame_end,
)
continue
# TODO Refactor as this reuses code from KITSU_OT_sqe_create_meta_strip
# TODO Refactor as this reuses code from KITSU_OT_sqe_create_metadata_strip
if not strip:
# Create new strip.
strip = context.scene.sequence_editor.sequences.new_movie(
@ -1940,9 +1940,9 @@ class KITSU_OT_sqe_init_strip_start_frame(bpy.types.Operator):
return {"FINISHED"}
class KITSU_OT_sqe_create_meta_strip(bpy.types.Operator):
bl_idname = "kitsu.sqe_create_meta_strip"
bl_label = "Create Meta Strip"
class KITSU_OT_sqe_create_metadata_strip(bpy.types.Operator):
bl_idname = "kitsu.sqe_create_metadata_strip"
bl_label = "Create Metadata Strip"
bl_description = (
"Adds metadata strip for each selected strip. "
"Tries to place metadata strip one channel above selected "
@ -1959,24 +1959,24 @@ class KITSU_OT_sqe_create_meta_strip(bpy.types.Operator):
failed = []
created = []
occupied_ranges = checksqe.get_occupied_ranges(context)
logger.info("-START- Creating Meta Strips")
logger.info("-START- Creating Metadata Strips")
selected_sequences = context.selected_sequences
# Check if metastrip file actually exists.
# Check if metadata strip file actually exists.
for strip in selected_sequences:
# Get frame range information from current strip.
strip_range = range(strip.frame_final_start, strip.frame_final_end)
channel = strip.channel + 1
# Check if one channel above strip there is space to put the meta strip.
# Check if one channel above strip there is space to put the metadata strip.
if str(channel) in occupied_ranges:
if checksqe.is_range_occupied(
strip_range, occupied_ranges[str(channel)]
):
failed.append(strip)
logger.error(
"Failed to create metastrip for %s. Channel: %i Range: %i - %i is occupied",
"Failed to create metadata strip for %s. Channel: %i Range: %i - %i is occupied",
strip.name,
channel,
strip.frame_final_start,
@ -1984,36 +1984,36 @@ class KITSU_OT_sqe_create_meta_strip(bpy.types.Operator):
)
continue
# Create new meta strip.
# TODO: frame range of metastrip is 1000 which is problematic because it needs to fit
# Create new metadata strip.
# TODO: frame range of metadata strip is 1000 which is problematic because it needs to fit
# on the first try, EDIT: seems to work maybe per python overlaps of sequences possible?
meta_strip = context.scene.sequence_editor.sequences.new_movie(
f"{strip.name}_metastrip",
metadata_strip = context.scene.sequence_editor.sequences.new_movie(
f"{strip.name}{bkglobals.DELIMITER}metadata{bkglobals.SPACE_REPLACER}strip",
"",
strip.channel + 1,
strip.frame_final_start,
)
created.append(meta_strip)
created.append(metadata_strip)
# Set blend alpha.
meta_strip.blend_alpha = 0
metadata_strip.blend_alpha = 0
# Set frame in and out.
meta_strip.frame_final_start = strip.frame_final_start
meta_strip.frame_final_end = strip.frame_final_end
meta_strip.channel = strip.channel + 1
metadata_strip.frame_final_start = strip.frame_final_start
metadata_strip.frame_final_end = strip.frame_final_end
metadata_strip.channel = strip.channel + 1
# Init start frame offst.
opsdata.init_start_frame_offset(meta_strip)
opsdata.init_start_frame_offset(metadata_strip)
logger.info(
"%s created metastrip: %s",
"%s created metadata strip: %s",
strip.name,
meta_strip.name,
metadata_strip.name,
)
# Report.
report_str = f"Created {len(created)} meta strips"
report_str = f"Created {len(created)} metadata strips"
report_state = "INFO"
if failed:
report_state = "WARNING"
@ -2025,7 +2025,7 @@ class KITSU_OT_sqe_create_meta_strip(bpy.types.Operator):
)
# Log.
logger.info("-END- Creating Meta Strips")
logger.info("-END- Creating Metadata Strips")
util.ui_redraw()
return {"FINISHED"}
@ -2287,7 +2287,7 @@ class KITSU_OT_shot_image_sequence(bpy.types.Operator):
return match.group(1)
return
def get_metastrip(self, context, strip):
def get_metadata_strip(self, context, strip):
name = self.get_shot_name(strip)
for strip in context.scene.sequence_editor.sequences_all:
if strip.name == name:
@ -2300,11 +2300,11 @@ class KITSU_OT_shot_image_sequence(bpy.types.Operator):
frame_end = strip.frame_final_end
files = []
metastrip = self.get_metastrip(context, strip)
if not metastrip:
self.report({'ERROR'}, f"No Metastrip found for {strip.name}")
metadata_strip = self.get_metadata_strip(context, strip)
if not metadata_strip:
self.report({'ERROR'}, f"No Metadata Strip found for {strip.name}")
return {'CANCELLED'}
shot = Shot.by_id(metastrip.kitsu.shot_id)
shot = Shot.by_id(metadata_strip.kitsu.shot_id)
start_frame = (
shot.data.get('3d_start') if shot.data.get('3d_start') else bkglobals.FRAME_START
)
@ -2588,7 +2588,7 @@ classes = [
KITSU_OT_sqe_debug_multi_project,
KITSU_OT_sqe_pull_edit,
KITSU_OT_sqe_init_strip_start_frame,
KITSU_OT_sqe_create_meta_strip,
KITSU_OT_sqe_create_metadata_strip,
KITSU_OT_sqe_add_sequence_color,
KITSU_OT_sqe_scan_for_media_updates,
KITSU_OT_sqe_change_strip_source,

View File

@ -45,7 +45,7 @@ from ..sqe.ops import (
KITSU_OT_sqe_debug_multi_project,
KITSU_OT_sqe_pull_edit,
KITSU_OT_sqe_init_strip_start_frame,
KITSU_OT_sqe_create_meta_strip,
KITSU_OT_sqe_create_metadata_strip,
KITSU_OT_sqe_add_sequence_color,
KITSU_OT_sqe_scan_for_media_updates,
KITSU_OT_sqe_change_strip_source,
@ -204,11 +204,11 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel):
text=f"Link {noun}",
icon="LINKED",
)
# Create metastrip from uninitialized strip.
# Create metadata strip from uninitialized strip.
row = box.row(align=True)
row.operator(
KITSU_OT_sqe_create_meta_strip.bl_idname,
text=f"Create Metastrip {noun}",
KITSU_OT_sqe_create_metadata_strip.bl_idname,
text=f"Create Metadata Strip {noun}",
)
# Unlink.
@ -244,8 +244,8 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel):
)
row = box.row(align=True)
row.operator(
KITSU_OT_sqe_create_meta_strip.bl_idname,
text=f"Create {len(strips_to_init)} Metastrips",
KITSU_OT_sqe_create_metadata_strip.bl_idname,
text=f"Create {len(strips_to_init)} Metadata Strips",
)
# Make row.