Skip to content

Commit

Permalink
Improve editing of min/max particle properties
Browse files Browse the repository at this point in the history
  • Loading branch information
KoBeWi committed Dec 20, 2023
1 parent 1f5d4a6 commit ce9fec9
Show file tree
Hide file tree
Showing 9 changed files with 691 additions and 39 deletions.
17 changes: 17 additions & 0 deletions doc/classes/ParticleProcessMaterial.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
<tutorials>
</tutorials>
<methods>
<method name="get_param" qualifiers="const">
<return type="Vector2" />
<param index="0" name="param" type="int" enum="ParticleProcessMaterial.Parameter" />
<description>
Returns the minimum and maximum values of the given [param param] as a vector.
The [code]x[/code] component of the returned vector corresponds to minimum and the [code]y[/code] component corresponds to maximum.
</description>
</method>
<method name="get_param_max" qualifiers="const">
<return type="float" />
<param index="0" name="param" type="int" enum="ParticleProcessMaterial.Parameter" />
Expand Down Expand Up @@ -37,6 +45,15 @@
Returns [code]true[/code] if the specified particle flag is enabled. See [enum ParticleFlags] for options.
</description>
</method>
<method name="set_param">
<return type="void" />
<param index="0" name="param" type="int" enum="ParticleProcessMaterial.Parameter" />
<param index="1" name="value" type="Vector2" />
<description>
Sets the minimum and maximum values of the given [param param].
The [code]x[/code] component of the argument vector corresponds to minimum and the [code]y[/code] component corresponds to maximum.
</description>
</method>
<method name="set_param_max">
<return type="void" />
<param index="0" name="param" type="int" enum="ParticleProcessMaterial.Parameter" />
Expand Down
3 changes: 3 additions & 0 deletions editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ void EditorProperty::_notification(int p_what) {
if (c->is_set_as_top_level()) {
continue;
}
if (!c->is_visible()) {
continue;
}
if (c == bottom_editor) {
continue;
}
Expand Down
5 changes: 5 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
#include "editor/plugins/mesh_library_editor_plugin.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "editor/plugins/packed_scene_translation_parser_plugin.h"
#include "editor/plugins/particle_process_material_editor_plugin.h"
#include "editor/plugins/root_motion_editor_plugin.h"
#include "editor/plugins/script_text_editor.h"
#include "editor/plugins/text_editor.h"
Expand Down Expand Up @@ -6974,6 +6975,10 @@ EditorNode::EditorNode() {
Ref<EditorInspectorVisualShaderModePlugin> smp;
smp.instantiate();
EditorInspector::add_inspector_plugin(smp);

Ref<EditorInspectorParticleProcessMaterialPlugin> ppm;
ppm.instantiate();
EditorInspector::add_inspector_plugin(ppm);
}

editor_selection = memnew(EditorSelection);
Expand Down
1 change: 1 addition & 0 deletions editor/icons/RangeSliderLeft.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions editor/icons/RangeSliderRight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ce9fec9

Please sign in to comment.