Skip to content

Commit

Permalink
Merge branch '204-rename-add-on-name-in-bl_info' into 'main'
Browse files Browse the repository at this point in the history
Resolve "Rename add-on name in bl_info"

Closes #204

See merge request blender/public-projects/shotmanager-addon!111
  • Loading branch information
jatubi committed Aug 10, 2022
2 parents 3d9c439 + 3d46eaa commit 704fe3f
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 96 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
-----
## 2.0.210 (2022-08-09)
Changed the name of the add-on in the bl_info to "Ubisoft Shot Manager"

-----
## 2.0.206 (2022-08-04)
### Storyboard
Expand Down
31 changes: 17 additions & 14 deletions resources/wkzipaddon/wkzipaddon.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
"""Create a zip file to make the add-on ready to install
Copy this file to %AppData%\Roaming\Microsoft\Windows\SendTo\ and run it with a right click in
an explorer.
If the script is not visible in the SendTo submenu then place a shortcut to this file instead of the
file itself in the SendTo folder.
For Windows OS
Create a shortcut to this file and copy it to %AppData%\Roaming\Microsoft\Windows\SendTo\
Then run it with a right click in an explorer.
Usage:
Once this file is in the SendTo folder of Windows it is accessible in the right click menu.
In a file explorer go to your working directory, select the folder containing the addon code
(eg: /shotmanager), right click to display the menu then pick wkzipaddon.py.
This script will be ran and it will create an archive, cleaned from the .pyc, ready to
be installed in Blender.
Once this file is in the SendTo folder of Windows it is accessible in the right click menu.
In a file explorer go to your working directory, select the folder containing the addon code
(eg: /shotmanager), right click to display the menu then pick wkzipaddon.py.
This script will be ran and it will create an archive, cleaned from the .pyc, ready to
be installed in Blender.
"""


import zipfile
import os
from os.path import basename
import sys
from pathlib import Path


def main():
import sys
import os
from pathlib import Path

pathArr = sys.argv

Expand All @@ -47,7 +46,7 @@ def main():
# text_file.close()
return

outString += f"\nArg files to zip:"
outString += "\nArg files to zip:"
print("\nArgs:")
for i in range(1, len(pathArr)):
strg = f" Arg {i}: {pathArr[i]}"
Expand Down Expand Up @@ -140,6 +139,11 @@ def _getAddonVersion(init_file):
nameStr = _getAddonName(init_file)
versionStr = _getAddonVersion(init_file)

# if the category appears at the start of the name it is removed
categInd = nameStr.find(categStr)
if -1 != categInd:
nameStr = nameStr[len(categStr) :]

else:
categStr = ""
nameStr = ""
Expand Down Expand Up @@ -224,4 +228,3 @@ def _addFileToZip(zipObj, fullpath, root):

if __name__ == "__main__":
main()

23 changes: 9 additions & 14 deletions shotmanager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"""

import bpy

from bpy.props import BoolProperty, IntProperty, FloatProperty

from .config import config
Expand All @@ -47,16 +46,13 @@
from .properties import shots_global_settings

from . import prefs

from . import retimer
from .retimer import retimer_ui


from . import rendering
from .rendering import rendering_ui

from .scripts import precut_tools

from .scripts import rrs
from .ui import sm_ui

from .utils import utils
Expand All @@ -65,12 +61,11 @@
from .tools import frame_range
from .utils.utils_os import module_can_be_imported

from .scripts import rrs

from . import keymaps

from . import debug as sm_debug


from shotmanager.config import sm_logging

_logger = sm_logging.getLogger(__name__)
Expand All @@ -80,15 +75,15 @@


bl_info = {
"name": "Shot Manager",
"name": "Ubisoft Shot Manager",
"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, 206),
"version": (2, 0, 214),
"location": "View3D > Shot Mng",
"doc_url": "https://ubisoft-shotmanager.readthedocs.io",
"tracker_url": "https://github.com/ubisoft/shotmanager/issues",
"warning": "BETA Version",
# "warning": "BETA Version",
"category": "Ubisoft",
}

Expand All @@ -104,12 +99,12 @@ def register():

utils_ui.register()

sm_logging.initialize(addonName="Shot Manager", prefix="SM")
sm_logging.initialize(addonName="Ubisoft Shot Manager", prefix="SM")
if config.devDebug:
_logger.setLevel("DEBUG") # CRITICAL ERROR WARNING INFO DEBUG NOTSET

logger_level = f"Logger level: {sm_logging.getLevelName()}"
versionTupple = utils.display_addon_registered_version("Shot Manager", more_info=logger_level)
versionTupple = utils.display_addon_registered_version("Ubisoft Shot Manager", more_info=logger_level)

from .overlay_tools.workspace_info import workspace_info

Expand Down Expand Up @@ -319,7 +314,7 @@ def _update_UAS_shot_manager_identify_dopesheets(self, context):
)

if config.devDebug:
print(f"\n ------ Shot Manager debug: {config.devDebug} ------- ")
print(f"\n ------ Ubisoft Shot Manager debug: {config.devDebug} ------- ")

addon_prefs_inst = bpy.context.preferences.addons["shotmanager"].preferences
addon_prefs_inst.displaySMDebugPanel = False
Expand All @@ -338,7 +333,7 @@ def _update_UAS_shot_manager_identify_dopesheets(self, context):

def unregister():

utils.display_addon_registered_version("Shot Manager", unregister=True)
utils.display_addon_registered_version("Ubisoft Shot Manager", unregister=True)

# marche pas
_props = bpy.context.scene.UAS_shot_manager_props
Expand Down
10 changes: 5 additions & 5 deletions shotmanager/addon_prefs/addon_prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def version(self):
- an integer. x.y.z becomes xxyyyzzz (eg: "1.21.3" becomes 1021003)
Return None if the addon has not been found
"""
return utils.addonVersion("Shot Manager")
return utils.addonVersion("Ubisoft Shot Manager")

