Bugfix: houdini hard coded project settings (#5400)

* get poject settings in creator

* add comment about reading ext from project settings

* update validator to get project settings

* update comment about reading ext from project settings

* revert explicit edits it's automated

* remove redundant line
This commit is contained in:
Mustafa Zarkash 2023-08-04 15:28:33 +03:00 committed by GitHub
parent 250dcbcd91
commit bdaf86700b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -167,6 +167,7 @@ class HoudiniCreatorBase(object):
class HoudiniCreator(NewCreator, HoudiniCreatorBase):
"""Base class for most of the Houdini creator plugins."""
selected_nodes = []
settings_name = None
def create(self, subset_name, instance_data, pre_create_data):
try:
@ -294,3 +295,21 @@ class HoudiniCreator(NewCreator, HoudiniCreatorBase):
"""
return [hou.ropNodeTypeCategory()]
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["houdini"]["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)

View file

@ -13,6 +13,8 @@ class CreateArnoldAss(plugin.HoudiniCreator):
defaults = ["Main"]
# Default extension: `.ass` or `.ass.gz`
# however calling HoudiniCreator.create()
# will override it by the value in the project settings
ext = ".ass"
def create(self, subset_name, instance_data, pre_create_data):

View file

@ -7,8 +7,6 @@ from openpype.pipeline import (
)
from openpype.pipeline.publish import RepairAction
from openpype.pipeline.publish import RepairAction
class ValidateWorkfilePaths(
pyblish.api.InstancePlugin, OptionalPyblishPluginMixin):