Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement .update(dict_values) on Skeleton/SkeletonInstance #1098

Open
sveneberth opened this issue Mar 13, 2024 · 3 comments · Fixed by #1103
Open

Implement .update(dict_values) on Skeleton/SkeletonInstance #1098

sveneberth opened this issue Mar 13, 2024 · 3 comments · Fixed by #1103
Labels
feature New feature or request Priority: Low This issue can be considered with enough idle time.

Comments

@sveneberth
Copy link
Member

sveneberth commented Mar 13, 2024

provide a dict or kwargs to merge multiple values into skel (like dict.update())

@sveneberth sveneberth added feature New feature or request Priority: Low This issue can be considered with enough idle time. labels Mar 13, 2024
@phorward
Copy link
Member

provide a dict or kwargs to merge multiple values into skel (like dict.update())

More context, please!

@sveneberth
Copy link
Member Author

Basically it's this method which should be added into SkeletonInstance:

    def update(self, *args, **kwargs) -> None:
        for key, value in dict(*args, *kwargs).items():
            self[key] = value    

So you can write:

skel.update(name="foo", sortindex=2)
# or
skel.update({"name": "foo", "sortindex": 2})

But this needs to be tested and we should think about if this should use setBoneValue and then we have to ensure this works for every bone, ...

@phorward
Copy link
Member

I think this should make use of the __or__-operator as well, so one can write

skel |= {"name": "foo", "sortindex": 2}

@sveneberth sveneberth linked a pull request Mar 23, 2024 that will close this issue
phorward pushed a commit that referenced this issue Jun 10, 2024
resolves #1098

---------

Co-authored-by: Sven Eberth <mail@sveneberth.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request Priority: Low This issue can be considered with enough idle time.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants