2014-05-14 06:22:15 +02:00
|
|
|
#ifndef BAKED_LIGHT_EDITOR_PLUGIN_H
|
|
|
|
#define BAKED_LIGHT_EDITOR_PLUGIN_H
|
|
|
|
|
|
|
|
#include "tools/editor/editor_plugin.h"
|
|
|
|
#include "tools/editor/editor_node.h"
|
2014-06-11 15:41:03 +02:00
|
|
|
#include "tools/editor/plugins/baked_light_baker.h"
|
2014-05-14 06:22:15 +02:00
|
|
|
#include "scene/gui/spin_box.h"
|
|
|
|
|
2014-06-11 15:41:03 +02:00
|
|
|
|
|
|
|
|
2014-05-14 06:22:15 +02:00
|
|
|
/**
|
|
|
|
@author Juan Linietsky <reduzio@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2014-06-11 15:41:03 +02:00
|
|
|
|
2014-05-14 06:22:15 +02:00
|
|
|
class MeshInstance;
|
|
|
|
|
|
|
|
class BakedLightEditor : public Control {
|
|
|
|
|
|
|
|
OBJ_TYPE(BakedLightEditor, Control );
|
|
|
|
|
|
|
|
|
2014-05-24 06:35:47 +02:00
|
|
|
float update_timeout;
|
2014-06-11 15:41:03 +02:00
|
|
|
DVector<uint8_t> octree_texture;
|
2014-10-28 02:54:32 +01:00
|
|
|
DVector<uint8_t> light_texture;
|
|
|
|
DVector<int> octree_sampler;
|
2014-05-24 06:35:47 +02:00
|
|
|
|
2014-05-14 06:22:15 +02:00
|
|
|
BakedLightBaker *baker;
|
|
|
|
AcceptDialog *err_dialog;
|
|
|
|
|
2014-06-11 15:41:03 +02:00
|
|
|
HBoxContainer *bake_hbox;
|
|
|
|
Button *button_bake;
|
|
|
|
Button *button_reset;
|
2014-08-14 15:31:38 +02:00
|
|
|
Button *button_make_lightmaps;
|
2014-06-11 15:41:03 +02:00
|
|
|
Label *bake_info;
|
|
|
|
|
2014-10-28 02:54:32 +01:00
|
|
|
uint64_t last_rays_time;
|
|
|
|
|
|
|
|
|
2014-06-11 15:41:03 +02:00
|
|
|
|
|
|
|
BakedLightInstance *node;
|
2014-05-14 06:22:15 +02:00
|
|
|
|
|
|
|
enum Menu {
|
|
|
|
|
|
|
|
MENU_OPTION_BAKE,
|
|
|
|
MENU_OPTION_CLEAR
|
|
|
|
};
|
|
|
|
|
2014-08-14 15:31:38 +02:00
|
|
|
void _bake_lightmaps();
|
|
|
|
|
2014-06-11 15:41:03 +02:00
|
|
|
void _bake_pressed();
|
|
|
|
void _clear_pressed();
|
|
|
|
|
2014-05-24 06:35:47 +02:00
|
|
|
void _end_baking();
|
2014-05-14 06:22:15 +02:00
|
|
|
void _menu_option(int);
|
|
|
|
|
|
|
|
friend class BakedLightEditorPlugin;
|
|
|
|
protected:
|
|
|
|
void _node_removed(Node *p_node);
|
|
|
|
static void _bind_methods();
|
2014-05-24 06:35:47 +02:00
|
|
|
void _notification(int p_what);
|
2014-05-14 06:22:15 +02:00
|
|
|
public:
|
|
|
|
|
2014-06-11 15:41:03 +02:00
|
|
|
void edit(BakedLightInstance *p_baked_light);
|
2014-05-14 06:22:15 +02:00
|
|
|
BakedLightEditor();
|
|
|
|
~BakedLightEditor();
|
|
|
|
};
|
|
|
|
|
|
|
|
class BakedLightEditorPlugin : public EditorPlugin {
|
|
|
|
|
|
|
|
OBJ_TYPE( BakedLightEditorPlugin, EditorPlugin );
|
|
|
|
|
|
|
|
BakedLightEditor *baked_light_editor;
|
|
|
|
EditorNode *editor;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual String get_name() const { return "BakedLight"; }
|
|
|
|
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);
|
|
|
|
|
|
|
|
BakedLightEditorPlugin(EditorNode *p_node);
|
|
|
|
~BakedLightEditorPlugin();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MULTIMESH_EDITOR_PLUGIN_H
|
|
|
|
|
|
|
|
|