Skip to content

Commit 781c179

Browse files
committed
Fix typos & bugs && Lint the code
Fixed setting global animation flags, type and fps when exporting KEY file.
1 parent a736bef commit 781c179

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

sith/__init__.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"description": "Import/export 3D model(s), animation(s) and texture(s) for the games based on Sith game engine",
2525
"author": "Crt Vavros",
2626
"version": (1, 0, 0),
27-
"pre_release": "rc1",
28-
"warning": "Pre-release RC1",
27+
"pre_release": "rc2",
28+
"warning": "Pre-release RC2",
2929
"blender": (2, 79, 0),
3030
"location": "File > Import-Export",
3131
"wiki_url": "https://github.com/smlu/blender-sith",
@@ -67,11 +67,11 @@
6767

6868
from sith.model import (
6969
export3do,
70-
import3do,
71-
FaceType,
72-
GeometryMode,
73-
LightMode,
74-
TextureMode
70+
import3do,
71+
FaceType,
72+
GeometryMode,
73+
LightMode,
74+
TextureMode
7575
)
7676

7777
from sith.model.model3doLoader import Model3doFileVersion
@@ -113,7 +113,7 @@ def _get_mesh3do_face_type_list():
113113
(FaceType.TexClamp_x.name , 'Clamp Horizontal' , "Polygon texture is clamped horizontally instead of repeated (Might not be used in JKDF2 & MOTS)" ),
114114
(FaceType.TexClamp_y.name , 'Clamp Vertical' , "Polygon texture is clamped vertically instead of repeated (Might not be used in JKDF2 & MOTS)" ),
115115
(FaceType.TexFilterNone.name , 'Disable Bilinear Filtering', "Disables texture bilinear interpolation filtering and instead point filtering is used as a texture magnification or minification filter" ),
116-
(FaceType.ZWriteDisabled.name, 'Disable ZWrite' , "Disables writting polygon face to depth buffer" ),
116+
(FaceType.ZWriteDisabled.name, 'Disable ZWrite' , "Disables writing polygon face to depth buffer" ),
117117
(FaceType.IjimLedge.name , '(IJIM) Ledge' , "(IJIM only) Polygon face is a ledge that player can grab and hang from" ),
118118
(FaceType.IjimFogEnabled.name, '(IJIM) Enable Fog' , "(IJIM only) Enables fog rendering for polygon face. Enabled by default by the engine" ),
119119
(FaceType.IjimWhipAim.name , '(IJIM) Whip Aim' , "(IJIM only) Polygon face is the start point for player to aim at object with whip" )
@@ -343,7 +343,7 @@ class ExportModel3do(bpy.types.Operator, ExportHelper):
343343
description = "3DO file version",
344344
items = [
345345
(Model3doFileVersion.Version2_1.name, '2.1 - JKDF2 & MOTS', 'Star Wars Jedi Knight: Dark Forces II & Star Wars Jedi Knight: Mysteries of the Sith'),
346-
(Model3doFileVersion.Version2_2.name, '2.2 - IJIM (RGB)' , 'Indiana Jones and the Infernal Machine - RGB color'),
346+
(Model3doFileVersion.Version2_2.name, '2.2 - IJIM (RGB)' , 'Indiana Jones and the Infernal Machine - RGB color' ),
347347
(Model3doFileVersion.Version2_3.name, '2.3 - IJIM' , 'Indiana Jones and the Infernal Machine - RGBA color')
348348
],
349349
default= Model3doFileVersion.Version2_3.name
@@ -450,7 +450,7 @@ def _get_fps_enum_list():
450450
)
451451

452452
fps = bpy.props.EnumProperty(
453-
name = "Frame rate",
453+
name = 'Frame rate',
454454
items = _get_fps_enum_list()
455455
)
456456

@@ -481,18 +481,17 @@ def invoke(self, context, event):
481481
self.obj = _get_export_obj(context, self.report, 'animation')
482482
if self.obj is None:
483483
return {'CANCELLED'}
484-
kfname = bpy.path.display_name_from_filepath(self.obj.name )
484+
kfname = bpy.path.display_name_from_filepath(self.obj.name )
485485
self.filepath = bpy.path.ensure_ext(kfname, self.filename_ext)
486486
return ExportHelper.invoke(self, context, event)
487487

488488
def execute(self, context):
489+
context.scene.key_animation_flags = self.animation_flags
490+
context.scene.key_node_types = self.node_types
491+
context.scene.render.fps = float(self.fps)
489492
scene = context.scene.copy()
490493
try:
491-
scene.key_animation_flags = self.animation_flags
492-
scene.key_animation_type = self.animation_type
493-
scene.render.fps = float(self.fps)
494494
exportKey(self.obj, scene, self.filepath)
495-
496495
self.report({'INFO'}, "KEY '{}' was successfully exported".format(os.path.basename(self.filepath)))
497496
return {'FINISHED'}
498497
except (AssertionError, ValueError) as e:
@@ -541,8 +540,8 @@ def draw(self, context):
541540

542541
class Mesh3doFaceLayer(bpy.types.PropertyGroup):
543542
"""
544-
Intermediant class for temporary storing BMFace properties by Mesh3doFacePanel
545-
and used it to disply stored properties to the UI.
543+
Intermediate class for temporary storing BMFace properties by Mesh3doFacePanel
544+
and used it to display stored properties to the UI.
546545
"""
547546
face_id = bpy.props.IntProperty(default = -1)
548547

0 commit comments

Comments
 (0)