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

fix: Add check for callable in BooleanBone #1179

Conversation

ArneGudermann
Copy link
Contributor

Fix for #1178

@ArneGudermann ArneGudermann added bug(fix) Something isn't working or address a specific issue or vulnerability Priority: Medium This issue may be useful, and needs some attention. main labels Jun 7, 2024
@ArneGudermann ArneGudermann added this to the ViUR-core v3.6 milestone Jun 7, 2024
@ArneGudermann ArneGudermann linked an issue Jun 7, 2024 that may be closed by this pull request
Copy link
Member

@sveneberth sveneberth left a comment

Choose a reason for hiding this comment

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

That's not really useful. A callable defaultValue should be called at runtime:

return self.defaultValue(skeletonInstance, self)

otherwise I could BooleanBone(defaultValue=my_func()) directly ...

@ArneGudermann
Copy link
Contributor Author

Yes, you are right. The whole thing with the default value needs to be revised... . I don't know if we should wait for #1154. Or is it enough to allow callables for now?

phorward
phorward previously approved these changes Jun 10, 2024
@phorward phorward dismissed their stale review June 10, 2024 19:27

Missed conversation.

@sveneberth
Copy link
Member

Yes, you are right. The whole thing with the default value needs to be revised... . I don't know if we should wait for #1154. Or is it enough to allow callables for now?

Is okay

my_bone = BooleanBone(...)
my_bone.defaultValue = lambda skel, bone: ...

does the job for now too

@phorward
Copy link
Member

phorward commented Jul 3, 2024

Ok,what's with this PR now? It's still flagged for ViUR-core 3.6. Can we close it?

@sveneberth
Copy link
Member

Ok,what's with this PR now? It's still flagged for ViUR-core 3.6. Can we close it?

As it's not really solving the problem and it's possible to workaround with a monkey patch I would recommend to close this too and wait for 3.7.

@phorward phorward closed this Jul 9, 2024
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 main Priority: Medium This issue may be useful, and needs some attention.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

BooleanBone's defaultValue cannot be a callable
3 participants