VSE: Tool system integration

Add toolbar to sequencer regions.

A bit of refactoring has to be done in RNA space.
Currently there is only cut tool implemented to serve as template for
anybody who would like to add more.
This commit is contained in:
2020-01-22 14:54:44 +01:00
parent f559e3977e
commit 6a49161c8c
13 changed files with 432 additions and 49 deletions

View File

@@ -390,6 +390,14 @@ class ToolSelectPanelHelper:
if tool is not None:
tool.refresh_from_context()
return tool
elif space_type == 'SEQUENCE_EDITOR':
space_data = context.space_data
if mode is None:
mode = space_data.view_type
tool = context.workspace.tools.from_space_sequencer(mode, create=create)
if tool is not None:
tool.refresh_from_context()
return tool
return None
@staticmethod
@@ -656,6 +664,8 @@ class ToolSelectPanelHelper:
return space_type, space_data.mode
elif space_type == 'NODE_EDITOR':
return space_type, None
elif space_type == 'SEQUENCE_EDITOR':
return space_type, context.space_data.view_type
else:
return None, None