Skip to content

Commit

Permalink
Merge branch '207-retimer-markers-and-time-linking' into 'main'
Browse files Browse the repository at this point in the history
Resolve "Retimer, markers and time linking"

Closes #207

See merge request blender/public-projects/shotmanager-addon!114
  • Loading branch information
jatubi committed Aug 25, 2022
2 parents 7870726 + 400fea8 commit 1e33cbf
Show file tree
Hide file tree
Showing 41 changed files with 1,731 additions and 656 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
-----
## 2.0.224 (2022-08-24)
### Retimer, markers
- Retimer UI and structure refactored and simplified
- Added support for markers in Retimer

- Fixed header title display when add-on has a warning

-----
## 2.0.223 (2022-08-24)
### Markers
- Integrated the tool Markers Nav Bar from the add-on Ubisoft Video Tracks

-----
## 2.0.222 (2022-08-23)
- Fixed error message at install time when internet connection is not available
Expand Down
9 changes: 7 additions & 2 deletions shotmanager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
from .utils import utils_render
from .utils import utils_operators
from .utils import utils_operators_overlays
from .tools import frame_range
from .utils.utils_os import module_can_be_imported

from .tools import frame_range
from .tools import markers_nav_bar

from . import keymaps

from . import debug as sm_debug
Expand All @@ -80,11 +82,12 @@
"author": "Ubisoft - Julien Blervaque (aka Werwack), Romain Carriquiry Borchiari",
"description": "Easily manage shots and cameras in the 3D View and see the resulting edit in real-time",
"blender": (3, 1, 0),
"version": (2, 0, 222),
"version": (2, 0, 224),
"location": "View3D > Shot Mng",
"doc_url": "https://ubisoft-shotmanager.readthedocs.io",
"tracker_url": "https://github.com/ubisoft/shotmanager/issues",
# "warning": "BETA Version",
"warning": "Pre-Release",
"category": "Ubisoft",
}

Expand Down Expand Up @@ -201,6 +204,7 @@ def register():
greasepencil.register()
storyboard.register()
frame_range.register()
markers_nav_bar.register()
rendering.register()
takes.register()
shots.register()
Expand Down Expand Up @@ -414,6 +418,7 @@ def unregister():

utils_operators_overlays.unregister()
utils_operators.unregister()
markers_nav_bar.unregister()
frame_range.unregister()
storyboard.unregister()
greasepencil.unregister()
Expand Down
100 changes: 95 additions & 5 deletions shotmanager/addon_prefs/addon_prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from shotmanager.utils.utils_operators_overlays import getOverlaysPropertyState

from shotmanager.tools.frame_range.frame_range_operators import display_frame_range_in_editor
from shotmanager.tools.markers_nav_bar.markers_nav_bar import display_markersNavBar_in_editor

from shotmanager.config import config
from shotmanager.config import sm_logging
Expand Down Expand Up @@ -819,11 +820,19 @@ def _update_layersListDropdown(self, context):
options=set(),
)

########################################################################
# Retimer
########################################################################

retimer_applyTo_expanded: BoolProperty(
name="Expand Layout Settings",
default=True,
)

display_retimer_panel: BoolProperty(
name="Display Retimer",
description="Display the Retimer sub-panel in the Shot Manager panel.\n\n(saved in the add-on preferences)",
default=False,
default=True,
)
applyToTimeCursor: BoolProperty(
name="Apply to Time Cursor",
Expand Down Expand Up @@ -950,23 +959,104 @@ def _update_display_shtStack_toolbar(self, context):
)

###################################
# Frame Range #####################
# Frame Range tool ################
###################################

def _update_display_frame_range_tool(self, context):
# print("\n*** _update_display_frame_range_tool. New state: ", self.display_frame_range_tool)
# from shotmanager.tools.frame_range.frame_range_operators import display_frame_range_in_editor

display_frame_range_in_editor(self.display_frame_range_tool)

display_frame_range_tool: BoolProperty(
name="Frame Time Range",
description="Easily get and set the time range from the Timeline editor."
description="Easy get and set the time range from the Timeline editor."
"\nA tool from Ubisoft Shot Manager"
"\n\n(saved in the add-on preferences)",
update=_update_display_frame_range_tool,
default=True,
)

###################################
# Markers Nav Bar Tool ############
###################################

def _update_display_markersNavBar_tool(self, context):
# print("\n*** _update_display_markersNavBar_tool. New state: ", self.display_frame_range_tool)
display_markersNavBar_in_editor(self.display_markersNavBar_tool)

