diff --git a/src/studiolibrary/packages/studiolibraryitems/__init__.py b/src/studiolibrary/packages/studiolibraryitems/__init__.py index 819668a9..44e74f94 100644 --- a/src/studiolibrary/packages/studiolibraryitems/__init__.py +++ b/src/studiolibrary/packages/studiolibraryitems/__init__.py @@ -40,6 +40,15 @@ def settings(): """ settings = studiolibrary.Settings.instance("StudioLibrary", "ItemSettings") + # Shared options + settings.setdefault("namespaces", []) + settings.setdefault("namespaceOption", "file") + + settings.setdefault("iconToggleBoxChecked", True) + settings.setdefault("infoToggleBoxChecked", True) + settings.setdefault("optionsToggleBoxChecked", True) + settings.setdefault("namespaceToggleBoxChecked", True) + # Anim options settings.setdefault('byFrame', 1) settings.setdefault('fileType', DEFAULT_FILE_TYPE) diff --git a/src/studiolibrary/packages/studiolibraryitems/animitem.py b/src/studiolibrary/packages/studiolibraryitems/animitem.py index bf9a7fd8..017be952 100644 --- a/src/studiolibrary/packages/studiolibraryitems/animitem.py +++ b/src/studiolibrary/packages/studiolibraryitems/animitem.py @@ -582,7 +582,7 @@ def validateFrameRange(self): """ if self.startFrame() is None or self.endFrame() is None: msg = "Please choose a start frame and an end frame." - raise ValidateAnimationError(msg) + raise ValidateAnimError(msg) def save(self, objects, path, iconPath, description): """ @@ -634,8 +634,6 @@ def __init__(self, *args, **kwargs): self.connect(self.ui.connectCheckBox, QtCore.SIGNAL('stateChanged(int)'), self.connectChanged) self.connect(self.ui.option, QtCore.SIGNAL('currentIndexChanged(const QString&)'), self.optionChanged) - self.loadSettings() - def setItem(self, item): """ :type item: AnimItem diff --git a/src/studiolibrary/packages/studiolibraryitems/transferitem.py b/src/studiolibrary/packages/studiolibraryitems/transferitem.py index 938efb56..78646d08 100644 --- a/src/studiolibrary/packages/studiolibraryitems/transferitem.py +++ b/src/studiolibrary/packages/studiolibraryitems/transferitem.py @@ -51,7 +51,7 @@ class ValidateError(TransferItemError): class NamespaceOption: - FromFile = "pose" + FromFile = "file" FromCustom = "custom" FromSelection = "selection" @@ -375,7 +375,7 @@ def namespaceFromCustom(self): :rtype: list[str] """ - return self.settings().get("namespaces", "") + return self.settings().get("namespaces", []) def setCustomNamespaces(self, namespaces): """ @@ -971,12 +971,12 @@ def setState(self, state): """ :type state: dict """ - namespaceOption = state.get("namespaceOption", "") - self.setNamespaceOption(namespaceOption) - - namespaces = state.get("namespaces", "") + namespaces = state.get("namespaces", []) self.setNamespaces(namespaces) + namespaceOption = state.get("namespaceOption", NamespaceOption.FromFile) + self.setNamespaceOption(namespaceOption) + toggleBoxChecked = state.get("iconToggleBoxChecked", True) self.ui.iconToggleBoxFrame.setVisible(toggleBoxChecked) self.ui.iconToggleBoxButton.setChecked(toggleBoxChecked)