diff --git a/scripts/startup/bl_ui/properties_particle.py b/scripts/startup/bl_ui/properties_particle.py index e1bcfc660b2..ded383a936c 100644 --- a/scripts/startup/bl_ui/properties_particle.py +++ b/scripts/startup/bl_ui/properties_particle.py @@ -1670,7 +1670,7 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel): if path: col.prop(part, "display_step", text="Strand Steps") col.prop(part, "display_percentage", slider=True, text="Amount") - if part.display_method != 'RENDER' or part.render_type == 'HALO': + if part.display_method != 'RENDER': col.prop(part, "display_size", text="Size") if part.display_percentage != 100 and psys is not None: diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 0b8d826b2e9..c9ad6f7a948 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -25,7 +25,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 3 +#define BLENDER_FILE_SUBVERSION 4 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 7060983c281..d37057392ab 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4639,7 +4639,7 @@ void psys_changed_type(Object *ob, ParticleSystem *psys) } if (part->type == PART_HAIR) { - if (ELEM(part->ren_as, PART_DRAW_NOT, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR) == 0) { + if (ELEM(part->ren_as, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR) == 0) { part->ren_as = PART_DRAW_PATH; } @@ -4661,6 +4661,11 @@ void psys_changed_type(Object *ob, ParticleSystem *psys) CLAMP(part->path_start, 0.0f, MAX2(100.0f, part->end + part->lifetime)); CLAMP(part->path_end, 0.0f, MAX2(100.0f, part->end + part->lifetime)); + + if (ELEM(part->ren_as, part->draw_as, PART_DRAW_PATH)) { + part->ren_as = PART_DRAW_NOT; + part->draw_as = PART_DRAW_DOT; + } } psys_reset(psys, PSYS_RESET_ALL); diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index d2f3d0557ca..3191a2db522 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -9,6 +9,7 @@ #include "CLG_log.h" #include "DNA_movieclip_types.h" +#include "DNA_particle_types.h" #include "BLI_assert.h" #include "BLI_listbase.h" @@ -122,6 +123,18 @@ void blo_do_versions_400(FileData * /*fd*/, Library * /*lib*/, Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 400, 4)) { + LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) { + /* Replace unsupported particle render types. */ + if (ELEM(part->ren_as, PART_DRAW_HALO, PART_DRAW_LINE) || + ((part->type == PART_EMITTER) && (part->ren_as == PART_DRAW_PATH))) + { + part->ren_as = PART_DRAW_NOT; + part->draw_as = PART_DRAW_DOT; + } + } + } + /** * Versioning code until next subversion bump goes here. * diff --git a/source/blender/makesdna/DNA_particle_defaults.h b/source/blender/makesdna/DNA_particle_defaults.h index 108252a5e6c..a9d31ec7aee 100644 --- a/source/blender/makesdna/DNA_particle_defaults.h +++ b/source/blender/makesdna/DNA_particle_defaults.h @@ -17,8 +17,8 @@ { \ .type = PART_EMITTER, \ .distr = PART_DISTR_JIT, \ - .draw_as = PART_DRAW_REND, \ - .ren_as = PART_DRAW_HALO, \ + .draw_as = PART_DRAW_DOT, \ + .ren_as = PART_DRAW_NOT, \ .bb_uv_split = 1, \ .flag = PART_EDISTR | PART_TRAND | PART_HIDE_ADVANCED_HAIR, \ \ diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 7dbae742c00..7cc0d3753ab 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -560,12 +560,12 @@ typedef enum eParticleShapeFlag { /* #ParticleSettings.ren_as */ #define PART_DRAW_NOT 0 #define PART_DRAW_DOT 1 -#define PART_DRAW_HALO 1 +#define PART_DRAW_HALO 1 /* deprecated */ #define PART_DRAW_CIRC 2 #define PART_DRAW_CROSS 3 #define PART_DRAW_AXIS 4 -#define PART_DRAW_LINE 5 -#define PART_DRAW_PATH 6 +#define PART_DRAW_LINE 5 /* deprecated */ +#define PART_DRAW_PATH 6 /* only for hair */ #define PART_DRAW_OB 7 #define PART_DRAW_GR 8 #define PART_DRAW_BB 9 /* deprecated */ diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 6fceface1c9..299cf3db69d 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -90,8 +90,6 @@ static const EnumPropertyItem part_hair_draw_as_items[] = { static const EnumPropertyItem part_ren_as_items[] = { {PART_DRAW_NOT, "NONE", 0, "None", ""}, - {PART_DRAW_HALO, "HALO", 0, "Halo", ""}, - {PART_DRAW_LINE, "LINE", 0, "Line", ""}, {PART_DRAW_PATH, "PATH", 0, "Path", ""}, {PART_DRAW_OB, "OBJECT", 0, "Object", ""}, {PART_DRAW_GR, "COLLECTION", 0, "Collection", ""}, @@ -99,9 +97,8 @@ static const EnumPropertyItem part_ren_as_items[] = { }; #ifdef RNA_RUNTIME -static const EnumPropertyItem part_hair_ren_as_items[] = { +static const EnumPropertyItem part_emitter_ren_as_items[] = { {PART_DRAW_NOT, "NONE", 0, "None", ""}, - {PART_DRAW_PATH, "PATH", 0, "Path", ""}, {PART_DRAW_OB, "OBJECT", 0, "Object", ""}, {PART_DRAW_GR, "COLLECTION", 0, "Collection", ""}, {0, NULL, 0, NULL, NULL}, @@ -1393,10 +1390,10 @@ static const EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), ParticleSettings *part = (ParticleSettings *)ptr->owner_id; if (part->type == PART_HAIR) { - return part_hair_ren_as_items; + return part_ren_as_items; } else { - return part_ren_as_items; + return part_emitter_ren_as_items; } }