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

Settings conditional dict #1777

Merged
merged 54 commits into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c98aafe
base of dict contitional
iLLiCiTiT Jun 28, 2021
6c63bc0
added example schema for reference
iLLiCiTiT Jun 28, 2021
1063f82
implemented `_item_initalization` similar to 'dict' entity
iLLiCiTiT Jun 28, 2021
82f1817
implemented _add_children method
iLLiCiTiT Jun 28, 2021
694f6b5
added schema validations of conditional dictionary
iLLiCiTiT Jun 28, 2021
ff70186
implemented `get_child_path`
iLLiCiTiT Jun 28, 2021
218158d
implemented base dictionary methods
iLLiCiTiT Jun 28, 2021
9ccc667
implemented idea of set value
iLLiCiTiT Jun 28, 2021
469dcc0
implemented change callbacks
iLLiCiTiT Jun 28, 2021
be1f0f7
implemented set_override_state
iLLiCiTiT Jun 28, 2021
92d0c9f
implemented `value` and `settings_value`
iLLiCiTiT Jun 28, 2021
04207c6
implemented modification and override properties
iLLiCiTiT Jun 28, 2021
58ade82
implemented update current metadata
iLLiCiTiT Jun 28, 2021
1f9ba64
implemented prepare value
iLLiCiTiT Jun 28, 2021
f47ec0d
implemented update methods
iLLiCiTiT Jun 28, 2021
baf7066
implemented actions for conditional dictionary
iLLiCiTiT Jun 28, 2021
f70b193
implemented reset_callbacks method
iLLiCiTiT Jun 28, 2021
1048a12
import DictConditionalEntity in entities init
iLLiCiTiT Jun 28, 2021
e8f7f14
fix example schema
iLLiCiTiT Jun 28, 2021
85a3dd1
fix dict vs. list approach
iLLiCiTiT Jun 28, 2021
16ac770
created copy of DictConditionalWidget as base for DictConditionalWidget
iLLiCiTiT Jun 28, 2021
c3614db
removed checkbox checks as checkbox is not available for conditional …
iLLiCiTiT Jun 28, 2021
1b1ce1f
modified _prepare_entity_layouts to be able to store result into pass…
iLLiCiTiT Jun 28, 2021
9131982
added few required attributes
iLLiCiTiT Jun 28, 2021
84f725b
modified how preparation of layout works
iLLiCiTiT Jun 28, 2021
2ebd5da
store content of each enum key to different widget
iLLiCiTiT Jun 28, 2021
cc72287
modified how entity widgets are created and when
iLLiCiTiT Jun 28, 2021
c8a5de8
define content widget based on map_id and entity id
iLLiCiTiT Jun 28, 2021
313a78a
trigger change of visibility on change of enum
iLLiCiTiT Jun 28, 2021
b344e0c
set_entity_value triggers on entity change
iLLiCiTiT Jun 28, 2021
c9ee4e5
added column stretch to grid layout
iLLiCiTiT Jun 28, 2021
e1129bd
fix keys method
iLLiCiTiT Jun 29, 2021
4bff4a8
force to be a group
iLLiCiTiT Jun 29, 2021
40f87f2
few minor fixes of entity
iLLiCiTiT Jun 29, 2021
3d59ba1
current_enum is dynamic property
iLLiCiTiT Jun 29, 2021
f3ae791
make sure all keys are available in all variables
iLLiCiTiT Jun 29, 2021
0e0e527
items vs. values fix
iLLiCiTiT Jun 29, 2021
d58c8f1
added argument ignore_missing_defaults to set_override_state method
iLLiCiTiT Jun 29, 2021
0ed3a2e
Use ignore missing defaults in conditional dictionary children that a…
iLLiCiTiT Jun 29, 2021
c1d6db4
added few comments and docstring
iLLiCiTiT Jun 29, 2021
3b217c5
added enum key validation
iLLiCiTiT Jun 29, 2021
605a045
include enum_key in builtin methods
iLLiCiTiT Jun 29, 2021
082e453
fix variable name usage
iLLiCiTiT Jun 29, 2021
905db94
added dict-conditional to readme
iLLiCiTiT Jun 29, 2021
df37c2e
removed example schema
iLLiCiTiT Jun 29, 2021
672ee1d
store ignore_missing_defaults and reuse it on callbacks
iLLiCiTiT Jun 29, 2021
477b4ec
removed unused imports
iLLiCiTiT Jun 29, 2021
7337c0c
Merge branch 'develop' into feature/settings_conditional_dict
iLLiCiTiT Jun 30, 2021
ca7d91a
fix typos
iLLiCiTiT Jun 30, 2021
898157c
fixed typo
iLLiCiTiT Jul 7, 2021
ec01e14
added missing attributes
iLLiCiTiT Jul 7, 2021
1cb8d0f
added example of conditional dictionary
iLLiCiTiT Jul 7, 2021
54eb42f
fix ignoring of missing defaults
iLLiCiTiT Jul 8, 2021
696c72c
remove unusued variable
iLLiCiTiT Jul 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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