summaryrefslogtreecommitdiff
path: root/tools/editor/plugins/mesh_editor_plugin.h
blob: 557eb9014862f8a1ddc659ae089b9dbe72687f56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef MESH_EDITOR_PLUGIN_H
#define MESH_EDITOR_PLUGIN_H


#include "tools/editor/editor_plugin.h"
#include "tools/editor/editor_node.h"
#include "scene/3d/mesh_instance.h"
#include "scene/gui/spin_box.h"


class MeshInstanceEditor : public Node {

	OBJ_TYPE(MeshInstanceEditor, Node );


	enum Menu {

		MENU_OPTION_CREATE_STATIC_TRIMESH_BODY,
		MENU_OPTION_CREATE_STATIC_CONVEX_BODY,
		MENU_OPTION_CREATE_TRIMESH_COLLISION_SHAPE,
		MENU_OPTION_CREATE_CONVEX_COLLISION_SHAPE,
		MENU_OPTION_CREATE_NAVMESH,
	};

	AcceptDialog *err_dialog;


	Panel *panel;
	MeshInstance *node;

	LineEdit *surface_source;
	LineEdit *mesh_source;


	void _menu_option(int p_option);
friend class MeshInstanceEditorPlugin;
	MenuButton * options;

protected:
	void _node_removed(Node *p_node);
	static void _bind_methods();
public:

	void edit(MeshInstance *p_mesh);
	MeshInstanceEditor();
};

class MeshInstanceEditorPlugin : public EditorPlugin {

	OBJ_TYPE( MeshInstanceEditorPlugin, EditorPlugin );

	MeshInstanceEditor *mesh_editor;
	EditorNode *editor;

public:

	virtual String get_name() const { return "MeshInstance"; }
	bool has_main_screen() const { return false; }
	virtual void edit(Object *p_node);
	virtual bool handles(Object *p_node) const;
	virtual void make_visible(bool p_visible);

	MeshInstanceEditorPlugin(EditorNode *p_node);
	~MeshInstanceEditorPlugin();

};

#endif // MESH_EDITOR_PLUGIN_H