Skip to content

Commit

Permalink
Fixed rendering of animation. The scene updates before it's exporting.
Browse files Browse the repository at this point in the history
Some minor pep8 fixes.
  • Loading branch information
Conz3D committed Jan 31, 2011
1 parent 14a62bc commit 338ac1e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
15 changes: 7 additions & 8 deletions render_povray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ def register():
name="Media Color",
description="The atmospheric media color.",
subtype='COLOR',
precision = 4,
step = 0.01,
precision=4,
step=0.01,
min=0,
soft_max = 1,
soft_max=1,
default=(0.001, 0.001, 0.001),
options={'ANIMATABLE'})

Expand Down Expand Up @@ -285,10 +285,10 @@ def register():
name="Fade Color",
description="Color of filtered attenuation for transparent materials",
subtype='COLOR',
precision = 4,
step = 0.01,
min=0,
soft_max = 1,
precision=4,
step=0.01,
min=0.0,
soft_max=1.0,
default=(0, 0, 0),
options={'ANIMATABLE'})

Expand Down Expand Up @@ -402,7 +402,6 @@ def register():
###########################################################################



def unregister():
import bpy
Scene = bpy.types.Scene
Expand Down
12 changes: 7 additions & 5 deletions render_povray/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,10 @@ def exportCamera():
tabWrite("rotate <%.6f, %.6f, %.6f>\n" % tuple([degrees(e) for e in matrix.rotation_part().to_euler()]))
tabWrite("translate <%.6f, %.6f, %.6f>\n" % (matrix[3][0], matrix[3][1], matrix[3][2]))
if camera.data.pov_dof_enable and focal_point != 0:
tabWrite("aperture %.3g\n"% camera.data.pov_dof_aperture)
tabWrite("blur_samples %d %d\n"% (camera.data.pov_dof_samples_min, camera.data.pov_dof_samples_max))
tabWrite("variance 1/%d\n"% camera.data.pov_dof_variance)
tabWrite("confidence %.3g\n"% camera.data.pov_dof_confidence)
tabWrite("aperture %.3g\n" % camera.data.pov_dof_aperture)
tabWrite("blur_samples %d %d\n" % (camera.data.pov_dof_samples_min, camera.data.pov_dof_samples_max))
tabWrite("variance 1/%d\n" % camera.data.pov_dof_variance)
tabWrite("confidence %.3g\n" % camera.data.pov_dof_confidence)
tabWrite("focal_point <0, 0, %f>\n" % focal_point)
tabWrite("}\n")

Expand Down Expand Up @@ -693,7 +693,7 @@ def exportMeta(metas):

if material:
diffuse_color = material.diffuse_color
trans= 1.0 - material.alpha
trans = 1.0 - material.alpha
if material.use_transparency and material.transparency_method == 'RAYTRACE':
povFilter = material.raytrace_transparency.filter * (1.0 - material.alpha)
trans = (1.0 - material.alpha) - povFilter
Expand Down Expand Up @@ -1707,6 +1707,8 @@ def render(self, scene):
povPath = ""
renderImagePath = ""

scene.frame_set(scene.frame_current) # has to be called to update the frame on exporting animations

if not scene.pov_tempfiles_enable:

# check paths
Expand Down
10 changes: 5 additions & 5 deletions render_povray/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def poll(cls, context):
rd = context.scene.render
return obj and (rd.use_game_engine == False) and (rd.engine in cls.COMPAT_ENGINES)


class CameraDataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
Expand All @@ -147,7 +148,6 @@ def poll(cls, context):
return cam and (rd.use_game_engine == False) and (rd.engine in cls.COMPAT_ENGINES)



class RENDER_PT_povray_export_settings(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Export Settings"
COMPAT_ENGINES = {'POVRAY_RENDER'}
Expand Down Expand Up @@ -405,6 +405,7 @@ def draw(self, context):
mat = context.material
layout.active = mat.pov_mirror_metallic


class MATERIAL_PT_povray_fade_color(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Interior Fade Color"
COMPAT_ENGINES = {'POVRAY_RENDER'}
Expand All @@ -420,6 +421,7 @@ def draw(self, context):
mat = context.material
layout.active = mat.pov_interior_fade_color


class MATERIAL_PT_povray_conserve_energy(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "conserve energy"
COMPAT_ENGINES = {'POVRAY_RENDER'}
Expand Down Expand Up @@ -488,7 +490,7 @@ def draw(self, context):
col.prop(mat, "pov_photons_dispersion", slider=True)
col.prop(mat, "pov_photons_reflection")

if mat.pov_refraction_type=="0" and not mat.pov_photons_reflection:
if mat.pov_refraction_type == "0" and not mat.pov_photons_reflection:
split = layout.split()
col = split.column()
row = col.row()
Expand All @@ -499,7 +501,6 @@ def draw(self, context):
row.label(text="but you didn't chose any !")



class TEXTURE_PT_povray_tex_gamma(TextureButtonsPanel, bpy.types.Panel):
bl_label = "Image Gamma"
COMPAT_ENGINES = {'POVRAY_RENDER'}
Expand Down Expand Up @@ -540,6 +541,7 @@ def draw(self, context):
col.label(text="Photons")
col.prop(obj, "pov_collect_photons", text="Receive Photon Caustics")


class Camera_PT_povray_cam_dof(CameraDataButtonsPanel, bpy.types.Panel):
bl_label = "POV-Ray Depth Of Field"
COMPAT_ENGINES = {'POVRAY_RENDER'}
Expand Down Expand Up @@ -570,5 +572,3 @@ def draw(self, context):

col.prop(cam, "pov_dof_samples_max")
col.prop(cam, "pov_dof_confidence")


0 comments on commit 338ac1e

Please sign in to comment.