display_markersNavBar_tool: BoolProperty(
name="Markers Nav Bar",
description="Jump from marker to marker, filter them for faster navigation."
"\nA tool from Ubisoft Shot Manager"
"\n\n(saved in the add-on preferences)",
update=_update_display_markersNavBar_tool,
default=False,
)

mnavbar_settings_expanded: BoolProperty(
name="Expand Panel Settings",
default=False,
)

mnavbar_display_in_timeline: BoolProperty(
name="Display in Timeline",
description="Display Markers Nav Bar in the Timeline toolbar",
default=False,
)
mnavbar_display_in_dopesheet: BoolProperty(
name="Display in Dopesheet",
description="Display Markers Nav Bar in the Dopesheet toolbar",
default=False,
)
mnavbar_display_in_vse: BoolProperty(
name="Display in VSE",
description="Display Markers Nav Bar in the VSE toolbar",
default=True,
)
mnavbar_display_addRename: BoolProperty(
name="Display Add and Rename",
description="Display buttons for Add and Rename markers",
default=True,
)
mnavbar_display_filter: BoolProperty(
name="Display Filter",
description="Display the filter tools",
default=True,
)

# Markers Nav Bar component controls ###

markerEmptyField: StringProperty(name=" ")

mnavbar_use_filter: BoolProperty(
name="Filter Markers",
default=False,
)

mnavbar_filter_text: StringProperty(
name="Filter Text",
default="",
)

# TOFIX: replace ops by functions
def _update_mnavbar_use_view_frame(self, context):
if self.mnavbar_use_view_frame:
# timeline
try:
bpy.ops.action.view_frame()
except Exception as e:
_logger.debug_ext(f"Exception in _update_mnavbar_use_view_frame. e: {e}")
# vse
try:
bpy.ops.sequencer.view_frame()
except Exception as e:
_logger.debug_ext(f"Exception in _update_mnavbar_use_view_frame. e: {e}")

mnavbar_use_view_frame: BoolProperty(
name="View Frame",
default=True,
update=_update_mnavbar_use_view_frame,
)

########################################################################
# stamp info ###
########################################################################
Expand Down
3 changes: 2 additions & 1 deletion shotmanager/addon_prefs/addon_prefs_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
from shotmanager.ui.dependencies_ui import drawDependencies
from shotmanager.utils.utils_ui import collapsable_panel

from shotmanager.prefs.features import draw_features_prefs
from shotmanager.prefs.prefs_features import draw_features_prefs


##################################################################################
# Draw
Expand Down
11 changes: 6 additions & 5 deletions shotmanager/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def initGlobalVariables():
devDebug = False

# change this value to force debug at start time
devDebug = True
devDebug = False

global devDebug_lastRedrawTime
devDebug_lastRedrawTime = -1
Expand Down Expand Up @@ -150,15 +150,16 @@ def getLoggingTags():
tags["SHOTS_PLAY_MODE"] = True

tags["RENDER"] = False
tags["LAYOUT"] = True
tags["LAYOUT"] = False
tags["RETIMER"] = True

tags["EDIT_IO"] = True

tags["TIMELINE_EVENT"] = False
tags["SHOTSTACK_EVENT"] = True
tags["EVENT"] = True
tags["SHOTSTACK_EVENT"] = False
tags["EVENT"] = False

# info tags
tags["RENDERTIME"] = True
tags["RENDERTIME"] = False

return tags
4 changes: 2 additions & 2 deletions shotmanager/features/greasepencil/greasepencil_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def draw_greasepencil_play_tools(self, context, shot, layersListDropdown=None):
leftSepFactor = 0.1

box = layout.box()
# utils_ui.drawSeparatorLine(layout)
# utils_ui.separatorLine(layout)

parentShot = props.getParentShotFromGpChild(editedGpencil)
objIsValid = parentShot is None
Expand Down Expand Up @@ -202,7 +202,7 @@ def draw_greasepencil_play_tools(self, context, shot, layersListDropdown=None):

drawMatRow(context, col, props, objIsGP)

utils_ui.drawSeparatorLine(box)
utils_ui.separatorLine(box)

# overlay tools
#########################
Expand Down
4 changes: 2 additions & 2 deletions shotmanager/features/storyboard/storyboard_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def draw_greasepencil_shot_properties(layout, context, shot):
# row = col.row()
# row.separator(factor=hSepFactor)

utils_ui.drawSeparatorLine(col, lower_height=1.4, higher_height=0.6)
utils_ui.separatorLine(col, padding_bottom=1.4, padding_top=0.6)

