fix: implementation not found if a new type is added

This commit is contained in:
Swann 2020-09-23 17:37:21 +02:00
parent 9b1b8f11fd
commit 4f731c6640
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB

View File

@ -74,7 +74,7 @@ class SessionStartOperator(bpy.types.Operator):
delayables.clear()
logger = logging.getLogger()
if len(logger.handlers)==1:
if len(logger.handlers) == 1:
formatter = logging.Formatter(
fmt='%(asctime)s CLIENT %(levelname)-8s %(message)s',
datefmt='%H:%M:%S'
@ -106,7 +106,11 @@ class SessionStartOperator(bpy.types.Operator):
supported_bl_types.append(type_module_class.bl_id)
# Retreive local replicated types settings
if type_impl_name not in settings.supported_datablocks:
logging.info(f"{type_impl_name} not found, \
regenerate type settings...")
settings.generate_supported_types()
type_local_config = settings.supported_datablocks[type_impl_name]
bpy_factory.register_type(
@ -620,7 +624,7 @@ class ClearCache(bpy.types.Operator):
return True
def execute(self, context):
cache_dir = utils.get_preferences().cache_directory
cache_dir = utils.get_preferences().cache_directory
try:
for root, dirs, files in os.walk(cache_dir):
for name in files:
@ -638,6 +642,7 @@ class ClearCache(bpy.types.Operator):
row = self.layout
row.label(text=f" Do you really want to remove local cache ? ")
classes = (
SessionStartOperator,
SessionStopOperator,