Hi!
I’m exporting particle transforms into a .csv file and use hair strand length to calculate the actual size of a particle (the particle.size parameter always returns 1.0 in case of hair PS). The PS has a mesh as the visualization object.
The problem arises when I disable some percentage of particles for viewport visibility (Particle tab -> Display panel -> Display slider). Blender randomly determines which hair is displayed and which not. In the case of “not displayed” hair, their data (strand segments) is collapsed into a single point, so that if you calculate the length of the strand it returns zero.
You can verify by running this script with a hair PS selected in veiwport:
import bpy
ob = bpy.context.active_object
psys = ob.particle_systems[0]
for p in psys.particles:
h1 = p.hair_keys[0]
h2 = p.hair_keys[-1]
v = h2.co - h1.co
print("size=%f len=%f is_visible=%s" % (p.size, v.length, p.is_visible))
The size parameter stays always the same (useless data in case of hair PS), but the actual size that is calculated from the length of the root-to-tip vector is zero, for each hair particle that is set to “not visible” for viewport. All the hair key segments have the same location, ie. the hair is collapsed into a point, thus made infinitesimally small.
I need to be able to export hair particle transforms for all hair, regardless of visibility. Is there any other way to know the actual size of a hair particle that is “hidden”? Or is this data not available through the python API?