Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
134 stars 2 forks source link

Core Constraint Component(s) a la Unity or Blender #2672

Open Archytas79 opened 1 month ago

Archytas79 commented 1 month ago

Is your feature request related to a problem? Please describe.

I've tried getting into Resonite a few times since release but I keep getting bounced by a few issues, mainly the seeming lack of basic constraint components. For beginners, I think it's a bit unreasonable to expect learning the visual programming language for these features that come out of the box in even professional tools. Adding component(s) that work like in the above programs would help bridge the gap between using any other 3D system and Resonite.

Note a key advantage is because they are simple and universal, it'd be easy to convert functionality and techniques from other places to Resonite.

Describe the solution you'd like

Blender and Unity have very easy to use constraint components to do a lot of heavy lifting. There's a lot of good UI and functionality to be inspired by the below:

image

Ideally, what I think would work best is a ConstrainTransform component similar to VirtualParent where it has a source slot with pointers to position, rotation, and scale individually, and offsets for each (with a button like "active" to set the offsets to be correct for the current orientation). The difference being that a ConstrainTransform component would work separately on position, rotation, and scale and not require driving the others.

A general, separate-vector ConstrainTransform would be all I'd want but there's others that should be looked at if they don't have equivalents like Unity's Look At Constraint or Blender's Dampened Track, which do the heavy lifting of pointing a rotation towards another object.

Describe alternatives you've considered

There aren't alternatives. I've tried using VirtualParent, but this only works if you want to constrain the entire transform, not a part. I've tried looking into the programmatic method and it's so cumbersome when I need to do it 20+ times per object, and every competitor / collaborator program has simple, consistent constraints as an option.

Additional Context

No response

Requesters

No response

XDelta commented 1 month ago

Related https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2612

shiftyscales commented 1 month ago

Can you please give some additional context about the issue you're trying to solve / what you're trying to build in Resonite, @Archytas79? Is this specific to wanting to add constraints to an avatar?

Archytas79 commented 1 month ago

I'm trying to make a slot have a relative rotation to annother slot, mapping a humanoid rig to a non-humanoid rig using the mechanical principles of levers. I like doing it this way because it's system agnostic as long as there's support for simple constraints.

I take it to a bit of an extreme (I use it to map eye rotation to linear motion) but mostly people use it for mapping human legs to digitigrade legs using parallelograms

On Fri, Jul 26, 2024, 11:22 AM Shifty @.***> wrote:

Can you please give some additional context about the issue you're trying to solve / what you're trying to build in Resonite, @Archytas79 https://github.com/Archytas79? Is this specific to wanting to add constraints to an avatar?

— Reply to this email directly, view it on GitHub https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2672#issuecomment-2253259859, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANJFYU5PWJMVQI5JSXIOEQDZOKHXBAVCNFSM6AAAAABLPOJSMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJTGI2TSOBVHE . You are receiving this because you were mentioned.Message ID: @.***>

Electronus commented 1 month ago

For the legs at least people usually use CopyGlobalTransofrm with the position drive removed.

I keep running into issues where I get told we need constraints, (twist bones for example), but I have never been able to really draft an issue for it.

lxw404 commented 1 month ago

I'm trying to make a slot have a relative rotation to annother slot, mapping a humanoid rig to a non-humanoid rig using the mechanical principles of levers.

Most constraints can be implemented as a series of CopyGlobalTransform, LinearRotationMapper, PositionDeltaDriver, ValueCopy<T>, and LookAt components along with slot transforms. Of course dedicated constraints will ease this and we've been missing them for a while.

Archytas79 commented 1 month ago

Booted up resonite to try CopyGlobalTransform, but it doesn't really do the same thing as the above. There's no offsets, plus it's really easy to accidentally and irreversibly change the whole transform with the position automatically filling like that.

I opened a separate issue about that common later problem, but for safety having it start with all components as null would def be best

shiftyscales commented 1 month ago

I use it to map eye rotation to linear motion

There are already components that exist to drive eyes linearly if that's what you need @Archytas79. It's the EyeLinearDriver component.

Archytas79 commented 1 month ago

The eyes are on separate flat planes that are angled quite a bit apart and are internally asymmetric - if it can handle that, that's pretty sick but from what I'm seeing it looks like it's pretty specific to symetric eyes with similar normals?

Either way, it'd be easier to setup the levers that are system agnostic (with the addition of the proposal) and plug normal eye rotation into it.

BTW what is needed to clarify? I'm not sure where the proposal is too nebulous.

ko-tengu commented 1 month ago

Constraints are pretty useful in general for all kinds of animation, it's a big gap the game's missing compared to most other game engines. Getting too fixated on their use for player avatars is probably missing the wide range of applications they have.