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:
authorCampbell Barton <ideasman42@gmail.com>2011-07-29 10:26:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-29 10:26:13 +0400
commit3f7e914d5effb63290ab4b1676abbc0556ee04a7 (patch)
treeb5312b816ffcb479bdae251afc5bd486433eba1d
parent2a9841dc56d9a7d1df773c4114f6805674471dd3 (diff)
pep8 edits and some style change
-rw-r--r--io_mesh_raw/__init__.py28
-rw-r--r--io_mesh_raw/import_raw.py2
-rw-r--r--io_scene_fbx/__init__.py2
-rw-r--r--io_scene_obj/import_obj.py99
-rw-r--r--io_scene_x3d/export_x3d.py6
5 files changed, 92 insertions, 45 deletions
diff --git a/io_mesh_raw/__init__.py b/io_mesh_raw/__init__.py
index 0003378f..76257f98 100644
--- a/io_mesh_raw/__init__.py
+++ b/io_mesh_raw/__init__.py
@@ -70,11 +70,28 @@ class RawExporter(bpy.types.Operator):
bl_idname = "export_mesh.raw"
bl_label = "Export RAW"
- filepath = StringProperty(name="File Path", description="Filepath used for exporting the RAW file", maxlen=1024, default= "", subtype='FILE_PATH')
- check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
-
- apply_modifiers = BoolProperty(name="Apply Modifiers", description="Use transformed mesh data from each object", default=True)
- triangulate = BoolProperty(name="Triangulate", description="Triangulate quads.", default=True)
+ filepath = StringProperty(
+ name="File Path",
+ description="Filepath used for exporting the RAW file",
+ maxlen=1024,
+ subtype='FILE_PATH',
+ )
+ check_existing = BoolProperty(
+ name="Check Existing",
+ description="Check and warn on overwriting existing files",
+ default=True,
+ options={'HIDDEN'},
+ )
+ apply_modifiers = BoolProperty(
+ name="Apply Modifiers",
+ description="Use transformed mesh data from each object",
+ default=True,
+ )
+ triangulate = BoolProperty(
+ name="Triangulate",
+ description="Triangulate quads.",
+ default=True,
+ )
def execute(self, context):
from . import export_raw
@@ -107,6 +124,7 @@ def register():
bpy.types.INFO_MT_file_import.append(menu_import)
bpy.types.INFO_MT_file_export.append(menu_export)
+
def unregister():
bpy.utils.unregister_module(__name__)
diff --git a/io_mesh_raw/import_raw.py b/io_mesh_raw/import_raw.py
index 870f880b..f17a41ee 100644
--- a/io_mesh_raw/import_raw.py
+++ b/io_mesh_raw/import_raw.py
@@ -43,6 +43,7 @@ tolerance.
import bpy
+
def readMesh(filename, objName):
file = open(filename, "rb")
@@ -59,7 +60,6 @@ def readMesh(filename, objName):
else:
return None
-
faces = []
for line in file.readlines():
face = line_to_face(line)
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index d17e2dd5..856696c2 100644
--- a/io_scene_fbx/__init__.py
+++ b/io_scene_fbx/__init__.py
@@ -42,7 +42,7 @@ if "bpy" in locals():
import bpy
from bpy.props import StringProperty, BoolProperty, FloatProperty, EnumProperty
-from bpy_extras.io_utils import (ExportHelper,
+from bpy_extras.io_utils import (ExportHelper,
path_reference_mode,
axis_conversion,
axis_conversion_ensure,
diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py
index 239e92ad..d9b88741 100644
--- a/io_scene_obj/import_obj.py
+++ b/io_scene_obj/import_obj.py
@@ -427,7 +427,19 @@ def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP):
return [(value[0], value[1], value[2], key_to_name(key)) for key, value in list(face_split_dict.items())]
-def create_mesh(new_objects, has_ngons, use_ngons, use_edges, verts_loc, verts_tex, faces, unique_materials, unique_material_images, unique_smooth_groups, vertex_groups, dataname):
+def create_mesh(new_objects,
+ has_ngons,
+ use_ngons,
+ use_edges,
+ verts_loc,
+ verts_tex,
+ faces,
+ unique_materials,
+ unique_material_images,
+ unique_smooth_groups,
+ vertex_groups,
+ dataname,
+ ):
'''
Takes all the data gathered and generates a mesh, adding the new object to new_objects
deals with fgons, sharp edges and assigning materials
@@ -452,11 +464,12 @@ def create_mesh(new_objects, has_ngons, use_ngons, use_edges, verts_loc, verts_t
# reverse loop through face indices
for f_idx in range(len(faces) - 1, -1, -1):
- face_vert_loc_indices,\
- face_vert_tex_indices,\
- context_material,\
- context_smooth_group,\
- context_object = faces[f_idx]
+ (face_vert_loc_indices,
+ face_vert_tex_indices,
+ context_material,
+ context_smooth_group,
+ context_object,
+ ) = faces[f_idx]
len_face_vert_loc_indices = len(face_vert_loc_indices)
@@ -494,15 +507,20 @@ def create_mesh(new_objects, has_ngons, use_ngons, use_edges, verts_loc, verts_t
if has_ngons and len_face_vert_loc_indices > 4:
ngon_face_indices = ngon_tesselate(verts_loc, face_vert_loc_indices)
- faces.extend(
- [(
- [face_vert_loc_indices[ngon[0]], face_vert_loc_indices[ngon[1]], face_vert_loc_indices[ngon[2]]],
- [face_vert_tex_indices[ngon[0]], face_vert_tex_indices[ngon[1]], face_vert_tex_indices[ngon[2]]],
- context_material,
- context_smooth_group,
- context_object)
- for ngon in ngon_face_indices]
- )
+ faces.extend([([face_vert_loc_indices[ngon[0]],
+ face_vert_loc_indices[ngon[1]],
+ face_vert_loc_indices[ngon[2]],
+ ],
+ [face_vert_tex_indices[ngon[0]],
+ face_vert_tex_indices[ngon[1]],
+ face_vert_tex_indices[ngon[2]],
+ ],
+ context_material,
+ context_smooth_group,
+ context_object,
+ )
+ for ngon in ngon_face_indices]
+ )
# edges to make fgons
if use_ngons:
@@ -575,11 +593,12 @@ def create_mesh(new_objects, has_ngons, use_ngons, use_edges, verts_loc, verts_t
blender_face = me.faces[i]
- face_vert_loc_indices,\
- face_vert_tex_indices,\
- context_material,\
- context_smooth_group,\
- context_object = face
+ (face_vert_loc_indices,
+ face_vert_tex_indices,
+ context_material,
+ context_smooth_group,
+ context_object,
+ ) = face
if context_smooth_group:
blender_face.use_smooth = True
@@ -887,13 +906,12 @@ def load(operator, context, filepath,
face_vert_tex_indices = []
# Instance a face
- faces.append((\
- face_vert_loc_indices,\
- face_vert_tex_indices,\
- context_material,\
- context_smooth_group,\
- context_object\
- ))
+ faces.append((face_vert_loc_indices,
+ face_vert_tex_indices,
+ context_material,
+ context_smooth_group,
+ context_object,
+ ))
if strip_slash(line_split):
context_multi_line = b'f'
@@ -944,13 +962,12 @@ def load(operator, context, filepath,
face_vert_tex_indices = []
# Instance a face
- faces.append((\
- face_vert_loc_indices,\
- face_vert_tex_indices,\
- context_material,\
- context_smooth_group,\
- context_object\
- ))
+ faces.append((face_vert_loc_indices,
+ face_vert_tex_indices,
+ context_material,
+ context_smooth_group,
+ context_object,
+ ))
if strip_slash(line_split):
context_multi_line = b'l'
@@ -1088,7 +1105,19 @@ def load(operator, context, filepath,
for verts_loc_split, faces_split, unique_materials_split, dataname in split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP):
# Create meshes from the data, warning 'vertex_groups' wont support splitting
- create_mesh(new_objects, has_ngons, use_ngons, use_edges, verts_loc_split, verts_tex, faces_split, unique_materials_split, unique_material_images, unique_smooth_groups, vertex_groups, dataname)
+ create_mesh(new_objects,
+ has_ngons,
+ use_ngons,
+ use_edges,
+ verts_loc_split,
+ verts_tex,
+ faces_split,
+ unique_materials_split,
+ unique_material_images,
+ unique_smooth_groups,
+ vertex_groups,
+ dataname,
+ )
# nurbs support
for context_nurbs in nurbs:
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 52f19a93..a89fb30a 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -218,7 +218,7 @@ def export(file,
return ident
def writeFooter(ident):
-
+
if use_h3d:
# global
for route in h3d_material_route:
@@ -1012,7 +1012,7 @@ def export(file,
value = '%.6g %.6g %.6g' % (global_matrix * lamp_obj.matrix_world).to_translation()[:]
fw('%s<field name="%s" type="SFVec3f" accessType="inputOutput" value="%s" />\n' % (ident, uniform['varname'], value))
-
+
# ------------------------------------------------------
# shader-patch
fw('%s<field name="%s_transform" type="SFMatrix4f" accessType="inputOutput" />\n' % (ident, uniform['varname']))
@@ -1022,7 +1022,7 @@ def export(file,
h3d_material_route.append(
'<ROUTE fromNode=%s fromField="accForwardMatrix" toNode=%s toField="%s_transform" />' %
(suffix_quoted_str(lamp_obj_id, "_TRANSFORM"), material_id, uniform['varname']))
-
+
h3d_material_route.append(
'<ROUTE fromNode=%s fromField="location" toNode=%s toField="%s" />' %
(suffix_quoted_str(lamp_obj_id, "_TRANSFORM"), material_id, uniform['varname']))