diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-08-28 18:25:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-08-28 18:25:17 +0400 |
commit | 9ea58be54ef62f79017678c20e04590bb5cbdaa1 (patch) | |
tree | fab9b83a857a932d3643089cb49d7c12fc097c91 /release | |
parent | af85ee01f8b9facf76761e8c3c758ee1ccd18986 (diff) |
- povray and ply work now.
Again, please try not to break scripts - at least grep the release dir for the names you change.
- rna material property rename
gloss_amount -> gloss_factor, since its from 0.0 to 1.0, prefix factor is used on other material settings.
reflectivity -> reflect_factor
Diffstat (limited to 'release')
-rw-r--r-- | release/io/engine_render_pov.py | 17 | ||||
-rw-r--r-- | release/io/export_ply.py | 17 | ||||
-rw-r--r-- | release/ui/buttons_material.py | 10 | ||||
-rw-r--r-- | release/ui/space_sequencer.py | 2 |
4 files changed, 19 insertions, 27 deletions
diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py index f064add505b..c3165d22540 100644 --- a/release/io/engine_render_pov.py +++ b/release/io/engine_render_pov.py @@ -82,8 +82,8 @@ def write_pov(filename, scene=None, info_callback = None): file.write('#declare %s = finish {\n' % name) if material: - file.write('\tdiffuse %.3g\n' % material.diffuse_reflection) - file.write('\tspecular %.3g\n' % material.specular_reflection) + file.write('\tdiffuse %.3g\n' % material.diffuse_intensity) + file.write('\tspecular %.3g\n' % material.specular_intensity) file.write('\tambient %.3g\n' % material.ambient) #file.write('\tambient rgb <%.3g, %.3g, %.3g>\n' % tuple([c*material.ambient for c in world.ambient_color])) # povray blends the global value @@ -101,10 +101,10 @@ def write_pov(filename, scene=None, info_callback = None): if material.raytrace_mirror.enabled: raytrace_mirror= material.raytrace_mirror - if raytrace_mirror.reflect: + if raytrace_mirror.reflect_factor: file.write('\treflection {\n') file.write('\t\trgb <%.3g, %.3g, %.3g>' % tuple(material.mirror_color)) - file.write('\t\tfresnel 1 falloff %.3g exponent %.3g metallic %.3g} ' % (raytrace_mirror.fresnel, raytrace_mirror.fresnel_fac, raytrace_mirror.reflect)) + file.write('\t\tfresnel 1 falloff %.3g exponent %.3g metallic %.3g} ' % (raytrace_mirror.fresnel, raytrace_mirror.fresnel_factor, raytrace_mirror.reflect_factor)) else: file.write('\tdiffuse 0.8\n') @@ -300,14 +300,7 @@ def write_pov(filename, scene=None, info_callback = None): try: vcol_layer = me.active_vertex_color.data except:vcol_layer = None - - def regular_face(f): - fv = f.verts - if fv[3]== 0: - return fv[0], fv[1], fv[2] - return fv[0], fv[1], fv[2], fv[3] - - faces_verts = [regular_face(f) for f in me.faces] + faces_verts = [f.verts for f in me.faces] faces_normals = [tuple(f.normal) for f in me.faces] verts_normals = [tuple(v.normal) for v in me.verts] diff --git a/release/io/export_ply.py b/release/io/export_ply.py index 3668693db16..c293119d3c8 100644 --- a/release/io/export_ply.py +++ b/release/io/export_ply.py @@ -64,7 +64,7 @@ def write(filename, scene, ob, \ raise Exception("Error, Select 1 active object") return - file = open(filename, 'wb') + file = open(filename, 'w') #EXPORT_EDGES = Draw.Create(0) @@ -88,9 +88,9 @@ def write(filename, scene, ob, \ # mesh.transform(ob.matrixWorld) # XXX - faceUV = len(mesh.uv_layers) > 0 + faceUV = len(mesh.uv_textures) > 0 vertexUV = len(mesh.sticky) > 0 - vertexColors = len(mesh.vcol_layers) > 0 + vertexColors = len(mesh.vertex_colors) > 0 if (not faceUV) and (not vertexUV): EXPORT_UV = False if not vertexColors: EXPORT_COLORS = False @@ -100,7 +100,7 @@ def write(filename, scene, ob, \ if faceUV: active_uv_layer = None - for lay in mesh.uv_layers: + for lay in mesh.uv_textures: if lay.active: active_uv_layer= lay.data break @@ -110,7 +110,7 @@ def write(filename, scene, ob, \ if vertexColors: active_col_layer = None - for lay in mesh.vcol_layers: + for lay in mesh.vertex_colors: if lay.active: active_col_layer= lay.data if not active_col_layer: @@ -123,8 +123,8 @@ def write(filename, scene, ob, \ mesh_verts = mesh.verts # save a lookup ply_verts = [] # list of dictionaries # vdict = {} # (index, normal, uv) -> new index - vdict = [{} for i in xrange(len(mesh_verts))] - ply_faces = [[] for f in xrange(len(mesh.faces))] + vdict = [{} for i in range(len(mesh_verts))] + ply_faces = [[] for f in range(len(mesh.faces))] vert_count = 0 for i, f in enumerate(mesh.faces): @@ -141,8 +141,7 @@ def write(filename, scene, ob, \ col = active_col_layer[i] col = col.color1, col.color2, col.color3, col.color4 - f_verts= list(f.verts) - if not f_verts[3]: f_verts.pop() # XXX face length should be 3/4, not always 4 + f_verts= f.verts pf= ply_faces[i] for j, vidx in enumerate(f_verts): diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index e7add9c59f3..e317d990c39 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -426,7 +426,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): split = layout.split() col = split.column() - col.itemR(raym, "reflectivity") + col.itemR(raym, "reflect_factor") col.itemR(mat, "mirror_color", text="") col = split.column() @@ -448,9 +448,9 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): col = split.column() col.itemL(text="Gloss:") - col.itemR(raym, "gloss_amount", text="Amount") + col.itemR(raym, "gloss_factor", text="Amount") sub = col.column() - sub.active = raym.gloss_amount < 1 + sub.active = raym.gloss_factor < 1.0 sub.itemR(raym, "gloss_threshold", text="Threshold") sub.itemR(raym, "gloss_samples", text="Samples") sub.itemR(raym, "gloss_anisotropic", text="Anisotropic") @@ -511,9 +511,9 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): col = split.column() col.itemL(text="Gloss:") - col.itemR(rayt, "gloss_amount", text="Amount") + col.itemR(rayt, "gloss_factor", text="Amount") sub = col.column() - sub.active = rayt.gloss_amount < 1 + sub.active = rayt.gloss_factor < 1.0 sub.itemR(rayt, "gloss_threshold", text="Threshold") sub.itemR(rayt, "gloss_samples", text="Samples") diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index 6b86ea5dabe..de3cfa17987 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -466,7 +466,7 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel): if not strip: return False - return strip.type in ('SOUND') + return strip.type in ('SOUND', ) def draw(self, context): layout = self.layout |