Skip to content

Commit

Permalink
Beta - 0.6
Browse files Browse the repository at this point in the history
Changelog:
- Animation system implementation
- New shaders:
  - "eut2.dif.lum"
  - "eut2.mlaaweight"
  - "eut2.truckpaint"
  - "eut2.reflective"
  - "eut2.unlit.vcol.tex"
- A lot of new extensions for existing shaders
- Shader presets can now be searched by name, as list is getting longer
- New truck sample base including all the definitions to create complete truck
- Updated sample base with added wind powerplant and human character with animations
- Other improvements worth mentioning:
  - Vertex color statistics tool
  - New versioning system
  - Unified relative paths with forward slash for all platforms
  - Import speed in case of big amount of materials
  • Loading branch information
simon50keda committed Jun 19, 2015
1 parent 1782e44 commit 5d3a280
Show file tree
Hide file tree
Showing 456 changed files with 591,877 additions and 2,509 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,8 @@ docs/_build/

# PyBuilder
target/


# SCS Blender Tools
addon/io_scs_tools/config.txt
*.patch
33 changes: 20 additions & 13 deletions addon/io_scs_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"name": "SCS Tools",
"description": "Setup models, Import-Export SCS data format",
"author": "Milos Zajic (4museman), Simon Lusenc (50keda)",
"version": (0, 5),
"version": (0, 6, "792edf5"),
"blender": (2, 73, 0),
"location": "File > Import-Export",
"warning": "WIP - beta version, doesn't include all features!",
Expand All @@ -31,6 +31,18 @@
"support": "COMMUNITY",
"category": "Import-Export"}


def get_tools_version():
"""Returns Blender Tools version as string from bl_info["version"] dictonary value.
:return: string representation of bl_info["version"] tuple
:rtype: str
"""
ver = ""
for ver_num in bl_info["version"]:
ver += str(ver_num) + "."
return ver[:-1]


import bpy
import os
import traceback
Expand All @@ -55,6 +67,7 @@ class ImportSCS(bpy.types.Operator, ImportHelper):
"""
bl_idname = "import_mesh.pim"
bl_label = "SCS Import"
bl_description = "Load various SCS file formats containing geometries and numerous settings."
bl_options = {'UNDO'}

files = CollectionProperty(name="File Path",
Expand Down Expand Up @@ -185,6 +198,7 @@ class ExportSCS(bpy.types.Operator, ExportHelper):
"""
bl_idname = "export_mesh.pim"
bl_label = "SCS Export"
bl_description = "Export complex geometries to the SCS file formats."

filename_ext = ".pim"
filter_glob = StringProperty(default=str("*" + filename_ext), options={'HIDDEN'})
Expand Down Expand Up @@ -295,8 +309,8 @@ def register():
type=properties.object.ObjectAnimationInventory
)

bpy.types.Scene.scs_shader_presets_inventory = CollectionProperty(
type=properties.scene.SceneShaderPresetsInventory
bpy.types.World.scs_shader_presets_inventory = CollectionProperty(
type=properties.world.SceneShaderPresetsInventory
)

# bpy.types.Scene.scs_cgfx_template_inventory = CollectionProperty(
Expand All @@ -313,7 +327,7 @@ def register():

bpy.types.World.scs_globals = PointerProperty(
name="SCS Tools Global Variables",
type=properties.scene.GlobalSCSProps,
type=properties.world.GlobalSCSProps,
description="SCS Tools global variables",
)

Expand All @@ -335,12 +349,6 @@ def register():
description="SCS Tools Mesh variables",
)

bpy.types.Armature.scs_props = PointerProperty(
name="SCS Tools Armature Variables",
type=properties.armature.ArmatureSCSTools,
description="SCS Tools Armature variables",
)

