CedricGuillemet / ImGuizmo

Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui
MIT License
3.25k stars 914 forks source link

ImSequencer, How to snap CurvePoint to the Sequencer Frames #189

Open smbss1 opened 3 years ago

smbss1 commented 3 years ago

Hello! First thank you for ImSequencer and ImGuizmo, they are really useful.

My question is like the title says, I'm working in a sort of Animation Keyframe Editor and I use RampEdit Class Sample to have a keyframe inside Sequence Item. The problem is I want to snap the points(keyframes) to the grid draw by ImSequencer::Sequence.

How I can get the pixel position of the frames ?

CedricGuillemet commented 3 years ago

Here is the line of code that computes the X coordinate for a particular frame:

https://github.com/CedricGuillemet/ImGuizmo/blob/7daa4b24ffe08b906040079bf297e8b920f86f47/ImSequencer.cpp#L201