Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'render_povray/render.py')
-rw-r--r--render_povray/render.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/render_povray/render.py b/render_povray/render.py
index b9ace50e..0c212fb5 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -2113,11 +2113,16 @@ def write_pov(filename, scene=None, info_callback=None):
strandEnd = 0.01
strandShape = 0.0
# Set the number of particles to render count rather than 3d view display
- pSys.set_resolution(scene, ob, 'RENDER')
+ #pSys.set_resolution(scene, ob, 'RENDER') # DEPRECATED
+ # When you render, the entire dependency graph will be
+ # evaluated at render resolution, including the particles.
+ # In the viewport it will be at viewport resolution.
+ # So there is no need fo render engines to use this function anymore,
+ # it's automatic now.
steps = pSys.settings.display_step
steps = 3 ** steps # or (power of 2 rather than 3) + 1 # Formerly : len(particle.hair_keys)
- totalNumberOfHairs = ( len(pSys.particles) + len(pSys.child_particles) )
+ totalNumberOfHairs = ( pSys.settings.count + pSys.settings.rendered_child_count )
#hairCounter = 0
file.write('#declare HairArray = array[%i] {\n' % totalNumberOfHairs)
for pindex in range(0, totalNumberOfHairs):
@@ -2135,7 +2140,7 @@ def write_pov(filename, scene=None, info_callback=None):
file.write('linear_spline ')
file.write('%i,\n' % (steps))
#changing world coordinates to object local coordinates by multiplying with inverted matrix
- initCo = ob.matrix_world.inverted()*(pSys.co_hair(ob, pindex, 0))
+ initCo = ob.matrix_world.inverted() @ (pSys.co_hair(ob, particle_no = pindex, step = 0))
if ob.material_slots[pSys.settings.material - 1].material and ob.active_material is not None:
pmaterial = ob.material_slots[pSys.settings.material-1].material
for th in pmaterial.texture_slots:
@@ -2159,7 +2164,7 @@ def write_pov(filename, scene=None, info_callback=None):
#only overwrite variable for each competing texture for now
initColor=th.texture.evaluate((initCo[0],initCo[1],initCo[2]))
for step in range(0, steps):
- co = ob.matrix_world.inverted()*(pSys.co_hair(ob, pindex, step))
+ co = ob.matrix_world.inverted() @ (pSys.co_hair(ob, particle_no = pindex, step = step))
#for controlPoint in particle.hair_keys:
if pSys.settings.clump_factor != 0:
hDiameter = pSys.settings.clump_factor / 200.0 * random.uniform(0.5, 1)
@@ -2256,8 +2261,12 @@ def write_pov(filename, scene=None, info_callback=None):
print('Number of tufts (particle systems)', len(ob.particle_systems))
# Set back the displayed number of particles to preview count
- pSys.set_resolution(scene, ob, 'PREVIEW')
-
+ # pSys.set_resolution(scene, ob, 'PREVIEW') #DEPRECATED
+ # When you render, the entire dependency graph will be
+ # evaluated at render resolution, including the particles.
+ # In the viewport it will be at viewport resolution.
+ # So there is no need fo render engines to use this function anymore,
+ # it's automatic now.
if renderEmitter == False:
continue #don't render mesh, skip to next object.