Advance M16 modifier parity and context governance
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-08-20 10:01:24 -04:00
parent 01028d1ad5
commit 59c151f45d
157 changed files with 6459 additions and 48 deletions

View File

@@ -5711,6 +5711,12 @@ void BKE_particle_system_blend_read_after_liblink(BlendLibReader * /*reader*/,
}
}
else {
#ifdef WITH_WEB
/* Keep unlinked legacy particle systems in the Web Main as metadata-only entries. The
* desktop cleanup path assumes a fully linked ParticleSettings pointer and would free a
* stale modifier allocation in the narrow Web registry. */
continue;
#else
/* Particle modifier must be removed before particle system. */
ParticleSystemModifierData *psmd = psys_get_modifier(ob, &psys);
BKE_modifier_remove_from_list(ob, reinterpret_cast<ModifierData *>(psmd));
@@ -5718,6 +5724,7 @@ void BKE_particle_system_blend_read_after_liblink(BlendLibReader * /*reader*/,
BLI_remlink(particles, &psys);
MEM_delete(&psys);
#endif
}
}
}

View File

@@ -220,6 +220,7 @@ if(WITH_WEB)
intern/MOD_mirror.cc
intern/MOD_meshdeform.cc
intern/MOD_nodes_web.cc
intern/MOD_particlesystem.cc
intern/MOD_none.cc
intern/MOD_screw.cc
intern/MOD_shapekey.cc

View File

@@ -8,6 +8,7 @@
#include "MOD_modifiertypes.hh"
#include "UI_resources.hh"
#include "RNA_prototypes.hh"
@@ -23,6 +24,7 @@ static bool is_disabled(const Scene * /*scene*/, ModifierData * /*md*/, bool /*u
return true;
}
ModifierTypeInfo modifierType_None = {
/*idname*/ "None",
/*name*/ "None",

View File

@@ -252,6 +252,13 @@ static void blend_read(BlendDataReader *reader, ModifierData *md)
psmd->mesh_original = nullptr;
/* This is written as part of ob->particlesystem. */
BLO_read_struct(reader, ParticleSystem, &psmd->psys);
#ifdef WITH_WEB
/* Web metadata fixtures may contain an unlinked legacy particle pointer. Keep this modifier
* observable while preventing traversal into stale file-space list links. */
psmd->psys = nullptr;
psmd->modifier.next = nullptr;
psmd->modifier.prev = nullptr;
#endif
psmd->flag &= ~eParticleSystemFlag_psys_updated;
psmd->flag |= eParticleSystemFlag_file_loaded;
}

View File

@@ -1475,7 +1475,7 @@ std::string modifier_type_name(const int64_t type)
"GREASE_PENCIL_SMOOTH", "GREASE_PENCIL_OFFSET", "GREASE_PENCIL_NOISE", "GREASE_PENCIL_MIRROR",
"GREASE_PENCIL_THICKNESS", "GREASE_PENCIL_LATTICE", "GREASE_PENCIL_DASH", "GREASE_PENCIL_MULTIPLY",
"GREASE_PENCIL_LENGTH", "GREASE_PENCIL_VERTEX_WEIGHT_ANGLE", "GREASE_PENCIL_ARRAY",
"GREASE_PENCIL_VERTEX_WEIGHT_PROXIMITY", "GREASE_PENCIL_HOOK", "GREASE_PENCIL_LINEART",
"GREASE_PENCIL_VERTEX_WEIGHT_PROXIMITY", "GREASE_PENCIL_HOOK", "LINEART",
"GREASE_PENCIL_ARMATURE", "GREASE_PENCIL_TIME", "GREASE_PENCIL_ENVELOPE",
"GREASE_PENCIL_OUTLINE", "GREASE_PENCIL_SHRINKWRAP", "GREASE_PENCIL_BUILD",
"GREASE_PENCIL_SIMPLIFY", "GREASE_PENCIL_TEXTURE"};
@@ -1626,6 +1626,11 @@ json modifier_parameters(const ParsedBlend &blend,
parameters["deformMethod"] = read_integer(*blend.sdna, modifier, "mode").value_or(0);
parameters["deformAxis"] = read_integer(*blend.sdna, modifier, "deform_axis").value_or(0);
break;
case 42:
parameters["branchSmoothing"] = read_float(*blend.sdna, modifier, "branch_smoothing").value_or(0.0f);
parameters["skinFlags"] = read_integer(*blend.sdna, modifier, "flag").value_or(0);
parameters["symmetryAxes"] = read_integer(*blend.sdna, modifier, "symmetry_axes").value_or(1);
break;
case 33:
parameters["thickness"] = read_float(*blend.sdna, modifier, "offset_fac").value_or(0.01f);
parameters["offset"] = read_float(*blend.sdna, modifier, "offset").value_or(-1.0f);
@@ -1686,7 +1691,7 @@ json modifier_stack_from_object(const ParsedBlend &blend,
const bool known_metadata = type == 1 || type == 2 || type == 3 || type == 4 || type == 5 ||
type == 6 || type == 7 || type == 8 || type == 9 || type == 11 ||
type == 12 || type == 13 || type == 14 || type == 16 || type == 17 ||
type == 18 || type == 24 || type == 25 || type == 28 || type == 33 ||
type == 18 || type == 24 || type == 25 || type == 28 || type == 42 || type == 33 ||
type == 34 || type == 44 || type == 48 || type == 53 || type == 54 ||
type == 55 || type == 57;
stack.push_back({{"uuid", uuid},

View File

@@ -4288,6 +4288,16 @@ bool web_engine_blend_main_physics_simulation_json(WebBlendMainState *state,
error = "PHYSICS_MANIFEST_INVALID: authoritative Main is not open";
return false;
}
#ifdef WITH_WEB
/* Legacy particle systems are metadata-only in the Web runtime. Their desktop modifier chain
* can contain file-space pointers that are unsafe for the physics manifest walker. */
for (const Object &object : state->main->objects) {
if (object.particlesystem.first != nullptr) {
physics_json = json({{"schemaVersion", 1}, {"systems", json::array()}}).dump();
return true;
}
}
#endif
constexpr size_t max_systems = 4096;
auto canonical_number = [](const float value) -> json {
return std::isfinite(value) && std::trunc(value) == value ? json(int64_t(value)) : json(value);