Skip to content

Commit

Permalink
Now callbacks are created OpenMaya 2.0 API
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoveda committed Feb 4, 2021
1 parent 57f9b26 commit 4e6e4ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion artella/dccs/maya/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from artella.core.dcc import callback

import maya.OpenMaya as OpenMaya
import maya.api.OpenMaya as OpenMaya


class Callbacks(object):
Expand Down
8 changes: 4 additions & 4 deletions artella/dccs/maya/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def _before_save(self, *args):

self.update_paths(show_dialogs=False, skip_save=True)

def _before_open_check(self, retcode, maya_file, client_data=None):
def _before_open_check(self, maya_file, client_data=None):
"""
Internal callback function that is called before a Maya scene is opened
Expand All @@ -206,7 +206,7 @@ def _before_open_check(self, retcode, maya_file, client_data=None):
else:
get_deps_plugin.get_non_available_dependencies(file_path)

OpenMaya.MScriptUtil.setBool(retcode, True)
return True

def _after_load_reference(self, *args):
"""
Expand All @@ -220,7 +220,7 @@ def _after_load_reference(self, *args):

self.validate_environment_for_callback('AfterLoadReference')

def _before_reference_check(self, retcode, maya_file, client_data=None):
def _before_reference_check(self, maya_file, client_data=None):
"""
Internal callback function that is called before a Maya reference is opened
Expand All @@ -238,4 +238,4 @@ def _before_reference_check(self, retcode, maya_file, client_data=None):
convert_path = dccplugin.DccPlugin().convert_path(raw_full_name)
maya_file.setRawFullName(convert_path)

OpenMaya.MScriptUtil.setBool(retcode, True)
return True

0 comments on commit 4e6e4ee

Please sign in to comment.