Add a function HairKey.co_object_set() which can be used to modify hair
keys positions in a way that hair strands respects the new coordinates,
without doing extra trickery with edit mode toggle. The naming comes
from existing HairKey.co_object().
The usage is a bit tricky:
- The function is to be called on the hair key from an original object.
- The arguments are to be passed from evaluated object.
hair_key_orig.co_object_set(object_eval, modifier_eval, particle_eval)
This is required because coordinate space conversion needs to know
evaluated state of the hair system in order to access hair space
matrix. It is a deliberate choice to not pass dependency graph and not
to do lookup of evaluated ID on every call of co_object_set() to keep
performance on a manageable levels.
One requirement is that the hair strands are to be calculated once, by,
for example, toggling particle edit mode. Without this there will be no
particles to access hair keys from in the original object.
Such functionality is something what got lost during 2.80 development
and is something what is needed here at the studio.
Below is the file with more complete example: convert strands from mesh
edges to actual particle system hair strands. The viewport refresh is
sometimes missing, and this does not seem to be related to this specific