Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1777 from pypeclub/feature/settings_conditional_dict
Browse files Browse the repository at this point in the history
Settings conditional dict
  • Loading branch information
iLLiCiTiT authored Jul 8, 2021
2 parents 0781667 + 696c72c commit e617873
Show file tree
Hide file tree
Showing 15 changed files with 1,260 additions and 35 deletions.
3 changes: 3 additions & 0 deletions openpype/settings/entities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
from .list_entity import ListEntity
from .dict_immutable_keys_entity import DictImmutableKeysEntity
from .dict_mutable_keys_entity import DictMutableKeysEntity
from .dict_conditional import DictConditionalEntity

from .anatomy_entities import AnatomyEntity

Expand Down Expand Up @@ -166,5 +167,7 @@

"DictMutableKeysEntity",

"DictConditionalEntity",

"AnatomyEntity"
)
10 changes: 9 additions & 1 deletion openpype/settings/entities/base_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def __init__(self, schema_data):
# Override state defines which values are used, saved and how.
# TODO convert to private attribute
self._override_state = OverrideState.NOT_DEFINED
self._ignore_missing_defaults = None

# These attributes may change values during existence of an object
# Default value, studio override values and project override values
Expand Down Expand Up @@ -285,7 +286,7 @@ def root_key(self):
pass

@abstractmethod
def set_override_state(self, state):
def set_override_state(self, state, ignore_missing_defaults):
"""Set override state and trigger it on children.
Method discard all changes in hierarchy and use values, metadata
Expand All @@ -295,8 +296,15 @@ def set_override_state(self, state):
Should start on root entity and when triggered then must be called on
all entities in hierarchy.
Argument `ignore_missing_defaults` should be used when entity has
children that are not saved or used all the time but override statu
must be changed and children must have any default value.
Args:
state (OverrideState): State to which should be data changed.
ignore_missing_defaults (bool): Ignore missing default values.
Entity won't raise `DefaultsNotDefined` and
`StudioDefaultsNotDefined`.
"""
pass

Expand Down
Loading

0 comments on commit e617873

Please sign in to comment.