Page MenuHome

Fix: `PSYS_GLOBAL_HAIR` stripped even if connecting the hair fails
ClosedPublic

Authored by Aleksi Juvani (aleksijuvani) on Jan 1 2022, 6:32 PM.

Details

Summary

After disconnecting hair on an object, if you then hide the particle system, and try connecting the hair again, the operator is cancelled due to remap_hair_emitter returning false because target_psmd->mesh_final is NULL, but connect_hair will still strip the PSYS_GLOBAL_HAIR flag, which will cause the hair in the hidden particle system to be positioned incorrectly. The correct behaviour is to strip the flag only if remap_hair_emitter succeeds.

Diff Detail

Repository
rB Blender

Event Timeline

Aleksi Juvani (aleksijuvani) requested review of this revision.Jan 1 2022, 6:32 PM
Aleksi Juvani (aleksijuvani) created this revision.

Just a side note: as you seem to be getting more active (nice!), it would make sense to use arc maybe?
https://wiki.blender.org/wiki/Tools/CodeReview#Use_Arcanist

Main reason I am saying this is that (besides making submitting patches a bit easier) it gives context in the Diffs by default (so you can see more of the surrounding code)
See the -U1000 here https://wiki.blender.org/wiki/Tools/CodeReview#Upload_a_Diff (1000 is the number of lines of context, less is fine, depending on the situation)

Could it be we now have an issue disconnecting/connecting anyways?, see my comment in rB5dedb39d447b: Fix T54488: hair disconnect/reconnect not working with modifiers

ok is now never true (at least without modifiers)

This patch should still be valid, that's a separate issue.

This patch should still be valid, that's a separate issue.

Yep, was just stumbling over this (thx for the fix btw!)

Thx, will commit shortly.

This revision is now accepted and ready to land.Jan 11 2022, 12:58 PM