row = col.row()

Expand Down Expand Up @@ -568,7 +568,7 @@ def draw_greasepencil_global_properties(layout, context):
col.separator(factor=0.5)
sm_shots_global_settings_ui_cameras.draw_camera_global_settings(context, col, mode="STORYBOARD")

utils_ui.drawSeparatorLine(box, lower_height=0.0, higher_height=0.1)
utils_ui.separatorLine(box, padding_bottom=0.0, padding_top=0.1)

# overlays tools
#########################
Expand Down
Binary file added shotmanager/icons/MarkersNavBar_ViewFrame_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions shotmanager/operators/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
from bpy.props import BoolProperty, StringProperty, IntProperty

from shotmanager.utils import utils
from shotmanager.config import config
from shotmanager.operators.shots import convertMarkersFromCameraBindingToShots
from shotmanager.utils.utils import getSceneVSE, convertVersionIntToStr, clearMarkersFromCameraBinding
from shotmanager.utils.utils import getSceneVSE, convertVersionIntToStr
from shotmanager.utils.utils_markers import clearMarkersFromCameraBinding


from shotmanager.config import config
from shotmanager.config import sm_logging

_logger = sm_logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,25 @@
import bpy
from bpy.types import Operator

from shotmanager.utils.utils_ui import propertyColumn

from shotmanager.config import config


def draw_settings(context, layout):
"""Used in Shot Manager Feature Toggles panel"""
props = context.scene.UAS_shot_manager_props
prefs = config.getShotManagerPrefs()
# layout = self.layout

leftCol = layout.column()

# empty spacer column
row = leftCol.row()
col = row.column()
col.scale_x = 0.25
col.label(text=" ")
col = row.column(align=True)

col.prop(prefs, "display_shtStack_toolbar")

col.prop(props, "interactShotsStack_displayDisabledShots", text="Display Disabled Shots")
propCol = propertyColumn(layout)

col.prop(
propCol.prop(prefs, "display_shtStack_toolbar")
propCol.prop(props, "interactShotsStack_displayDisabledShots", text="Display Disabled Shots")
propCol.prop(
props,
"interactShotsStack_displayInCompactMode",
text="Compact Shots Display (= decrease visual stack height)",
)
# return {"FINISHED"}


# def draw_settings_in_menu(self, context):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import bpy

from shotmanager.utils.utils import sceneContainsCameraBinding
from shotmanager.utils.utils_markers import sceneContainsCameraBinding


from shotmanager.config import config
Expand Down
17 changes: 6 additions & 11 deletions shotmanager/overlay_tools/viewport_camera_hud/camera_hud_prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
Settings panel for the camera HUD tool
"""

from shotmanager.utils.utils_ui import propertyColumn

from shotmanager.config import config


Expand All @@ -27,15 +29,8 @@ def draw_settings(context, layout):
props = context.scene.UAS_shot_manager_props
prefs = config.getShotManagerPrefs()

leftCol = layout.column()

# empty spacer column
row = leftCol.row()
col = row.column()
col.scale_x = 0.25
col.label(text=" ")
col = row.column(align=True)
propCol = propertyColumn(layout)

col.prop(props, "camera_hud_display_in_viewports", text="Display Shot name in 3D Viewport")
col.prop(props, "camera_hud_display_in_pov", text="Display HUD in 3D Viewport")
col.prop(prefs, "cameraHUD_shotNameSize", text="Size of the shot names")
propCol.prop(props, "camera_hud_display_in_viewports", text="Display Shot name in 3D Viewport")
propCol.prop(props, "camera_hud_display_in_pov", text="Display HUD in 3D Viewport")
propCol.prop(prefs, "cameraHUD_shotNameSize", text="Size of the shot names")
6 changes: 3 additions & 3 deletions shotmanager/prefs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

from . import about
from . import dialog_menu
from . import features

# from . import general
from . import prefs_features
from . import prefs_overlay_tools
from . import prefs_project
from . import prefs_sequence
Expand All @@ -42,7 +42,7 @@ def register():
_logger.debug_ext(" - Registering Prefs Package", form="REG")

about.register()
features.register()
prefs_features.register()
dialog_menu.register()
# general.register()
prefs_overlay_tools.register()
Expand All @@ -68,5 +68,5 @@ def unregister():
prefs_overlay_tools.unregister()
# general.unregister()
dialog_menu.unregister()
features.unregister()
prefs_features.unregister()
about.unregister()
Loading

0 comments on commit 1e33cbf

Please sign in to comment.