# def isReleaseVersion(self):
# """Return True if the current version is a released on"""
Expand Down Expand Up @@ -114,7 +114,7 @@ def dependency_min_supported_version(self, addon_name):
)

def initialize_shot_manager_prefs(self):
print("\nInitializing Shot Manager Preferences...")
print("\nInitializing Ubisoft Shot Manager Preferences...")

self.stb_frameTemplate.initialize(mode="ADDON_PREFS")
self.newAvailableVersion = 0
Expand Down Expand Up @@ -818,7 +818,7 @@ def _update_layersListDropdown(self, context):
)

########################################################################
### Overlay tools
# Overlay tools
########################################################################

# tools disabled during play
Expand Down Expand Up @@ -849,7 +849,7 @@ def _update_layersListDropdown(self, context):
options=set(),
)

### Retimer
# Retimer
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)",
Expand Down Expand Up @@ -909,7 +909,7 @@ def _update_toggle_overlays_turnOn_sequenceTimeline(self, context):
def _update_toggle_overlays_turnOn_interactiveShotsStack(self, context):
_logger.debug_ext("_update_toggle_overlays_turnOn_interactiveShotsStack")

## toggle on or off the overlay tools mode
# toggle on or off the overlay tools mode
if self.toggle_overlays_turnOn_interactiveShotsStack:
if not context.window_manager.UAS_shot_manager_display_overlay_tools:
context.window_manager.UAS_shot_manager_display_overlay_tools = True
Expand Down
4 changes: 2 additions & 2 deletions shotmanager/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def initGlobalVariables():

# preferences ##########
global defaultLayout
defaultLayout = "STORYBOARD"
# defaultLayout = "PREVIZ"
# defaultLayout = "STORYBOARD"
defaultLayout = "PREVIZ"

# ui ##########
global gMouseScreenPos
Expand Down
4 changes: 2 additions & 2 deletions shotmanager/data_patches/check_scene_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _getPropValue(prop_ower, prop_name):
checkStr += f"{spacer}Num scenes in file: {len(bpy.data.scenes)}"

sm_addon_is_loaded = _isAddonLoaded("shotmanager")
checkStr += f"{spacer}Shot Manager add-on is loaded: {sm_addon_is_loaded}"
checkStr += f"{spacer}Ubisoft Shot Manager add-on is loaded: {sm_addon_is_loaded}"

for scene in bpy.data.scenes:
spacer = "\n "
Expand All @@ -63,7 +63,7 @@ def _getPropValue(prop_ower, prop_name):

props = None
sm_data_in_scene = _sceneHasShotManagerData(scene)
checkStr += f"{spacer}Contains Shot Manager data: {sm_data_in_scene}"
checkStr += f"{spacer}Contains Ubisoft Shot Manager data: {sm_data_in_scene}"

