Skip to content
Snippets Groups Projects
Commit 3dbeaddc authored by Campbell Barton's avatar Campbell Barton
Browse files

pep8 compliance

parent 3745d7d6
No related branches found
No related tags found
No related merge requests found
props.bf_Shank_Dia = 10.0 props.bf_Shank_Dia = 10.0
#props.bf_Pitch = 1.5 #Coarse #props.bf_Pitch = 1.5 # Coarse
props.bf_Pitch = 1.25 #Fine props.bf_Pitch = 1.25 # Fine
props.bf_Crest_Percent = 10 props.bf_Crest_Percent = 10
props.bf_Root_Percent = 10 props.bf_Root_Percent = 10
props.bf_Major_Dia = 10.0 props.bf_Major_Dia = 10.0
...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 8.0 ...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 8.0
props.bf_Allen_Bit_Depth = 5.0 props.bf_Allen_Bit_Depth = 5.0
props.bf_Pan_Head_Dia = 20.0 props.bf_Pan_Head_Dia = 20.0
props.bf_Dome_Head_Dia = 20.0 props.bf_Dome_Head_Dia = 20.0
props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia*(1.82/5.6) props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia * (1.82 / 5.6)
#props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia) #props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia)
props.bf_Hex_Nut_Height = 8.0 props.bf_Hex_Nut_Height = 8.0
props.bf_Hex_Nut_Flat_Distance = 17.0 props.bf_Hex_Nut_Flat_Distance = 17.0
......
#props.bf_Pitch = 1.75 #Coarse #props.bf_Pitch = 1.75 # Coarse
props.bf_Pitch = 1.50 #Fine props.bf_Pitch = 1.50 # Fine
props.bf_Crest_Percent = 10 props.bf_Crest_Percent = 10
props.bf_Root_Percent = 10 props.bf_Root_Percent = 10
props.bf_Major_Dia = 12.0 props.bf_Major_Dia = 12.0
...@@ -13,7 +13,7 @@ props.bf_Allen_Bit_Flat_Distance = 10.0 ...@@ -13,7 +13,7 @@ props.bf_Allen_Bit_Flat_Distance = 10.0
props.bf_Allen_Bit_Depth = 6.0 props.bf_Allen_Bit_Depth = 6.0
props.bf_Pan_Head_Dia = 24.0 props.bf_Pan_Head_Dia = 24.0
props.bf_Dome_Head_Dia = 24.0 props.bf_Dome_Head_Dia = 24.0
props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia*(1.82/5.6) props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia * (1.82 / 5.6)
#props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia) #props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia)
props.bf_Hex_Nut_Height = 10.0 props.bf_Hex_Nut_Height = 10.0
props.bf_Hex_Nut_Flat_Distance = 19.0 props.bf_Hex_Nut_Flat_Distance = 19.0
......
props.bf_Shank_Dia = 3.0 props.bf_Shank_Dia = 3.0
#props.bf_Pitch = 0.5 #Coarse #props.bf_Pitch = 0.5 # Coarse
props.bf_Pitch = 0.35 #Fine props.bf_Pitch = 0.35 # Fine
props.bf_Crest_Percent = 10 props.bf_Crest_Percent = 10
props.bf_Root_Percent = 10 props.bf_Root_Percent = 10
props.bf_Major_Dia = 3.0 props.bf_Major_Dia = 3.0
props.bf_Minor_Dia = props.bf_Major_Dia - (1.082532 * props.bf_Pitch) props.bf_Minor_Dia = props.bf_Major_Dia - (1.082532 * props.bf_Pitch)
props.bf_Hex_Head_Flat_Distance = 5.5 props.bf_Hex_Head_Flat_Distance = 5.5
...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 2.5 ...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 2.5
props.bf_Allen_Bit_Depth = 1.5 props.bf_Allen_Bit_Depth = 1.5
props.bf_Pan_Head_Dia = 5.6 props.bf_Pan_Head_Dia = 5.6
props.bf_Dome_Head_Dia = 5.6 props.bf_Dome_Head_Dia = 5.6
props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia*(1.82/5.6) props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia * (1.82 / 5.6)
#props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia) #props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia)
props.bf_Hex_Nut_Height = 2.4 props.bf_Hex_Nut_Height = 2.4
props.bf_Hex_Nut_Flat_Distance = 5.5 props.bf_Hex_Nut_Flat_Distance = 5.5
......
props.bf_Shank_Dia = 4.0 props.bf_Shank_Dia = 4.0
#props.bf_Pitch = 0.7 #Coarse #props.bf_Pitch = 0.7 # Coarse
props.bf_Pitch = 0.5 #Fine props.bf_Pitch = 0.5 # Fine
props.bf_Crest_Percent = 10 props.bf_Crest_Percent = 10
props.bf_Root_Percent = 10 props.bf_Root_Percent = 10
props.bf_Major_Dia = 4.0 props.bf_Major_Dia = 4.0
props.bf_Minor_Dia = props.bf_Major_Dia - (1.082532 * props.bf_Pitch) props.bf_Minor_Dia = props.bf_Major_Dia - (1.082532 * props.bf_Pitch)
props.bf_Hex_Head_Flat_Distance = 7.0 props.bf_Hex_Head_Flat_Distance = 7.0
...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 3.0 ...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 3.0
props.bf_Allen_Bit_Depth = 2.0 props.bf_Allen_Bit_Depth = 2.0
props.bf_Pan_Head_Dia = 8.0 props.bf_Pan_Head_Dia = 8.0
props.bf_Dome_Head_Dia = 8.0 props.bf_Dome_Head_Dia = 8.0
props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia*(1.82/5.6) props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia * (1.82 / 5.6)
#props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia) #props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia)
props.bf_Hex_Nut_Height = 3.2 props.bf_Hex_Nut_Height = 3.2
props.bf_Hex_Nut_Flat_Distance = 7.0 props.bf_Hex_Nut_Flat_Distance = 7.0
......
props.bf_Shank_Dia = 5.0 props.bf_Shank_Dia = 5.0
#props.bf_Pitch = 0.8 #Coarse #props.bf_Pitch = 0.8 # Coarse
props.bf_Pitch = 0.5 #Fine props.bf_Pitch = 0.5 # Fine
props.bf_Crest_Percent = 10 props.bf_Crest_Percent = 10
props.bf_Root_Percent = 10 props.bf_Root_Percent = 10
props.bf_Major_Dia = 5.0 props.bf_Major_Dia = 5.0
props.bf_Minor_Dia = props.bf_Major_Dia - (1.082532 * props.bf_Pitch) props.bf_Minor_Dia = props.bf_Major_Dia - (1.082532 * props.bf_Pitch)
props.bf_Hex_Head_Flat_Distance = 8.0 props.bf_Hex_Head_Flat_Distance = 8.0
...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 4.0 ...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 4.0
props.bf_Allen_Bit_Depth = 2.5 props.bf_Allen_Bit_Depth = 2.5
props.bf_Pan_Head_Dia = 9.5 props.bf_Pan_Head_Dia = 9.5
props.bf_Dome_Head_Dia = 9.5 props.bf_Dome_Head_Dia = 9.5
props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia*(1.82/5.6) props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia * (1.82 / 5.6)
#props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia) #props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia)
props.bf_Hex_Nut_Height = 4.0 props.bf_Hex_Nut_Height = 4.0
props.bf_Hex_Nut_Flat_Distance = 8.0 props.bf_Hex_Nut_Flat_Distance = 8.0
......
props.bf_Shank_Dia = 6.0 props.bf_Shank_Dia = 6.0
#bf_Pitch = 1.0 #Coarse #bf_Pitch = 1.0 # Coarse
props.bf_Pitch = 0.75 #Fine props.bf_Pitch = 0.75 # Fine
props.bf_Crest_Percent = 10 props.bf_Crest_Percent = 10
props.bf_Root_Percent = 10 props.bf_Root_Percent = 10
props.bf_Major_Dia = 6.0 props.bf_Major_Dia = 6.0
...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 5.0 ...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 5.0
props.bf_Allen_Bit_Depth = 3.0 props.bf_Allen_Bit_Depth = 3.0
props.bf_Pan_Head_Dia = 12.0 props.bf_Pan_Head_Dia = 12.0
props.bf_Dome_Head_Dia = 12.0 props.bf_Dome_Head_Dia = 12.0
props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia*(1.82/5.6) props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia * (1.82 / 5.6)
#props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia) #props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia)
props.bf_Hex_Nut_Height = 5.0 props.bf_Hex_Nut_Height = 5.0
props.bf_Hex_Nut_Flat_Distance = 10.0 props.bf_Hex_Nut_Flat_Distance = 10.0
......
props.bf_Shank_Dia = 8.0 props.bf_Shank_Dia = 8.0
#props.bf_Pitch = 1.25 #Coarse #props.bf_Pitch = 1.25 # Coarse
props.bf_Pitch = 1.00 #Fine props.bf_Pitch = 1.00 # Fine
props.bf_Crest_Percent = 10 props.bf_Crest_Percent = 10
props.bf_Root_Percent = 10 props.bf_Root_Percent = 10
props.bf_Major_Dia = 8.0 props.bf_Major_Dia = 8.0
...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 6.0 ...@@ -14,7 +14,7 @@ props.bf_Allen_Bit_Flat_Distance = 6.0
props.bf_Allen_Bit_Depth = 4.0 props.bf_Allen_Bit_Depth = 4.0
props.bf_Pan_Head_Dia = 16.0 props.bf_Pan_Head_Dia = 16.0
props.bf_Dome_Head_Dia = 16.0 props.bf_Dome_Head_Dia = 16.0
props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia*(1.82/5.6) props.bf_Philips_Bit_Dia = props.bf_Pan_Head_Dia * (1.82 / 5.6)
#props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia) #props.bf_Phillips_Bit_Depth = Get_Phillips_Bit_Height(props.bf_Philips_Bit_Dia)
props.bf_Hex_Nut_Height = 6.5 props.bf_Hex_Nut_Height = 6.5
props.bf_Hex_Nut_Flat_Distance = 13.0 props.bf_Hex_Nut_Flat_Distance = 13.0
......
...@@ -234,7 +234,7 @@ def load_ply(filepath): ...@@ -234,7 +234,7 @@ def load_ply(filepath):
colindices = el.index(b'red'), el.index(b'green'), el.index(b'blue') colindices = el.index(b'red'), el.index(b'green'), el.index(b'blue')
if -1 in colindices: if -1 in colindices:
colindices = None colindices = None
else: # if not a float assume uchar else: # if not a float assume uchar
colmultiply = [1.0 if el.properties[i].numeric_type in ('f', 'd') else (1.0 / 256.0) for i in colindices] colmultiply = [1.0 if el.properties[i].numeric_type in ('f', 'd') else (1.0 / 256.0) for i in colindices]
elif el.name == b'face': elif el.name == b'face':
......
...@@ -67,12 +67,11 @@ class ExportMAP(bpy.types.Operator, ExportHelper): ...@@ -67,12 +67,11 @@ class ExportMAP(bpy.types.Operator, ExportHelper):
keywords = self.as_keywords(ignore=("axis_forward", "axis_up", "global_scale", "check_existing", "filter_glob")) keywords = self.as_keywords(ignore=("axis_forward", "axis_up", "global_scale", "check_existing", "filter_glob"))
keywords["global_matrix"] = global_matrix keywords["global_matrix"] = global_matrix
''' '''
keywords = self.as_keywords(ignore=("check_existing", "filter_glob")) keywords = self.as_keywords(ignore=("check_existing", "filter_glob"))
from . import export_map from . import export_map
return export_map.save(self, context, **keywords) return export_map.save(self, context, **keywords)
def menu_func(self, context): def menu_func(self, context):
......
...@@ -63,7 +63,7 @@ def write_cube2brush(file, faces): ...@@ -63,7 +63,7 @@ def write_cube2brush(file, faces):
for f in faces: for f in faces:
# from 4 verts this gets them in reversed order and only 3 of them # from 4 verts this gets them in reversed order and only 3 of them
# 0,1,2,3 -> 2,1,0 # 0,1,2,3 -> 2,1,0
me = f.id_data #XXX25 me = f.id_data # XXX25
for v in f.vertices[:][2::-1]: for v in f.vertices[:][2::-1]:
file.write(format_vec % me.vertices[v].co[:]) file.write(format_vec % me.vertices[v].co[:])
...@@ -115,9 +115,9 @@ def write_face2brush(file, face): ...@@ -115,9 +115,9 @@ def write_face2brush(file, face):
image_text = os.path.splitext(os.path.basename(image.filename))[0] image_text = os.path.splitext(os.path.basename(image.filename))[0]
# reuse face vertices # reuse face vertices
_v = face.id_data.vertices #XXX25 _v = face.id_data.vertices # XXX25
f_vertices = [_v[vi] for vi in face.vertices] f_vertices = [_v[vi] for vi in face.vertices]
del _v #XXX25 del _v # XXX25
# original verts as tuples for writing # original verts as tuples for writing
orig_vco = [v.co[:] for v in f_vertices] orig_vco = [v.co[:] for v in f_vertices]
...@@ -467,5 +467,5 @@ def save(operator, ...@@ -467,5 +467,5 @@ def save(operator,
): ):
export_map(context, filepath) export_map(context, filepath)
return {'FINISHED'} return {'FINISHED'}
...@@ -82,7 +82,7 @@ def prefix_quoted_str(value, prefix): ...@@ -82,7 +82,7 @@ def prefix_quoted_str(value, prefix):
def build_hierarchy(objects): def build_hierarchy(objects):
""" returns parent child relationships, skipping """ returns parent child relationships, skipping
""" """
objects_set = set(objects) objects_set = set(objects)
par_lookup = {} par_lookup = {}
...@@ -101,6 +101,7 @@ def build_hierarchy(objects): ...@@ -101,6 +101,7 @@ def build_hierarchy(objects):
return par_lookup[None] return par_lookup[None]
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# H3D Functions # H3D Functions
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
...@@ -110,7 +111,7 @@ def h3d_shader_glsl_frag_patch(filepath): ...@@ -110,7 +111,7 @@ def h3d_shader_glsl_frag_patch(filepath):
for l in h3d_file: for l in h3d_file:
l = l.replace("uniform mat4 unfinvviewmat;", "") l = l.replace("uniform mat4 unfinvviewmat;", "")
l = l.replace("unfinvviewmat", "gl_ModelViewMatrixInverse") l = l.replace("unfinvviewmat", "gl_ModelViewMatrixInverse")
''' '''
l = l.replace("varying vec3 varposition;", "") l = l.replace("varying vec3 varposition;", "")
l = l.replace("varposition", "gl_Vertex") # not needed int H3D l = l.replace("varposition", "gl_Vertex") # not needed int H3D
...@@ -121,14 +122,12 @@ def h3d_shader_glsl_frag_patch(filepath): ...@@ -121,14 +122,12 @@ def h3d_shader_glsl_frag_patch(filepath):
#l = l.replace("varnormal", "normalize(-(gl_ModelViewMatrix * gl_Vertex).xyz)") # view normal #l = l.replace("varnormal", "normalize(-(gl_ModelViewMatrix * gl_Vertex).xyz)") # view normal
# l = l.replace("varnormal", "gl_NormalMatrix * gl_Normal") # view normal # l = l.replace("varnormal", "gl_NormalMatrix * gl_Normal") # view normal
lines.append(l) lines.append(l)
h3d_file.close() h3d_file.close()
h3d_file = open(filepath, 'w') h3d_file = open(filepath, 'w')
h3d_file.writelines(lines) h3d_file.writelines(lines)
h3d_file.close() h3d_file.close()
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
...@@ -155,7 +154,7 @@ def export(file, ...@@ -155,7 +154,7 @@ def export(file,
from xml.sax.saxutils import quoteattr from xml.sax.saxutils import quoteattr
uuid_cache_object = {} # object uuid_cache_object = {} # object
uuid_cache_lamp = {} # 'LA_' + object.name uuid_cache_lamp = {} # 'LA_' + object.name
uuid_cache_view = {} # object, different namespace uuid_cache_view = {} # object, different namespace
uuid_cache_mesh = {} # mesh uuid_cache_mesh = {} # mesh
uuid_cache_material = {} # material uuid_cache_material = {} # material
...@@ -268,7 +267,7 @@ def export(file, ...@@ -268,7 +267,7 @@ def export(file,
fw(ident_step + '>\n') fw(ident_step + '>\n')
ident += '\t' ident += '\t'
return ident return ident
def writeTransform_end(ident): def writeTransform_end(ident):
ident = ident[:-1] ident = ident[:-1]
fw('%s</Transform>\n' % ident) fw('%s</Transform>\n' % ident)
...@@ -796,9 +795,9 @@ def export(file, ...@@ -796,9 +795,9 @@ def export(file,
ident = ident[:-1] ident = ident[:-1]
fw('%s</Shape>\n' % ident) fw('%s</Shape>\n' % ident)
# XXX # XXX
#fw('%s<PythonScript DEF="PS" url="object.py" >\n' % ident) #fw('%s<PythonScript DEF="PS" url="object.py" >\n' % ident)
#fw('%s <ShaderProgram USE="MA_Material.005" containerField="references"/>\n' % ident) #fw('%s <ShaderProgram USE="MA_Material.005" containerField="references"/>\n' % ident)
#fw('%s</PythonScript>\n' % ident) #fw('%s</PythonScript>\n' % ident)
...@@ -865,7 +864,7 @@ def export(file, ...@@ -865,7 +864,7 @@ def export(file,
fw('%s<ComposedShader USE=%s />\n' % (ident, material_id)) fw('%s<ComposedShader USE=%s />\n' % (ident, material_id))
else: else:
material.tag = True material.tag = True
# GPU_material_bind_uniforms # GPU_material_bind_uniforms
# GPU_begin_object_materials # GPU_begin_object_materials
...@@ -1023,7 +1022,7 @@ def export(file, ...@@ -1023,7 +1022,7 @@ def export(file,
fw('%s<field name="%s" type="SFNode" accessType="inputOutput">\n' % (ident, uniform['varname'])) fw('%s<field name="%s" type="SFNode" accessType="inputOutput">\n' % (ident, uniform['varname']))
ident += '\t' ident += '\t'
ident_step = ident + (' ' * (-len(ident) + \ ident_step = ident + (' ' * (-len(ident) + \
fw('%s<PixelTexture \n' % ident))) fw('%s<PixelTexture \n' % ident)))
fw(ident_step + 'repeatS="false"\n') fw(ident_step + 'repeatS="false"\n')
...@@ -1032,21 +1031,17 @@ def export(file, ...@@ -1032,21 +1031,17 @@ def export(file,
fw(ident_step + 'image="%s 1 4 %s"\n' % (len(value), " ".join(value))) fw(ident_step + 'image="%s 1 4 %s"\n' % (len(value), " ".join(value)))
fw(ident_step + '/>\n') fw(ident_step + '/>\n')
ident = ident[:-1] ident = ident[:-1]
fw('%s</field>\n' % ident) fw('%s</field>\n' % ident)
#for i in range(0, 10, 4) #for i in range(0, 10, 4)
#value = ' '.join(['%d' % f for f in uniform['texpixels']]) #value = ' '.join(['%d' % f for f in uniform['texpixels']])
# value = ' '.join(['%.6g' % (f / 256) for f in uniform['texpixels']]) # value = ' '.join(['%.6g' % (f / 256) for f in uniform['texpixels']])
#fw('%s<field name="%s" type="SFInt32" accessType="inputOutput" value="%s" />\n' % (ident, uniform['varname'], value)) #fw('%s<field name="%s" type="SFInt32" accessType="inputOutput" value="%s" />\n' % (ident, uniform['varname'], value))
#print('test', len(uniform['texpixels'])) #print('test', len(uniform['texpixels']))
else: else:
assert(0) assert(0)
else: else:
...@@ -1187,12 +1182,12 @@ def export(file, ...@@ -1187,12 +1182,12 @@ def export(file,
obj_main_matrix_world_invert = obj_main_matrix_world.inverted() obj_main_matrix_world_invert = obj_main_matrix_world.inverted()
obj_main_id = unique_name(obj_main, obj_main.name, uuid_cache_object, clean_func=quoteattr) obj_main_id = unique_name(obj_main, obj_main.name, uuid_cache_object, clean_func=quoteattr)
ident = writeTransform_begin(ident, obj_main_matrix if obj_main_parent else global_matrix * obj_main_matrix, obj_main_id) ident = writeTransform_begin(ident, obj_main_matrix if obj_main_parent else global_matrix * obj_main_matrix, obj_main_id)
for obj, obj_matrix in derived: for obj, obj_matrix in derived:
obj_type = obj.type obj_type = obj.type
if use_hierarchy: if use_hierarchy:
# make transform node relative # make transform node relative
obj_matrix = obj_main_matrix_world_invert * obj_matrix obj_matrix = obj_main_matrix_world_invert * obj_matrix
......
# ##### BEGIN GPL LICENSE BLOCK ##### # ##### BEGIN GPL LICENSE BLOCK #####
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
...@@ -169,6 +169,7 @@ def safety(name, Level): ...@@ -169,6 +169,7 @@ def safety(name, Level):
def is_renderable(scene, ob): def is_renderable(scene, ob):
return (ob.is_visible(scene) and not ob.hide_render) return (ob.is_visible(scene) and not ob.hide_render)
def renderable_objects(scene): def renderable_objects(scene):
return [ob for ob in scene.objects if is_renderable(scene, ob)] return [ob for ob in scene.objects if is_renderable(scene, ob)]
...@@ -239,10 +240,10 @@ def write_pov(filename, scene=None, info_callback=None): ...@@ -239,10 +240,10 @@ def write_pov(filename, scene=None, info_callback=None):
matrix[3][1], matrix[3][2])) matrix[3][1], matrix[3][2]))
def MatrixAsPovString(matrix): def MatrixAsPovString(matrix):
sMatrix=("matrix <%.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, " \ sMatrix = ("matrix <%.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, " \
"%.6f>\n" % (matrix[0][0], matrix[0][1], matrix[0][2], matrix[1][0], matrix[1][1], "%.6f>\n" % (matrix[0][0], matrix[0][1], matrix[0][2], matrix[1][0], matrix[1][1],
matrix[1][2], matrix[2][0], matrix[2][1], matrix[2][2], matrix[3][0], matrix[1][2], matrix[2][0], matrix[2][1], matrix[2][2], matrix[3][0],
matrix[3][1], matrix[3][2])) matrix[3][1], matrix[3][2]))
return sMatrix return sMatrix
def writeObjectMaterial(material, ob): def writeObjectMaterial(material, ob):
...@@ -783,6 +784,7 @@ def write_pov(filename, scene=None, info_callback=None): ...@@ -783,6 +784,7 @@ def write_pov(filename, scene=None, info_callback=None):
# * EXACTLY the same materials, in EXACTLY the same sockets. # * EXACTLY the same materials, in EXACTLY the same sockets.
# … can share a same instance in POV export. # … can share a same instance in POV export.
obmats2data = {} obmats2data = {}
def checkObjectMaterials(ob, name, dataname): def checkObjectMaterials(ob, name, dataname):
if hasattr(ob, 'material_slots'): if hasattr(ob, 'material_slots'):
has_local_mats = False has_local_mats = False
...@@ -807,6 +809,7 @@ def write_pov(filename, scene=None, info_callback=None): ...@@ -807,6 +809,7 @@ def write_pov(filename, scene=None, info_callback=None):
return None return None
data_ref = {} data_ref = {}
def store(scene, ob, name, dataname, matrix): def store(scene, ob, name, dataname, matrix):
# The Object needs to be written at least once but if its data is # The Object needs to be written at least once but if its data is
# already in data_ref this has already been done. # already in data_ref this has already been done.
...@@ -831,7 +834,6 @@ def write_pov(filename, scene=None, info_callback=None): ...@@ -831,7 +834,6 @@ def write_pov(filename, scene=None, info_callback=None):
data_ref[dataname] = [(name, MatrixAsPovString(matrix))] data_ref[dataname] = [(name, MatrixAsPovString(matrix))]
return dataname return dataname
ob_num = 0 ob_num = 0
for ob in sel: for ob in sel:
ob_num += 1 ob_num += 1
...@@ -1533,7 +1535,6 @@ def write_pov(filename, scene=None, info_callback=None): ...@@ -1533,7 +1535,6 @@ def write_pov(filename, scene=None, info_callback=None):
except IndexError: except IndexError:
print(me) print(me)
#Importance for radiosity sampling added here: #Importance for radiosity sampling added here:
tabWrite("radiosity { \n") tabWrite("radiosity { \n")
tabWrite("importance %3g \n" % importance) tabWrite("importance %3g \n" % importance)
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
from bpy.props import StringProperty, BoolProperty, IntProperty, FloatProperty, \ from bpy.props import StringProperty, BoolProperty, IntProperty, FloatProperty, \
FloatVectorProperty, EnumProperty FloatVectorProperty, EnumProperty
......
...@@ -302,6 +302,7 @@ def obRot(ob, active, context): ...@@ -302,6 +302,7 @@ def obRot(ob, active, context):
def obSca(ob, active, context): def obSca(ob, active, context):
ob.scale = active.scale ob.scale = active.scale
def obVisLoc(ob, active, context): def obVisLoc(ob, active, context):
if ob.parent: if ob.parent:
mat = world_to_basis(active, ob, context) mat = world_to_basis(active, ob, context)
...@@ -324,7 +325,8 @@ def obVisSca(ob, active, context): ...@@ -324,7 +325,8 @@ def obVisSca(ob, active, context):
ob.scale = mat.to_scale() ob.scale = mat.to_scale()
else: else:
ob.scale = active.matrix_world.to_scale() ob.scale = active.matrix_world.to_scale()
def obDrw(ob, active, context): def obDrw(ob, active, context):
ob.draw_type = active.draw_type ob.draw_type = active.draw_type
ob.show_axis = active.show_axis ob.show_axis = active.show_axis
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment