18
$\begingroup$

Is it possible to select specific particle hairs or hair keys in Blender with Python?

I'm writing a script on Blender 2.73a which involves finding hairs in a system by their index and applying the rekey or subdivide operators to change the number of segments. As I understand it, I'd need to select just the individual hair so that the operators work on it and leave the other hairs alone. So far I've found nothing in the API documentation that would let me do that, just ways to select all or random hairs or to change existing selections.

$\endgroup$
3
  • $\begingroup$ In my exploration I have not been able to find any operator to subdivide or change the number of segments. As best I can tell the number of segments is for the ENTIRE particle system and the UI refuses to let you change it once you have started combing, probably because changing the # of segments requires that it throw away all the combing info (Free Edit) and recalculate the hair keys. $\endgroup$
    – Mutant Bob
    Jun 8, 2015 at 19:10
  • $\begingroup$ I'll bet that there's some kind of operation that has to be done first to "freeze" the particle IDs or indices before you can select any of them or iterate over them. If you can select random hairs then there HAS to be a way to select individual hairs. It might not be exposed, but it seems like it should be possible. $\endgroup$
    – Matt
    May 19, 2016 at 21:46
  • $\begingroup$ You have to tweak it a bit, but the basics are here, namely doing it via the depsgraph: devtalk.blender.org/t/manipulating-particles-in-python/7552/3 $\endgroup$
    – A M
    Jan 30, 2020 at 12:33

3 Answers 3

1
$\begingroup$

wip Answer

Via the Particle Edit Mode it is possible to subdivide single Hairs, therefore it should be possible to recreate this via python. One Constraint here is that the hair system is locked after editing it.

You have to tweak it a bit, but the basics are here, namely doing it via the depsgraph: devtalk.blender.org/t/manipulating-particles-in-python/7552/3 enter image description here

$\endgroup$
0
$\begingroup$

I don't think this is possible, seeing that blender treats hairs as special particles.

$\endgroup$
0
$\begingroup$

The main idea is wrong so it isn't possible. The Blender particle system is made to ease your work, it allows you to avoid to work hair by hair. If you want to select a group of hairs you can simply separate them using the 2 object and 2 particle system.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .