Path: blob/master/editor/scene/3d/multimesh_editor_plugin.h
9906 views
/**************************************************************************/1/* multimesh_editor_plugin.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "editor/plugins/editor_plugin.h"33#include "scene/3d/multimesh_instance_3d.h"34#include "scene/gui/slider.h"35#include "scene/gui/spin_box.h"3637class AcceptDialog;38class ConfirmationDialog;39class MenuButton;40class OptionButton;41class SceneTreeDialog;4243class MultiMeshEditor : public Control {44GDCLASS(MultiMeshEditor, Control);4546friend class MultiMeshEditorPlugin;4748AcceptDialog *err_dialog = nullptr;49MenuButton *options = nullptr;50MultiMeshInstance3D *_last_pp_node = nullptr;51bool browsing_source = false;5253Panel *panel = nullptr;54MultiMeshInstance3D *node = nullptr;5556LineEdit *surface_source = nullptr;57LineEdit *mesh_source = nullptr;5859SceneTreeDialog *std = nullptr;6061ConfirmationDialog *populate_dialog = nullptr;62OptionButton *populate_axis = nullptr;63HSlider *populate_rotate_random = nullptr;64HSlider *populate_tilt_random = nullptr;65SpinBox *populate_scale_random = nullptr;66SpinBox *populate_scale = nullptr;67SpinBox *populate_amount = nullptr;6869enum Menu {70MENU_OPTION_POPULATE71};7273void _browsed(const NodePath &p_path);74void _menu_option(int);75void _populate();76void _browse(bool p_source);7778protected:79void _node_removed(Node *p_node);8081public:82void edit(MultiMeshInstance3D *p_multimesh);83MultiMeshEditor();84};8586class MultiMeshEditorPlugin : public EditorPlugin {87GDCLASS(MultiMeshEditorPlugin, EditorPlugin);8889MultiMeshEditor *multimesh_editor = nullptr;9091public:92virtual String get_plugin_name() const override { return "MultiMesh"; }93bool has_main_screen() const override { return false; }94virtual void edit(Object *p_object) override;95virtual bool handles(Object *p_object) const override;96virtual void make_visible(bool p_visible) override;9798MultiMeshEditorPlugin();99};100101102