Skip to content

Conversation

@phorward
Copy link
Member

@phorward phorward commented Sep 1, 2025

I just found out that the List.clone-prototype function does not copy values correctly.
It was strange, but this simply fixed it, I think it has to do with the intermixing of accessedValues, renderAccessedValues and dbEntity.

This mess must be entirely cleaned up.

@phorward phorward added the bug(fix) Something isn't working or address a specific issue or vulnerability label Sep 1, 2025
@phorward phorward added this to the ViUR-core v3.8 milestone Sep 1, 2025
@phorward phorward added the Priority: High After critical issues are fixed, these should be dealt with before any further issues. label Sep 2, 2025
def clone_value(self, skel: "SkeletonInstance", src_skel: "SkeletonInstance", bone_name: str) -> None:
"""Clone / Set the value for this bone depending on :attr:`clone_behavior`"""
match self.clone_behavior.strategy:
case CloneStrategy.COPY_VALUE:
Copy link
Member

@sveneberth sveneberth Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested, but I think this should fix it (before the old code):

Suggested change
case CloneStrategy.COPY_VALUE:
case CloneStrategy.COPY_VALUE:
_ = skel[boneName] # ensure the bone is being unserialized first

skel.renderAccessedValues[bone_name] = copy.deepcopy(src_skel.renderAccessedValues[bone_name])
except KeyError:
pass # bone_name is not in renderAccessedValues, cannot clone it
skel[bone_name] = copy.deepcopy(src_skel[bone_name])
Copy link
Member

@sveneberth sveneberth Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail if renderPreparation is enabled. That's why I implemented it low-level.

The problem, which is probably also responsible for yours, is that the value/entity was not unserialized and is not loaded into the access values, so you are copying something that is not there.

@phorward phorward added viur-meeting Issues to discuss in the next ViUR meeting and removed viur-meeting Issues to discuss in the next ViUR meeting labels Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug(fix) Something isn't working or address a specific issue or vulnerability Priority: High After critical issues are fixed, these should be dealt with before any further issues.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants