Particles: remove Halo, Line and Path render options #108231

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:80197 into main 2023-05-30 20:45:38 +02:00
7 changed files with 29 additions and 14 deletions

View File

@ -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:

View File

@ -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

View File

@ -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);

View File

@ -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.
*

View File

@ -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, \
\

View File

@ -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 */

View File

@ -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;
}
}