Skip to content

Add Global and Local rotation spaces - #53

Open
InvixGG wants to merge 10 commits into
stuffbydavid:2.1from
InvixGG:task/rotation-spaces-2.1
Open

InvixGG wants to merge 10 commits into
stuffbydavid:2.1from
InvixGG:task/rotation-spaces-2.1

Conversation

@InvixGG

@InvixGG InvixGG commented Sep 15, 2026

Copy link
Copy Markdown

Adds Global and Local rotation to the viewport tools. The existing Euler-channel behavior is named Gimbal and remains the default.

Adapted from Mine-imator Vexel Build (MI VB), originally introduced in Vexel-Studios/vexel-mine-imator#111.

The button below the viewport toolbar cycles between the three spaces, as does the remappable Q shortcut. Each space has its own icon and ring colors. Local uses the active object's axes when several objects are selected.

The choice is saved in program settings. Project files and animation curves still use Euler rotations, and changing the space does not edit keyframes or add an undo step.

Compatibility

  • Based on 2.1, alongside the rendering work in Mine-imator 2.1 rendering (WIP) #45.
  • IK, path-following objects, inherited poses, locked selections, and selected rotation keys away from the current frame keep Gimbal behavior. The tooltip explains when this applies.
  • Zero, negative, or nonuniform object scales and stretched, sheared, or mirrored parent transforms also keep Gimbal behavior.
  • Global and Local preserve complete turns during a drag and account for parents whose position inheritance is disabled.
  • Includes a small undo fix: removing a newly created transform key must not restore its values into the following key.

@InvixGG
InvixGG marked this pull request as ready for review September 15, 2026 19:42
@mbandersmc

Copy link
Copy Markdown
Collaborator

Strongly recommend having the other view controls be affected by this too, not just rotation.

MI/Blender example:
image

@InvixGG

InvixGG commented Sep 16, 2026

Copy link
Copy Markdown
Author

Strongly recommend having the other view controls be affected by this too, not just rotation.

Sounds good, will take a look at this and get that added.

Use Global and Local axes for movement and scaling, with parent-space conversion and separate undo entries for each drag. Preserve the existing Gimbal behavior and fit oriented scaling to the available XYZ channels.

Keep the original parent basis while dragging objects in the timeline so the temporary drag container is never treated as a transform.
@InvixGG

InvixGG commented Sep 16, 2026

Copy link
Copy Markdown
Author

@mbandersmc Added this in 170afd2. Move and Scale now follow the selected Global/Local orientation too, including the combined transform tool. Local uses the active object's axes, and nested selections account for their parent transforms without applying the inherited transform twice.

Also fixed a crash when dragging objects between parents in the timeline. The gizmo now keeps using the original parent until the drop completes.

Scale keeps the existing rotation values, so stretches that would require shear are approximated using the XYZ scale channels. Gimbal keeps its previous behavior.

@NimiSqrd

Copy link
Copy Markdown
Collaborator

Got around to checking this out, thanks for putting time into this PR. It seems fine in C++ but there's some issues on the GameMaker side and code consistency.

Some issues and suggestions:

  • GML side uses GameMaker keywords like x/y, causing some compile/runtime issues. Since this feature doesn't require anything special from C++, 1:1 behavior is ideal.
  • Functions usually get their own script with JSdoc headers, the current convention in the GML codebase.
  • Some wording seems complex for newer users, I'd do a pass over naming and opt for something like "transform_mode", "Gimbal mode" in the UI, etc.
  • There seems to be a lot of state management and duplication(?) with view_control_transform_* and view_control_rotation_*, some simplification would be nice if possible.
  • A lot of the code styling seems compact, making it a little spacious like the rest of the code would be nice.

btw there is a feature-freeze approaching in a couple days for 2.1. If addressing these would require a large refactor, don’t feel pressured to invest more time just to squeeze it in.

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