bpy.types.Material.scs_props = PointerProperty(
name="SCS Tools Material Variables",
type=properties.material.MaterialSCSTools,
Expand Down Expand Up @@ -381,7 +389,6 @@ def unregister():
# REMOVE PROPERTIES FROM DATA
del bpy.types.Action.scs_props
del bpy.types.Material.scs_props
del bpy.types.Armature.scs_props
del bpy.types.Mesh.scs_props
del bpy.types.Scene.scs_props
del bpy.types.Object.scs_props
Expand All @@ -391,9 +398,9 @@ def unregister():
del bpy.types.Object.scs_object_part_inventory
del bpy.types.Object.scs_object_variant_inventory
del bpy.types.Object.scs_object_animation_inventory
del bpy.types.Scene.scs_shader_presets_inventory
del bpy.types.World.scs_shader_presets_inventory


if __name__ == "__main__":
register()
print("Running from if in main module!")
print("Running from if in main module!")
49 changes: 20 additions & 29 deletions addon/io_scs_tools/exp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
from io_scs_tools.exp import pis
from io_scs_tools.exp import pix

from io_scs_tools.utils import object as _object
from io_scs_tools.utils import object as _object_utils
from io_scs_tools.utils import path as _path_utils
from io_scs_tools.utils import get_scs_globals as _get_scs_globals
from io_scs_tools.utils.printout import lprint

Expand All @@ -47,22 +48,15 @@ def batch_export(operator_instance, init_obj_list, exclude_switched_off=True, me
"""

lprint("", report_errors=-1, report_warnings=-1) # Clear the 'error_messages' and 'warning_messages'
game_objects_dict = _object.sort_out_game_objects_for_export(init_obj_list)
game_objects_dict = _object_utils.sort_out_game_objects_for_export(init_obj_list)
if exclude_switched_off:
game_objects_dict = _object.exclude_switched_off(game_objects_dict)
game_objects_dict = _object_utils.exclude_switched_off(game_objects_dict)

if game_objects_dict:
scs_game_objects_exported = []
scs_game_objects_rejected = []

# GET GLOBAL FILE PATH
scs_project_path = _get_scs_globals().scs_project_path
is_blend_file_within_base = bpy.data.filepath != "" and bpy.data.filepath.startswith(scs_project_path)
default_export_path = bpy.context.scene.scs_props.default_export_filepath
# if not set try to use Blender filepath
if default_export_path == "" and is_blend_file_within_base:
global_filepath = os.path.dirname(bpy.data.filepath)
else:
global_filepath = os.path.join(scs_project_path, default_export_path.strip(os.sep * 2))
global_filepath = _path_utils.get_global_export_path()

for root_object in game_objects_dict:

Expand All @@ -76,16 +70,7 @@ def batch_export(operator_instance, init_obj_list, exclude_switched_off=True, me
game_object_list = game_objects_dict[root_object]

# GET CUSTOM FILE PATH
custom_filepath = None
if root_object.scs_props.scs_root_object_allow_custom_path:
scs_root_export_path = root_object.scs_props.scs_root_object_export_filepath
# if not set try to use Blender filepath
if scs_root_export_path == "" and is_blend_file_within_base:
custom_filepath = os.path.dirname(bpy.data.filepath)
print("Custom filepath for Blend file!")
else:
custom_filepath = os.path.join(scs_project_path, scs_root_export_path.strip(os.sep * 2))
print("Custom filepath:", custom_filepath)
custom_filepath = _path_utils.get_custom_scs_root_export_path(root_object)

# MAKE FINAL FILEPATH
if menu_filepath:
Expand All @@ -98,12 +83,12 @@ def batch_export(operator_instance, init_obj_list, exclude_switched_off=True, me
filepath = global_filepath
filepath_message = "Default export path used for \"" + root_object.name + "\":\n\t \"" + filepath + "\""

# print(' filepath (%r):\n%r' % (root_object.name, str(filepath)))
scs_project_path = _get_scs_globals().scs_project_path
if os.path.isdir(filepath) and filepath.startswith(scs_project_path) and scs_project_path != "":
pix.export(filepath, root_object, game_object_list)
scs_game_objects_exported.append("> \"" + root_object.name + "\" exported to: '" + filepath + "'")
# if result != {'FINISHED'}: return {'CANCELLED'}
if pix.export(filepath, root_object, game_object_list):
scs_game_objects_exported.append("> \"" + root_object.name + "\" exported to: '" + filepath + "'")
else:
scs_game_objects_rejected.append("> \"" + root_object.name + "\"")
else:
if filepath:
message = (
Expand All @@ -122,10 +107,16 @@ def batch_export(operator_instance, init_obj_list, exclude_switched_off=True, me
operator_instance.report({'INFO'}, "Export successfully completed!")

if len(scs_game_objects_exported) > 0:
print("\n\nEXPORTED GAME OBJECTS:\n" + "=" * 22)
print("\n\nEXPORTED GAME OBJECTS (" + str(len(scs_game_objects_exported)) + "):\n" + "=" * 26)
for scs_game_object_export_message in scs_game_objects_exported:
print(scs_game_object_export_message)
else:

if len(scs_game_objects_rejected) > 0:
print("\n\nREJECTED GAME OBJECTS (" + str(len(scs_game_objects_rejected)) + "):\n" + "=" * 26)
for scs_game_object_export_message in scs_game_objects_rejected:
print(scs_game_object_export_message)

if len(scs_game_objects_exported) + len(scs_game_objects_rejected) == 0:
message = "Nothing to export! Please set at least one 'SCS Root Object'."
lprint('E ' + message)
operator_instance.report({'ERROR'}, message)
Expand All @@ -137,4 +128,4 @@ def batch_export(operator_instance, init_obj_list, exclude_switched_off=True, me
operator_instance.report({'ERROR'}, message)
return {'CANCELLED'}

return {'FINISHED'}
return {'FINISHED'}
Loading

0 comments on commit 5d3a280

Please sign in to comment.