Skip to content

Commit

Permalink
Reduce the code base and remove legacy code
Browse files Browse the repository at this point in the history
These changes are to help with maintaining the project. Many API methods have been changed and removed, so the major version will be changed to 2+.

- Remove library class
- Remove libraries menu
- Remove settings module
- Remove metafile module
- Remove analytics module
- Remove settingsDialog class
- Remove the hcolorbar widget
- Remove metafile methods from libraryItem
- Remove studiolibrarymaya support for the .list and .dict formats
- Remove studiolibrary.window, studiolibrary.library and studiolibrary.libraries method
- Rename example1 to examples
- Merge the utils module and the api module to cmds.py
- Add support for relative paths in the database
- Add better support for renaming paths in the database
- Add a new example for creating a custom library widget
- Fix mirrortable error when no mirrortable was found
- Fix methods shadowing each other in the combinedwidget
  • Loading branch information
krathjen committed Aug 1, 2017
1 parent d43da5b commit 9dae6d8
Show file tree
Hide file tree
Showing 170 changed files with 1,666 additions and 5,165 deletions.
17 changes: 0 additions & 17 deletions .gitattributes

This file was deleted.

15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
## Studio Library
## Studio Library 2 - Beta

Studio Library is a free python script for managing poses and animation in Maya.

* www.studiolibrary.com

## What's changed in version 2?
Most of the changes in version 2 are to help with maintaining the project.
There have been many API changes, so the major version was changed.

* Docking in Maya is not supported yet
* Items created before version 1.5.x (mid-2014) are no longer supported
* Creating and switching between libraries from the UI is no longer supported

## Contributing

Whether it's reporting bugs, discussing ideas or committing code: Contributions to Studio Library are welcome!

* [Branch naming style](https://stackoverflow.com/questions/273695/git-branch-naming-best-practices)

* [Commit messages style](https://github.com/erlang/otp/wiki/Writing-good-commit-messages)

* Please follow the same workflow as the "[GitHub flow](https://guides.github.com/introduction/flow/index.html)".

* Please follow the same coding style as the "[Python Qt Style Guidelines](http://bitesofcode.blogspot.co.uk/2011/10/pyqt-coding-style-guidelines.html)".


## How to Install?
## How to install?

1. Download and unzip the *studiolibrary.zip* file

Expand Down
103 changes: 10 additions & 93 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@
__encoding__ = sys.getfilesystemencoding()

_resource = None
_analytics = None


PATH = unicode(os.path.abspath(__file__), __encoding__)
DIRNAME = os.path.dirname(PATH).replace('\\', '/')
PACKAGES_PATH = DIRNAME + "/packages"
RESOURCE_PATH = DIRNAME + "/gui/resource"
DIRNAME = os.path.dirname(PATH)
PACKAGES_PATH = os.path.join(DIRNAME, "packages")
RESOURCE_PATH = os.path.join(DIRNAME, "resource")
HELP_URL = "http://www.studiolibrary.com"

HOME_PATH = os.getenv('APPDATA') or os.getenv('HOME')
LIBRARIES_PATH = HOME_PATH + "/StudioLibrary/Libraries"

LIBRARY_WIDGET_CLASS = None

This comment has been minimized.

Copy link
@kalemas

kalemas Oct 18, 2017

Collaborator

Hi @krathjen, de you/we need this at all? If you encourage developers to use their own custom widget?



def setup(path):
Expand All @@ -42,7 +40,6 @@ def setup(path):
:rtype: None
"""
if os.path.exists(path) and path not in sys.path:
print 'Adding "{path}" to the sys.path'.format(path=path)
sys.path.append(path)


Expand All @@ -51,22 +48,12 @@ def setup(path):

import studioqt

from studiolibrary.main import main

from studiolibrary.core.utils import *
from studiolibrary.core.metafile import MetaFile
from studiolibrary.core.settings import Settings
from studiolibrary.core.database import Database
from studiolibrary.core.analytics import Analytics

from studiolibrary.gui.librarywidget import LibraryWidget
from studiolibrary.gui.previewwidget import PreviewWidget
from studiolibrary.gui.librariesmenu import LibrariesMenu
from studiolibrary.gui.settingsdialog import SettingsDialog
from studiolibrary.cmds import *
from studiolibrary.database import Database
from studiolibrary.libraryitem import LibraryItem
from studiolibrary.librarywidget import LibraryWidget

from studiolibrary.api.cmds import *
from studiolibrary.api.library import Library
from studiolibrary.api.libraryitem import LibraryItem
from studiolibrary.main import main


def resource():
Expand All @@ -92,52 +79,6 @@ def version():
return __version__


def analytics():
"""
:rtype: studiolibrary.analytics.Analytics
"""
global _analytics

if not _analytics:

_analytics = Analytics(
tid=Analytics.DEFAULT_ID,
name="StudioLibrary",
version=__version__
)

_analytics.setEnabled(Analytics.ENABLED)
return _analytics


def windows():
"""
Return a list of all the loaded library windows.
:rtype: list[MainWindow]
"""
return Library.libraryWidgets()


def library(name=None):
"""
Return a library by name.
:type name: str
:rtype: studiolibrary.Library
"""
return Library.instance(name)


def libraries():
"""
Return a list of the loaded libraries.
:rtype: list[studiolibrary.Library]
"""
return Library.libraries()


def loadFromCommand():
"""
Triggered when the Studio Library is loaded from the command line.
Expand All @@ -159,32 +100,8 @@ def loadFromCommand():
main(name=name)


def about():
"""
Return a small description about the Studio Library.
:rtype str
"""
msg = u"""
-------------------------------
Studio Library is a free python script for managing poses and animation in Maya.
Comments, suggestions and bug reports are welcome.
Version: {version}
Package: {package}
www.studiolibrary.com
[email protected]
--------------------------------
"""
msg = msg.format(version=__version__, package=PATH)
return msg


from studiolibrary import config

from studiolibrary import migrate
migrate.migrate()

if __name__ == "__main__":
loadFromCommand()
Expand Down
12 changes: 0 additions & 12 deletions api/__init__.py

This file was deleted.

Loading

0 comments on commit 9dae6d8

Please sign in to comment.