Skip to content

Commit

Permalink
Fix error after renaming a folder
Browse files Browse the repository at this point in the history
Fix database error when no database file exists
Fix maya items not showing outside of maya
  • Loading branch information
krathjen committed Sep 28, 2017
1 parent ed1e697 commit e556212
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
6 changes: 3 additions & 3 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

import studiolibrary

if studiolibrary.isMaya():
import studiolibrarymaya
studiolibrarymaya.setup()

import studiolibrarymaya
studiolibrarymaya.setup()
6 changes: 6 additions & 0 deletions database.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ def _write(self, data):
data = data.replace(relPath, '.')
data = data.replace(relPath2, '..')

path = self.path()

dirname = os.path.dirname(path)
if not os.path.exists(dirname):
os.makedirs(dirname)

with open(self.path(), "w") as f:

# Test the given data by converting it to a json object.
Expand Down
2 changes: 1 addition & 1 deletion librarywidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ def showFolderRenameDialog(self, parent=None):
if accept:
path = studiolibrary.renamePath(path, name)
self.refreshFolders()
self.selectedFolderPath(path)
self.selectFolderPath(path)

def showCreateFolderDialog(self, parent=None):
"""
Expand Down
10 changes: 6 additions & 4 deletions packages/studiolibrarymaya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,19 @@ def setup():
:rtype: None
"""
import studiolibrarymaya.mayalibrarywidget
try:
import studiolibrarymaya.mayalibrarywidget
# Enable the Maya closed event
enableMayaClosedEvent()
except ImportError, e:
logging.exception(e)

# The following items are registered on import.
from studiolibrarymaya import animitem
from studiolibrarymaya import poseitem
from studiolibrarymaya import mirroritem
from studiolibrarymaya import setsitem

# Enable the Maya closed event
enableMayaClosedEvent()


def enableMayaClosedEvent():
"""
Expand Down

0 comments on commit e556212

Please sign in to comment.