What is the proper way to get the uv’s for child particles (hair)? I looked at the Cycles source code and tried doing something similar with our exporter, but it seems like it only works for a quarter of the hair; for the other three quarters the UV’s look all random. The test scene I have is a UV sphere, with a hair particle system, and Children set to Interpolated, Display Amount set to 10, and Number set to 5000. Our code looks something like:
# psys is the particle system
num_parents = len(psys.particles)
num_children = len(psys.child_particles)
total_hair_count = num_parents + num_children
start_idx = 0
if psys.settings.child_type != 'NONE' and num_children > 0:
start_idx = num_parents
uv_s = []
for pindex in range(start_idx, total_hair_count):
.
.
.
if pindex >= num_parents:
# This is a child particle
particle = psys.particles[0]
else:
particle = psys.particles[pindex]
uv = psys.uv_on_emitter(psys_modifier, particle=particle, particle_no=pindex)
uv_s.append([uv[0], uv[1]])