예제 #1
0
ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node, bool p_2d) {

	editor=p_node;
	shader_editor = memnew( ShaderEditor );
	_2d=p_2d;
	if (p_2d)
		add_control_to_container(CONTAINER_CANVAS_EDITOR_BOTTOM,shader_editor);
	else
		add_control_to_container(CONTAINER_SPATIAL_EDITOR_BOTTOM,shader_editor);
//	editor->get_viewport()->add_child(shader_editor);
//	shader_editor->set_area_as_parent_rect();

	shader_editor->hide();

}
ColorRampEditorPlugin::ColorRampEditorPlugin(EditorNode *p_node, bool p_2d) {

	editor=p_node;
	ramp_editor = memnew( ColorRampEdit );

	_2d=p_2d;
	if (p_2d)
		add_control_to_container(CONTAINER_CANVAS_EDITOR_BOTTOM,ramp_editor);
	else
		add_control_to_container(CONTAINER_SPATIAL_EDITOR_BOTTOM,ramp_editor);

	ramp_editor->set_custom_minimum_size(Size2(100, 48));
	ramp_editor->hide();
	ramp_editor->connect("ramp_changed", this, "ramp_changed");
}
예제 #3
0
MeshEditorPlugin::MeshEditorPlugin(EditorNode *p_node) {

	editor = p_node;
	mesh_editor = memnew(MeshEditor);
	add_control_to_container(CONTAINER_PROPERTY_EDITOR_BOTTOM, mesh_editor);
	mesh_editor->hide();
}
예제 #4
0
TileMapEditorPlugin::TileMapEditorPlugin(EditorNode *p_node) {

	EDITOR_DEF("tile_map/preview_size",64);
	tile_map_editor = memnew( TileMapEditor(p_node) );
	add_control_to_container(CONTAINER_CANVAS_EDITOR_SIDE, tile_map_editor);
	tile_map_editor->hide();
}
Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) {

	particles=NULL;
	editor=p_node;
	undo_redo=editor->get_undo_redo();

	toolbar = memnew( HBoxContainer );
	add_control_to_container(CONTAINER_CANVAS_EDITOR_MENU, toolbar);
	toolbar->hide();

	toolbar->add_child( memnew( VSeparator ) );

	menu = memnew( MenuButton );
	menu->get_popup()->add_item(TTR("Load Emission Mask"),MENU_LOAD_EMISSION_MASK);
	menu->get_popup()->add_item(TTR("Clear Emission Mask"),MENU_CLEAR_EMISSION_MASK);
	menu->set_text("Particles");
	toolbar->add_child(menu);

	file = memnew( EditorFileDialog );
	List<String> ext;
	ImageLoader::get_recognized_extensions(&ext);
	for(List<String>::Element *E=ext.front();E;E=E->next()) {
		file->add_filter("*."+E->get()+"; "+E->get().to_upper());
	}
	file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
	toolbar->add_child(file);

	epoints = memnew( SpinBox );
	epoints->set_min(1);
	epoints->set_max(8192);
	epoints->set_step(1);
	epoints->set_value(512);
	file->get_vbox()->add_margin_child(TTR("Generated Point Count:"),epoints);
}
BakedLightEditorPlugin::BakedLightEditorPlugin(EditorNode *p_node) {

	editor=p_node;
	baked_light_editor = memnew( BakedLightEditor );
	editor->get_viewport()->add_child(baked_light_editor);
	add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU,baked_light_editor->bake_hbox);
	baked_light_editor->hide();
	baked_light_editor->bake_hbox->hide();
}
NavigationMeshEditorPlugin::NavigationMeshEditorPlugin(EditorNode *p_node) {

	editor = p_node;
	navigation_mesh_editor = memnew(NavigationMeshEditor);
	editor->get_viewport()->add_child(navigation_mesh_editor);
	add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, navigation_mesh_editor->bake_hbox);
	navigation_mesh_editor->hide();
	navigation_mesh_editor->bake_hbox->hide();
}
예제 #8
0
GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) {

	editor = p_node;
	bake = memnew(Button);
	bake->set_icon(editor->get_gui_base()->get_icon("BakedLight", "EditorIcons"));
	bake->hide();
	bake->connect("pressed", this, "_bake");
	add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake);
	gi_probe = NULL;
}
예제 #9
0
GradientEditorPlugin::GradientEditorPlugin(EditorNode *p_node) {

	editor = p_node;
	ramp_editor = memnew(GradientEdit);

	add_control_to_container(CONTAINER_PROPERTY_EDITOR_BOTTOM, ramp_editor);

	ramp_editor->set_custom_minimum_size(Size2(100, 48));
	ramp_editor->hide();
	ramp_editor->connect("ramp_changed", this, "ramp_changed");
}
예제 #10
0
SkeletonIKEditorPlugin::SkeletonIKEditorPlugin(EditorNode *p_node) {

	editor = p_node;
	play_btn = memnew(Button);
	play_btn->set_icon(editor->get_gui_base()->get_icon("Play", "EditorIcons"));
	play_btn->set_text(TTR("Play IK"));
	play_btn->set_toggle_mode(true);
	play_btn->hide();
	play_btn->connect("pressed", this, "_play");
	add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, play_btn);
	skeleton_ik = NULL;
}
CPUParticles2DEditorPlugin::CPUParticles2DEditorPlugin(EditorNode *p_node) {

	particles = NULL;
	editor = p_node;
	undo_redo = editor->get_undo_redo();

	toolbar = memnew(HBoxContainer);
	add_control_to_container(CONTAINER_CANVAS_EDITOR_MENU, toolbar);
	toolbar->hide();

	toolbar->add_child(memnew(VSeparator));

	menu = memnew(MenuButton);
	menu->get_popup()->add_item(TTR("Load Emission Mask"), MENU_LOAD_EMISSION_MASK);
	//	menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK);
	menu->set_text(TTR("Particles"));
	toolbar->add_child(menu);

	file = memnew(EditorFileDialog);
	List<String> ext;
	ImageLoader::get_recognized_extensions(&ext);
	for (List<String>::Element *E = ext.front(); E; E = E->next()) {
		file->add_filter("*." + E->get() + "; " + E->get().to_upper());
	}
	file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
	toolbar->add_child(file);

	epoints = memnew(SpinBox);
	epoints->set_min(1);
	epoints->set_max(8192);
	epoints->set_step(1);
	epoints->set_value(512);
	file->get_vbox()->add_margin_child(TTR("Generated Point Count:"), epoints);

	emission_mask = memnew(ConfirmationDialog);
	emission_mask->set_title(TTR("Load Emission Mask"));
	VBoxContainer *emvb = memnew(VBoxContainer);
	emission_mask->add_child(emvb);
	emission_mask_mode = memnew(OptionButton);
	emvb->add_margin_child(TTR("Emission Mask"), emission_mask_mode);
	emission_mask_mode->add_item("Solid Pixels", EMISSION_MODE_SOLID);
	emission_mask_mode->add_item("Border Pixels", EMISSION_MODE_BORDER);
	emission_mask_mode->add_item("Directed Border Pixels", EMISSION_MODE_BORDER_DIRECTED);
	emission_colors = memnew(CheckBox);
	emission_colors->set_text(TTR("Capture from Pixel"));
	emvb->add_margin_child(TTR("Emission Colors"), emission_colors);

	toolbar->add_child(emission_mask);

	emission_mask->connect("confirmed", this, "_generate_emission_mask");
}
예제 #12
0
GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) {

	editor = p_node;
	bake = memnew(Button);
	bake->set_icon(editor->get_gui_base()->get_icon("Bake", "EditorIcons"));
	bake->set_text(TTR("Bake GI Probe"));
	bake->hide();
	bake->connect("pressed", this, "_bake");
	add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake);
	gi_probe = NULL;

	GIProbe::bake_begin_function = bake_func_begin;
	GIProbe::bake_step_function = bake_func_step;
	GIProbe::bake_end_function = bake_func_end;
}
BakedLightmapEditorPlugin::BakedLightmapEditorPlugin(EditorNode *p_node) {

	editor = p_node;
	bake = memnew(ToolButton);
	bake->set_icon(editor->get_gui_base()->get_icon("Bake", "EditorIcons"));
	bake->set_text(TTR("Bake Lightmaps"));
	bake->hide();
	bake->connect("pressed", this, "_bake");
	add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake);
	lightmap = NULL;

	BakedLightmap::bake_begin_function = bake_func_begin;
	BakedLightmap::bake_step_function = bake_func_step;
	BakedLightmap::bake_end_function = bake_func_end;
}