Skip to content

Commit 9230c06

Browse files
committed
Merge pull request #106203 from KoBeWi/image_is_not_a_texture_but_they_are_very_similar
Fix wrongly assigned `emission_normal_texture`
2 parents ee89536 + 92659a6 commit 9230c06

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

editor/plugins/particles_editor_plugin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ void GPUParticles2DEditorPlugin::_generate_emission_mask() {
465465
undo_redo->add_undo_property(pmptr, "emission_color_texture", pm->get_emission_color_texture());
466466
}
467467

468-
if (valid_normals.size()) {
468+
if (!valid_normals.is_empty()) {
469469
undo_redo->add_do_property(pmptr, "emission_shape", ParticleProcessMaterial::EMISSION_SHAPE_DIRECTED_POINTS);
470470
undo_redo->add_undo_property(pmptr, "emission_shape", pm->get_emission_shape());
471471
pm->set_emission_shape(ParticleProcessMaterial::EMISSION_SHAPE_DIRECTED_POINTS);
@@ -557,7 +557,7 @@ void CPUParticles2DEditorPlugin::_generate_emission_mask() {
557557
undo_redo->add_undo_property(particles, "emission_colors", particles->get_emission_colors());
558558
}
559559

560-
if (valid_normals.size()) {
560+
if (!valid_normals.is_empty()) {
561561
undo_redo->add_do_property(particles, "emission_shape", CPUParticles2D::EMISSION_SHAPE_DIRECTED_POINTS);
562562
undo_redo->add_undo_property(particles, "emission_shape", particles->get_emission_shape());
563563
PackedVector2Array norms;
@@ -933,7 +933,7 @@ void GPUParticles3DEditorPlugin::_generate_emission_points() {
933933
undo_redo->create_action(TTR("Create Emission Points"));
934934
ParticleProcessMaterial *matptr = mat.ptr();
935935

936-
if (normals.size() > 0) {
936+
if (!normals.is_empty()) {
937937
undo_redo->add_do_property(matptr, "emission_shape", ParticleProcessMaterial::EMISSION_SHAPE_DIRECTED_POINTS);
938938
undo_redo->add_undo_property(matptr, "emission_shape", matptr->get_emission_shape());
939939

@@ -953,7 +953,7 @@ void GPUParticles3DEditorPlugin::_generate_emission_points() {
953953
}
954954

955955
Ref<Image> image2 = memnew(Image(w, h, false, Image::FORMAT_RGBF, point_img2));
956-
undo_redo->add_do_property(matptr, "emission_normal_texture", image2);
956+
undo_redo->add_do_property(matptr, "emission_normal_texture", ImageTexture::create_from_image(image2));
957957
undo_redo->add_undo_property(matptr, "emission_normal_texture", matptr->get_emission_normal_texture());
958958
} else {
959959
undo_redo->add_do_property(matptr, "emission_shape", ParticleProcessMaterial::EMISSION_SHAPE_POINTS);

0 commit comments

Comments
 (0)