Skip to content

Conversation

@RisingThumb
Copy link

@RisingThumb RisingThumb commented Oct 22, 2025

Closes godotengine/godot-proposals#8106 as this functionality is very helpful to my current project.

This mostly ports over the code in editor/scene/3d/particles_3d_editor_plugin.cpp, in particular the _node_selected method, the _generate method and both GPUParticle's generate_emission_particles method and CPUParticle's generate_emission_particles method.

The only tweaks are removing any editor-only messages and a slight tweak so _node_selected is called when doing generate_emission_points.

I have also added corresponding documentation for the new generate_emission_points methods and enums and also provided a minimum test project to try out these changes:

generateEmissionPointsTest.zip

@RisingThumb RisingThumb requested review from a team as code owners October 22, 2025 04:51

// ok FINALLY get face
Face3 face = geometry[index];
//now compute some position inside the face...
Copy link
Contributor

@Yarwin Yarwin Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments are very weird – function has no documentation outside of them (albeit lack of any documentation is Godot default 🙄), they don't follow any convention/style (one has whitespace after // while another doesn't) and I find them very noisy – like, they literally tell what code is doing, without providing any additional context possible to convey efficiently via natural language (i.e. they are documenting stuff I understand, while everything else is one big black box to me).

What is semantic difference between

			// ok FINALLY get face
			Face3 face = geometry[index];

and

			Face3 face = geometry[index];

?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're strange, I agree, and I don't know. They come from the original EditorPlugin code here

@AThousandShips AThousandShips changed the title Ability to use editor particle function "Create Emission Points From Node" in code during runtime Support using editor particle function "Create Emission Points From Node" in code during runtime Oct 22, 2025
@AThousandShips AThousandShips added this to the 4.x milestone Oct 22, 2025
@RisingThumb RisingThumb force-pushed the CreateEmissionPointsFromNode branch 3 times, most recently from 98a4858 to 033f53f Compare October 23, 2025 08:46
@RisingThumb RisingThumb force-pushed the CreateEmissionPointsFromNode branch from 033f53f to 56615cf Compare October 24, 2025 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to use editor particle function "Create Emission Points From Node" in code during runtime

3 participants