Repository: godotengine/godot
File: editor/scene/3d/skeleton_3d_editor_plugin.h (C/C++)

Code before:
	Skeleton3D *get_skeleton() const { return skeleton; }

	bool is_edit_mode() const { return edit_mode; }

	void update_bone_original();
	Vector3 get_bone_original_position() const { return bone_original_position; }
	Quaternion get_bone_original_rotation() const { return bone_original_rotation; }
	Vector3 get_bone_original_scale() const { return bone_original_scale; }

	Skeleton3DEditor(EditorInspectorPluginSkeleton *e_plugin, Skeleton3D *skeleton);
	~Skeleton3DEditor();
};

class EditorInspectorPluginSkeleton : public EditorInspectorPlugin {
	GDCLASS(EditorInspectorPluginSkeleton, EditorInspectorPlugin);

	friend class Skeleton3DEditorPlugin;

	Skeleton3DEditor *skel_editor = nullptr;

public:
	bool mod_pressed = false;
	bool loc_pressed = false;
	bool rot_pressed = true;
	bool scl_pressed = false;

	virtual bool can_handle(Object *p_object) override;
	virtual void parse_begin(Object *p_object) override;
};

class Skeleton3DEditorPlugin : public EditorPlugin {
	GDCLASS(Skeleton3DEditorPlugin, EditorPlugin);

	EditorInspectorPluginSkeleton *skeleton_plugin = nullptr;

public:
	virtual EditorPlugin::AfterGUIInput forward_3d_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) override;

	bool has_main_screen() const override { return false; }
	virtual bool handles(Object *p_object) const override;

	virtual String get_plugin_name() const override { return "Skeleton3D"; }

	Skeleton3DEditorPlugin();
};

class Skeleton3DGizmoPlugin : public EditorNode3DGizmoPlugin {
	GDCLASS(Skeleton3DGizmoPlugin, EditorNode3DGizmoPlugin);

	struct SelectionMaterials {
		Ref<StandardMaterial3D> unselected_mat;

Review comment (suggestion):
Should use `set/get_project_metadata()` same with https://github.com/godotengine/godot/pull/111952? I think this setting depends on the model, so I'm a bit unsure whether it should be recorded on a per-project basis.

Also we need to consider that is mod_pressed true as default or not.

Code after:
	Skeleton3D *get_skeleton() const { return skeleton; }

	bool is_edit_mode() const { return edit_mode; }

	void update_bone_original();
	Vector3 get_bone_original_position() const { return bone_original_position; }
	Quaternion get_bone_original_rotation() const { return bone_original_rotation; }
	Vector3 get_bone_original_scale() const { return bone_original_scale; }

	Skeleton3DEditor(EditorInspectorPluginSkeleton *e_plugin, Skeleton3D *skeleton);
	~Skeleton3DEditor();
};

class EditorInspectorPluginSkeleton : public EditorInspectorPlugin {
	GDCLASS(EditorInspectorPluginSkeleton, EditorInspectorPlugin);

	friend class Skeleton3DEditorPlugin;

	Skeleton3DEditor *skel_editor = nullptr;

public:
	bool loc_pressed = false;
	bool rot_pressed = true;
	bool scl_pressed = false;

	virtual bool can_handle(Object *p_object) override;
	virtual void parse_begin(Object *p_object) override;
};

class Skeleton3DEditorPlugin : public EditorPlugin {
	GDCLASS(Skeleton3DEditorPlugin, EditorPlugin);

	EditorInspectorPluginSkeleton *skeleton_plugin = nullptr;

public:
	virtual EditorPlugin::AfterGUIInput forward_3d_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) override;

	bool has_main_screen() const override { return false; }
	virtual bool handles(Object *p_object) const override;

	virtual String get_plugin_name() const override { return "Skeleton3D"; }

	Skeleton3DEditorPlugin();
};

class Skeleton3DGizmoPlugin : public EditorNode3DGizmoPlugin {
	GDCLASS(Skeleton3DGizmoPlugin, EditorNode3DGizmoPlugin);

	struct SelectionMaterials {
		Ref<StandardMaterial3D> unselected_mat;
		Ref<ShaderMaterial> selected_mat;