Fix T59587: Hair dynamics works different when opened in 2.8
Is a missing do-verisoning code in e3d31b8dfb
.
Unfortunately, at this point it is rather tricky to tell old and new
hair dynamics modifiers apart. Probably easier to accept possible
breackage of the files which were created in 2.7 and saved during
2.8 which had incomplete do-version code.
This commit is contained in:
parent
937731dff1
commit
0885484aa6
Notes:
blender-bot
2023-02-14 10:21:11 +01:00
Referenced by issue #59587, Hair dynamics don't preserve lengh with Particle systems made in 2.79 when opened in 2.8
|
@ -1981,9 +1981,16 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
if (!DNA_struct_elem_find(fd->filesdna, "ClothSimSettings", "short", "bending_model")) {
|
||||
for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
|
||||
for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
|
||||
ClothModifierData *clmd = NULL;
|
||||
if (md->type == eModifierType_Cloth) {
|
||||
ClothModifierData *clmd = (ClothModifierData *)md;
|
||||
|
||||
clmd = (ClothModifierData *)md;
|
||||
}
|
||||
else if (md->type == eModifierType_ParticleSystem) {
|
||||
ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)md;
|
||||
ParticleSystem *psys = psmd->psys;
|
||||
clmd = psys->clmd;
|
||||
}
|
||||
if (clmd != NULL) {
|
||||
clmd->sim_parms->bending_model = CLOTH_BENDING_LINEAR;
|
||||
clmd->sim_parms->tension = clmd->sim_parms->structural;
|
||||
clmd->sim_parms->compression = clmd->sim_parms->structural;
|
||||
|
|
Loading…
Reference in New Issue