Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f32a4a4
base of load api
iLLiCiTiT Sep 8, 2025
8664092
comment 'id'
iLLiCiTiT Sep 9, 2025
ddd16e2
change method name
iLLiCiTiT Sep 9, 2025
c9585e7
Merge branch 'develop' into feature/load-api
iLLiCiTiT Sep 9, 2025
ceb5088
Merge branch 'develop' into feature/load-api
iLLiCiTiT Sep 23, 2025
a7dce28
moved track changed wrapper into ayon core lib
iLLiCiTiT Sep 23, 2025
3d36ac5
use track item from lib now
iLLiCiTiT Sep 23, 2025
771f111
changed ContainerItem class
iLLiCiTiT Sep 23, 2025
97d8118
fix one more usage of 'TrackDictChangesItem'
iLLiCiTiT Sep 23, 2025
e70b2d2
add exceptions.py to load api
iLLiCiTiT Sep 23, 2025
b86c515
Merge branch 'develop' into feature/load-api
iLLiCiTiT Sep 23, 2025
aee3ffb
added wrapper methods to load context
iLLiCiTiT Oct 6, 2025
2eaf44f
ContainerItem does not use 'data' to store "generic" data
iLLiCiTiT Oct 6, 2025
ffb963f
change how container items are stored
iLLiCiTiT Oct 6, 2025
e5e7a11
added load plugin switch methods
iLLiCiTiT Oct 6, 2025
e71d131
added new wrappers
iLLiCiTiT Oct 6, 2025
b6cf5a1
add missing logger
iLLiCiTiT Oct 6, 2025
2ca5923
add is dirty
iLLiCiTiT Oct 6, 2025
b2cdf42
add changes calculation
iLLiCiTiT Oct 6, 2025
6a38b35
Merge branch 'develop' into feature/load-api
iLLiCiTiT Oct 10, 2025
3904944
Merge branch 'develop' into feature/load-api
iLLiCiTiT Oct 21, 2025
bc48518
added docstrings
iLLiCiTiT Oct 23, 2025
e778e78
added typehints
iLLiCiTiT Oct 23, 2025
d2eab75
use 'scene_identifier' instead of 'container_id'
iLLiCiTiT Nov 26, 2025
a9280bd
Merge branch 'develop' into feature/load-api
iLLiCiTiT Nov 26, 2025
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 client/ayon_core/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
CacheItem,
NestedCacheItem,
)
from .track_changes import TrackDictChangesItem
from .events import (
emit_event,
register_event_callback
Expand Down Expand Up @@ -161,6 +162,8 @@
"CacheItem",
"NestedCacheItem",

"TrackDictChangesItem",

"emit_event",
"register_event_callback",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
_EMPTY_VALUE = object()


class TrackChangesItem:
class TrackDictChangesItem:
"""Helper object to track changes in data.

Has access to full old and new data and will create deep copy of them,
so it is not needed to create copy before passed in.

Can work as a dictionary if old or new value is a dictionary. In
that case received object is another object of 'TrackChangesItem'.
that case received object is another object of 'TrackDictChangesItem'.

Goal is to be able to get old or new value as was or only changed values
or get information about removed/changed keys, and all of that on
Expand Down Expand Up @@ -39,7 +39,7 @@ class TrackChangesItem:
... "key_3": "value_3"
... }

>>> changes = TrackChangesItem(old_value, new_value)
>>> changes = TrackDictChangesItem(old_value, new_value)
>>> changes.changed
True

Expand Down Expand Up @@ -280,7 +280,7 @@ def _prepare_sub_items(self):
old_value = self.old_value
if self._old_is_dict and self._new_is_dict:
for key in self.available_keys:
item = TrackChangesItem(
item = TrackDictChangesItem(
old_value.get(key), new_value.get(key)
)
sub_items[key] = item
Expand All @@ -294,7 +294,7 @@ def _prepare_sub_items(self):
for key in available_keys:
# NOTE Use '_EMPTY_VALUE' because old value could be 'None'
# which would result in "unchanged" item
sub_items[key] = TrackChangesItem(
sub_items[key] = TrackDictChangesItem(
old_value.get(key), _EMPTY_VALUE
)

Expand All @@ -305,7 +305,7 @@ def _prepare_sub_items(self):
for key in available_keys:
# NOTE Use '_EMPTY_VALUE' because new value could be 'None'
# which would result in "unchanged" item
sub_items[key] = TrackChangesItem(
sub_items[key] = TrackDictChangesItem(
_EMPTY_VALUE, new_value.get(key)
)

Expand Down
7 changes: 3 additions & 4 deletions client/ayon_core/pipeline/create/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import ayon_api

from ayon_core.settings import get_project_settings
from ayon_core.lib import is_func_signature_supported
from ayon_core.lib import is_func_signature_supported, TrackDictChangesItem
from ayon_core.lib.events import QueuedEventSystem
from ayon_core.lib.attribute_definitions import get_default_values
from ayon_core.host import IWorkfileHost, IPublishHost
Expand All @@ -40,7 +40,6 @@
UnavailableSharedData,
HostMissRequiredMethod,
)
from .changes import TrackChangesItem
from .structures import (
PublishAttributes,
ConvertorItem,
Expand Down Expand Up @@ -1126,10 +1125,10 @@ def context_data_to_store(self) -> dict[str, Any]:
"publish_attributes": self._publish_attributes.data_to_store()
}

def context_data_changes(self) -> TrackChangesItem:
def context_data_changes(self) -> TrackDictChangesItem:
"""Changes of attributes."""

return TrackChangesItem(
return TrackDictChangesItem(
self._original_context_data, self.context_data_to_store()
)

Expand Down
4 changes: 2 additions & 2 deletions client/ayon_core/pipeline/create/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import typing
from typing import Optional, Dict, List, Any

from ayon_core.lib import TrackDictChangesItem
from ayon_core.lib.attribute_definitions import (
AbstractAttrDef,
UnknownDef,
Expand All @@ -17,7 +18,6 @@
)

from .exceptions import ImmutableKeyError
from .changes import TrackChangesItem

if typing.TYPE_CHECKING:
from .creator_plugins import BaseCreator
Expand Down Expand Up @@ -809,7 +809,7 @@ def set_parent(
def changes(self):
"""Calculate and return changes."""

return TrackChangesItem(self.origin_data, self.data_to_store())
return TrackDictChangesItem(self.origin_data, self.data_to_store())

def mark_as_stored(self):
"""Should be called when instance data are stored.
Expand Down
Loading
Loading