Karl_955 wrote:However, if Blender hair children is to be implemented into the luxblend export, does anybody have an idea about when that would be?
Not only children are not supported but, as far as I remember, parameters using vertex paint are ignored too. That means you cannot change the length of grass with vertex paint, for instance.
Unfortunately people knowing well Pyhton, the blender API, and how to pass the parameters to Luxrender are very few, i suppose. And those who have time to dig into this hairy subject even fewer.
Here is the major thread about implementing the blender hair system in luxblend25:
viewtopic.php?f=11&t=3058&hilit=hair+systemMost of the code seems located in export/geometry.py
- Code: Select all
LuxLog('Exporting Hair system "%s"...' % psys.name)
size = psys.settings.particle_size / 2.0 / 1000.0 # XXX divide by 2 twice ? Also throw in /1000.0 to scale down to millimeters
hair_Junction = (
(
'HAIR_Junction_%s'%psys.name,
psys.settings.material - 1,
'sphere',
ParamSet().add_float('radius', size/2.0)
),
)
hair_Strand = (
(
'HAIR_Strand_%s'%psys.name,
psys.settings.material - 1,
'cylinder',
ParamSet() \
.add_float('radius', size/2.0) \
.add_float('zmin', 0.0) \
.add_float('zmax', 1.0)
),
)
for sn, si, st, sp in hair_Junction:
self.lux_context.objectBegin(sn)
self.lux_context.shape(st, sp)
self.lux_context.objectEnd()
for sn, si, st, sp in hair_Strand:
self.lux_context.objectBegin(sn)
self.lux_context.shape(st, sp)
self.lux_context.objectEnd()
det = DupliExportProgressThread()
det.start(len(psys.particles))
for particle in psys.particles:
if not (particle.is_exist and particle.is_visible): continue
det.exported_objects += 1
points = []
for j in range(len(particle.hair_keys)):
points.append(particle.hair_keys[j].co)
if psys.settings.use_hair_bspline:
temp = []
degree = 2
dimension = 3
for i in range(math.trunc(math.pow(2,psys.settings.render_step))):
if i > 0:
u = i*(len(points)- degree)/math.trunc(math.pow(2,psys.settings.render_step)-1)-0.0000000000001
else:
u = i*(len(points)- degree)/math.trunc(math.pow(2,psys.settings.render_step)-1)
temp.append(self.BSpline(points, dimension, degree, u))
points = temp
for j in range(len(points)-1):
# transpose SB so we can extract columns
# TODO - change when matrix.col is available
SB = obj.matrix_basis.transposed().to_3x3()
SB = fix_matrix_order(SB) # matrix indexing hack
v1 = points[j+1] - points[j]
v2 = SB[2].cross(v1)
v3 = v1.cross(v2)
v2.normalize()
v3.normalize()
if any(v.length_squared == 0 for v in (v1, v2, v3)):
M = SB
else:
# v1, v2, v3 are the new columns
# set as rows, transpose later
M = mathutils.Matrix( (v3,v2,v1) )
M = fix_matrix_order(M) # matrix indexing hack
M = M.transposed().to_4x4()
Mtrans = mathutils.Matrix.Translation(points[j])
matrix = obj.matrix_world * Mtrans * M
self.exportShapeInstances(
obj,
hair_Strand,
matrix=[matrix,None]
)
matrix = obj.matrix_world * Mtrans
self.exportShapeInstances(
obj,
hair_Junction,
matrix=[matrix,None]
)
det.stop()
det.join()
LuxLog('... done, exported %s hairs' % det.exported_objects)