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

Extend bone override capabilities #10704

Closed
wants to merge 7 commits into from
Closed

Conversation

appgurueu
Copy link
Contributor

@appgurueu appgurueu commented Dec 6, 2020

Description

Implements bone overrides supporting position, rotation and scale, all of which can be relative and interpolated.

To do

  • Use inline functions/loops instead of copypasted code
  • Some renames from bone position -> bone override
  • Deprecate set_bone_position and get_bone_position

How to test

Use the new documented API.

@sfan5 sfan5 added Feature ✨ PRs that add or enhance a feature WIP labels Dec 6, 2020
@theviper121
Copy link
Contributor

I'm just curious. What is the use case for scaling a bone?

@hecktest
Copy link
Contributor

hecktest commented Dec 7, 2020

What is the use case for scaling a bone?

Boob slider =]

Among other things, it's good for FX. And just because, hell, do you need a reason? It's called freedom. You can scale whole objects so why not bones?

@appgurueu
Is it possible to override one of the transform channels for a bone while still animating the others? That would be useful.

@appgurueu
Copy link
Contributor Author

@appgurueu
Is it possible to override one of the transform channels for a bone while still animating the others? That would be useful.

A value of [property] = { x = 0, y = 0, z = 0, absolute = false, interpolation = 0 } will do the job.

@hecktest
Copy link
Contributor

hecktest commented Dec 7, 2020

That's kinda hacky. Why not property=false/nil?

Also, there are more possible spaces than absolute/relative (to what?), maybe that should be a string param on the lua side and an enum on the engine side, to allow further extension.

Check this out:
#10301 (comment)

@appgurueu
Copy link
Contributor Author

appgurueu commented Dec 8, 2020

That's kinda hacky. Why not property=false/nil?

Properties default to what I have mentioned above. If you pass {position = ...}, rotation and scale will remain unchanged.

Also, there are more possible spaces than absolute/relative (to what?), maybe that should be a string param on the lua side and an enum on the engine side, to allow further extension.

Yeah

@hecktest
Copy link
Contributor

hecktest commented Dec 9, 2020

Oh, so nil is already handled like that. Well, I like this.

@hecktest
Copy link
Contributor

hecktest commented Dec 9, 2020

How does this interact with #10705? Does setting an all-nil override make @theviper121 's function redundant?

@appgurueu
Copy link
Contributor Author

How does this interact with #10705? Does setting an all-nil override make @theviper121 's function redundant?

Yes, although it doesn't delete the override if doing so (could implement tho). Instead it justs sets all (0,0,0)-relative overrides (which equals no override).

@hecktest
Copy link
Contributor

Well uh, I'm thoroughly confused but let me just describe the best possible API:

  • nil disables the override on a given channel
  • 0,0,0 just freezes the property at that position, and isn't treated as a magic value

Can you do that?

@appgurueu
Copy link
Contributor Author

appgurueu commented Jan 12, 2021

Latest commit makes #10705 obsolete


maybe that should be a string param on the lua side and an enum on the engine side

Yes. Currently it only supports relative = true / false.

Currently, there only are:

  • Absolute: Overrides property
  • Relative additive: Adds override to animated property

I plan to add:

  • Relative multiplicative: Multiplies override with animated property (useful for scale)
  • Relative freeze additive: Stops animating property as soon as override is processed, adds override to "frozen" property
  • Relative freeze multiplicative: Same as above but multiplies

@sfan5 sfan5 added Possible close Rebase needed The PR needs to be rebased by its author labels Oct 5, 2021
@rubenwardy
Copy link
Contributor

Closing as WIP with no progress

@rubenwardy rubenwardy closed this Oct 31, 2021
@sfan5 sfan5 mentioned this pull request May 8, 2022
* `set_bone_override(bone, override)`
* `bone`: string
* `override`: `{ position = property, rotation = property, scale = property }`
* `property`: `{ x = 0, y = 0, z = 0, interpolation = 0 --[[in seconds]], absolute = false}`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should be renamed to interpolation_duration

@appgurueu
Copy link
Contributor Author

Revival of this is at #12388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature ✨ PRs that add or enhance a feature Possible close Rebase needed The PR needs to be rebased by its author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants