X Tutup
Skip to content

Expose 3D editor snap settings to EditorPlugin.#96763

Closed
SaracenOne wants to merge 1 commit intogodotengine:masterfrom
V-Sekai:expose_node_3d_snapping
Closed

Expose 3D editor snap settings to EditorPlugin.#96763
SaracenOne wants to merge 1 commit intogodotengine:masterfrom
V-Sekai:expose_node_3d_snapping

Conversation

@SaracenOne
Copy link
Member

Implements #10704

Adds methods to the EditorPlugin to get the snap settings from the 3D editor. I don't know whether or not this is the most preferred place to expose this API, but I'm pretty confident this needs to be exposed somewhere at least.

@SaracenOne SaracenOne force-pushed the expose_node_3d_snapping branch from b28975e to d804630 Compare September 9, 2024 17:25
@SaracenOne
Copy link
Member Author

Okay, fixed now

@kebabskal
Copy link

Thanks for this!

I got setting the value work as well:
0ba1027

Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

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

I also don't know if this is the right place to expose this, however, I have personally wanted the 2D version of this information in addons in the past, so I'm in support of adding it in general.

The code itself looks good to me.

Feedback from folks more involved in the editor would be good.

@akien-mga akien-mga requested a review from Calinou September 13, 2024 08:57
Comment on lines +590 to +607
<method name="get_node_3d_rotate_snap">
<return type="float" />
<description>
Returns the amount of degrees the 3D editor's rotational snapping is set to.
</description>
</method>
<method name="get_node_3d_scale_snap">
<return type="float" />
<description>
Returns the amount of units the 3D editor's scale snapping is set to.
</description>
</method>
<method name="get_node_3d_translate_snap">
<return type="float" />
<description>
Returns the amount of units the 3D editor's translation snapping is set to.
</description>
</method>
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this make more sense to expose in EditorInterface than EditorPlugin?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I agree this makes more sense in EditorInterface.

@SaracenOne
Copy link
Member Author

Closed in favour of #103608 since it implements the recommended changes and I agree with them.

@SaracenOne SaracenOne closed this Mar 12, 2025
@AThousandShips AThousandShips removed this from the 4.x milestone Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

X Tutup