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

Add flexes and eye posing to E2 #2810

Merged
merged 5 commits into from
Nov 3, 2023
Merged

Add flexes and eye posing to E2 #2810

merged 5 commits into from
Nov 3, 2023

Conversation

Denneisk
Copy link
Member

@Denneisk Denneisk commented Oct 26, 2023

This PR is a part of #2714, namely, this PR intends to implement a similar standard to 'posecore', but on a more personal note, I want to play with flexes and eyes.

Getters were placed in entity and bone extensions. Setters were placed in propcore.

Features:

  • entity:setEyeTarget to set eye target.
    • entity:SetEyeTargetLocal and :SetEyeTargetWorld included to remove discrepancy in how ragdolls and NPCs treat SetEyeTarget differently
  • entity:setFlexWeight, :setFlexScale to manipulate flexes, and various related getters

Parity discrepencies:

  • bone:getJiggle(), bone:getScale(), bone:setBoneScale and bone:setBoneJiggle were excluded as, apparently, the functions they use are extremely inefficient, and they seem too niche to demand a solution
  • getAnimTime() is not implemented, as I don't see a use for it

This code was cleanroomed and any likeness to proprietary work is coincidental.

One miscellaneous change is making entity:bones() return a copy of its output.

Add prototypes for bone scale and jiggle functions
Make entity:bones() return a copy its output
Reduced and dynamicized cost for entity:getFlexes()
Changed position (cost) of setFlexWeight(nn) (30 -> 10)
@thegrb93
Copy link
Contributor

I think the commented code is my only complaint. Need to decide whether to uncomment or remove it.

@Denneisk
Copy link
Member Author

I think the commented code is my only complaint. Need to decide whether to uncomment or remove it.

I'll probably cut it out but I still want to have some sort of reference to it in case someone decides they're worth adding.

@Denneisk
Copy link
Member Author

Yeah, I think using the ManipulateBone functions are a lost cause. Not sure if there's a way to emulate them serverside without the networking toll. Could call them CS and store the info SS (for getters/client load) but I just don't think it's going to be used enough to justify all that overhead. Someone can request if it's a desired feature and I'll look into implementing it.

@Denneisk Denneisk changed the title Add flexes and other ragdoll vanities to E2 Add flexes and eye posing to E2 Oct 28, 2023
@@ -67,3 +67,8 @@ E2Helper.Descriptions["setPos(b:v)"] = "Sets the position of a bone."
E2Helper.Descriptions["setAng(b:a)"] = "Set the rotation of a bone."
E2Helper.Descriptions["ragdollSetPos(e:v)"] = "Sets the position of a ragdoll while preserving pose."
E2Helper.Descriptions["ragdollSetAng(e:a)"] = "Set the rotation of a ragdoll while preserving pose."
E2Helper.Descriptions["setEyeTarget"] = "For NPCs, sets the eye target to the world position. For ragdolls, sets the eye target to the local eye position"
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you verified these work in the E2Helper? I know there's some hacky workaround allowing this, but I thought it was only when the function had no parameters.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, they work. I didn't know it was a hack. Admittedly I just find it easier (less typing) so I prefer using it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see how ignoring the signature and only providing the name of a function wouldn't be a hack

Copy link
Member Author

Choose a reason for hiding this comment

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

Well it's a good hack in my book because it lets me type less.

Copy link
Contributor

Choose a reason for hiding this comment

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

What's it supposed to be? setEyeTarget(e:)? Is it okay without the args?

Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently so, I haven't checked myself. I thought that only worked for no parameter functions. Either way that behavior shouldn't be relied on, the signature should be setEyeTarget(e:v).

Copy link
Member Author

Choose a reason for hiding this comment

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

It's just a way for setting the description of multiple functions of the same name. It's not like someone's going to rewrite how E2Descriptions are handled anytime soon.

Copy link
Contributor

@Vurv78 Vurv78 Nov 2, 2023

Choose a reason for hiding this comment

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

This has nothing to do with rewriting the e2helper, that behavior just shouldn't be relied on since it may conflict with any other addon adding a function with that name. I guess it'd be somewhat fine here since the name isn't too generic but I wouldn't want to set a precedent of relying on this.

Also you don't even need it for the usecase you gave, most of these functions don't have overloads.

@thegrb93 thegrb93 merged commit 6a983ab into wiremod:master Nov 3, 2023
1 check failed
@Denneisk Denneisk deleted the prop-ext branch November 8, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants