8665292c7b
- Improved typing in some areas. - Improved code readability in some areas. - Delete bone constraints would error out if the user is in edit mode, we now start in Object mode first. - Fixed Eye tracking Ajust string not being in the translation files. - There is now a selection box to select the mesh in the current active armature for viseme creation instead of the user having to select it in the 3D scene. - Viseme preview mode won't allow you to start it if your in a other mode, you need to be in Object mode now. - Combine Materials won't allow you to start it if your in a other mode, you need to be in Object mode now. - Added Japanese and Korean UI Languages.
28 lines
965 B
Python
28 lines
965 B
Python
import logging
|
|
from typing import Optional, Any
|
|
from bpy.types import Context
|
|
|
|
logger = logging.getLogger('avatar_toolkit')
|
|
|
|
def configure_logging(enabled: bool = False) -> None:
|
|
"""Configure logging for Avatar Toolkit"""
|
|
logger.setLevel(logging.DEBUG if enabled else logging.WARNING)
|
|
|
|
# Remove existing handlers
|
|
for handler in logger.handlers[:]:
|
|
logger.removeHandler(handler)
|
|
|
|
if enabled:
|
|
handler = logging.StreamHandler()
|
|
handler.setLevel(logging.DEBUG)
|
|
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
handler.setFormatter(formatter)
|
|
logger.addHandler(handler)
|
|
|
|
def update_logging_state(self: Any, context: Context) -> None:
|
|
"""Update logging state based on user preference"""
|
|
from .addon_preferences import save_preference
|
|
enabled = self.enable_logging
|
|
save_preference("enable_logging", enabled)
|
|
configure_logging(enabled)
|