if getattr(scene, "UAS_shot_manager_props", None) is not None:
props = scene.UAS_shot_manager_props
Expand Down
4 changes: 2 additions & 2 deletions shotmanager/handlers/sm_check_data_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ def shotMngHandler_load_post_checkDataVersion(self, context):
# f" *** Scene {scene.name}: The version of the Shot Manager data was not set - It has been fixed and is now {utils.convertVersionIntToStr(props.dataVersion)}"
# )
_logger.info_ext(
f" *** Scene {scene.name}: The version of the Shot Manager data is not set - Scene will be patched ***",
f" *** Scene {scene.name}: The version of the Ubisoft Shot Manager data is not set - Scene will be patched ***",
col="RED",
)

if props.dataVersion < latestVersionToPatch: # <= ???
_logger.info(
f" *** Scene {scene.name}: The version of the Shot Manager data is lower than the latest patch version - Need patching ***"
f" *** Scene {scene.name}: The version of the Ubisoft Shot Manager data is lower than the latest patch version - Need patching ***"
f"\n Data Version: {utils.convertVersionIntToStr(props.dataVersion)}, latest version to patch: {utils.convertVersionIntToStr(latestVersionToPatch)}"
)
numScenesToUpgrade += 1
Expand Down
2 changes: 1 addition & 1 deletion shotmanager/otio/exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def fillEditFile(scene, props, take, sceneFps, output_media_mode, rootPath):
name=f"{seq_name}{take_name}",
global_start_time=opentimelineio.opentime.from_frames(startFrame, sceneFps),
)
timeline.metadata["exported_with"] = "Shot Manager V. " + props.version()[0]
timeline.metadata["exported_with"] = "Ubisoft Shot Manager V. " + props.version()[0]
from datetime import datetime

now = datetime.now()
Expand Down
2 changes: 1 addition & 1 deletion shotmanager/prefs/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def draw(self, context):
###############
row = col.row()
row.separator()
row.label(text=f"Add-on Category: {addonCategory('Shot Manager')}")
row.label(text=f"Add-on Category: {addonCategory('Ubisoft Shot Manager')}")

# Authors
###############
Expand Down
20 changes: 8 additions & 12 deletions shotmanager/properties/props.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def version(self):
- an integer. x.y.z becomes xxyyyzzz (eg: "1.21.3" becomes 1021003)
Return None if the addon has not been found
"""
return utils.addonVersion("Shot Manager")
return utils.addonVersion("Ubisoft Shot Manager")

dataVersion: IntProperty(
""" Data Version is of the form xxyyyzzz, integer generated from the string version "xx.yyy.zzz"
Expand All @@ -181,7 +181,7 @@ def version(self):
)

def initialize_shot_manager(self):
_logger.info_ext(f"\nInitializing Shot Manager in the current scene ({bpy.context.scene.name})...")
_logger.info_ext(f"\nInitializing Ubisoft Shot Manager in the current scene ({bpy.context.scene.name})...")
prefs = bpy.context.preferences.addons["shotmanager"].preferences

# self.parentScene = self.getParentScene()
Expand Down Expand Up @@ -1497,14 +1497,6 @@ def setCurrentLayout(self, layoutMode):
self.current_layout_index = ind
break

def setCurrentLayoutByIndex(self, layoutIndex):
"""Args:
layoutMode: Can be 0 for "STORYBOARD or 1 for PREVIZ"""
if layoutIndex < len(self.layouts):
self.current_layout_index = layoutIndex
else:
self.current_layout_index = -1

def getLayout(self, layoutMode):
"""Args:
layoutMode: Can be "STORYBOARD or PREVIZ"""
Expand All @@ -1517,8 +1509,12 @@ def getCurrentLayoutIndex(self):
return self.current_layout_index

def setCurrentLayoutByIndex(self, layoutIndex):
if 0 <= layoutIndex <= 1:
self.current_layout_index
"""Args:
layoutMode: Can be 0 for "STORYBOARD or 1 for PREVIZ"""
if 0 <= layoutIndex < len(self.layouts):
self.current_layout_index = layoutIndex
else:
self.current_layout_index = -1

def createLayoutSettings(self):
_logger.debug_ext("createLayerSettings", col="GREEN", tag="LAYOUT")
Expand Down
2 changes: 1 addition & 1 deletion shotmanager/rendering/rendering_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

class UAS_PT_ShotManagerRenderPanelStdalone(Panel):
bl_idname = "UAS_PT_ShotManagerRenderPanelStdalone"
bl_label = " Shot Manager - Render" + " - V. " + utils.addonVersion("Shot Manager")[0]
bl_label = " Shot Manager - Render" + " - V. " + utils.addonVersion("Ubisoft Shot Manager")[0]
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Shot Mng - Render"
Expand Down
Loading

0 comments on commit 704fe3f

Please sign in to comment.