Merge pull request #5303 from tokejepsen/bugfix/maya_creators_apply_settings

This commit is contained in:
Milan Kolar 2023-07-27 09:14:43 +02:00 committed by GitHub
commit 0b58144f2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -222,6 +222,8 @@ class MayaCreatorBase(object):
@six.add_metaclass(ABCMeta)
class MayaCreator(NewCreator, MayaCreatorBase):
settings_name = None
def create(self, subset_name, instance_data, pre_create_data):
members = list()
@ -258,6 +260,24 @@ class MayaCreator(NewCreator, MayaCreatorBase):
default=True)
]
def apply_settings(self, project_settings, system_settings):
"""Method called on initialization of plugin to apply settings."""
settings_name = self.settings_name
if settings_name is None:
settings_name = self.__class__.__name__
settings = project_settings["maya"]["create"]
settings = settings.get(settings_name)
if settings is None:
self.log.debug(
"No settings found for {}".format(self.__class__.__name__)
)
return
for key, value in settings.items():
setattr(self, key, value)
class MayaAutoCreator(AutoCreator, MayaCreatorBase):
"""Automatically triggered creator for Maya.

View file

@ -15,6 +15,7 @@ class CreateArnoldSceneSource(plugin.MayaCreator):
label = "Arnold Scene Source"
family = "ass"
icon = "cube"
settings_name = "CreateAss"
expandProcedurals = False
motionBlur = True