Separate get_template_name into its own method + use self.default_template_name

This commit is contained in:
Roy Nieterau 2022-03-26 20:09:08 +01:00
parent 8f8b578f0c
commit 6ff7167d54

View file

@ -172,14 +172,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
)
)
# Define publish template name from profiles
filter_criteria = self.get_profile_filter_criteria(instance)
profile = filter_profiles(self.template_name_profiles,
filter_criteria,
logger=self.log)
template_name = "publish"
if profile:
template_name = profile["template_name"]
template_name = self._get_template_name(instance)
subset = self.register_subset(instance)
@ -582,6 +575,19 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
return families
def _get_template_name(self, instance):
"""Return anatomy template name to use for integration"""
# Define publish template name from profiles
filter_criteria = self.get_profile_filter_criteria(instance)
profile = filter_profiles(self.template_name_profiles,
filter_criteria,
logger=self.log)
template_name = self.default_template_name
if profile:
template_name = profile["template_name"]
return template_name
def register_subset(self, instance):
asset = instance.data.get("assetEntity")
subset_name = instance.data["subset"]