Skip to content

Commit

Permalink
1_5_1
Browse files Browse the repository at this point in the history
Added functions ds_sp_get_object_name and ds_sp_get_file_name
  • Loading branch information
DigiKrafting committed Feb 11, 2019
1 parent b2899ad commit 45f4266
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions ds_sp.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ def ds_sp_get_textures_path():

return _textures_path

def ds_sp_get_object_name():

return bpy.context.active_object.name

def ds_sp_get_file_name():

return bpy.path.basename(bpy.context.blend_data.filepath).replace('.blend','')

def ds_sp_get_texture_file(texture_path,mesh_name,mat_name,texture_name,texture_ext):

if path.exists(texture_path+mesh_name+'_'+mat_name+'_'+texture_name+'.'+texture_ext):
Expand Down Expand Up @@ -285,7 +293,7 @@ def execute(self, context):

def ds_sp_fbx_export_sel(self, context):

_export_name = bpy.context.active_object.name
_export_name = ds_sp_get_object_name()
_export_path = ds_sp_get_export_path()
_export_file = _export_path + _export_name + '.fbx'

Expand All @@ -309,7 +317,7 @@ def execute(self, context):

def ds_sp_fbx_export_scene(self, context):

_export_name = bpy.path.basename(bpy.context.blend_data.filepath).replace('.blend','')
_export_name = ds_sp_get_file_name()
_export_path = ds_sp_get_export_path()
_export_file = _export_path + _export_name + '.fbx'

Expand All @@ -333,7 +341,7 @@ def execute(self, context):

def ds_sp_obj_export_sel(self, context):

_export_name = bpy.context.active_object.name
_export_name = ds_sp_get_object_name()
_export_path = ds_sp_get_export_path()
_export_file = _export_path + _export_name + '.obj'

Expand All @@ -357,7 +365,7 @@ def execute(self, context):

def ds_sp_obj_export_scene(self, context):

_export_name = bpy.path.basename(bpy.context.blend_data.filepath).replace('.blend','')
_export_name = ds_sp_get_file_name()
_export_path = ds_sp_get_export_path()
_export_file = _export_path + _export_name + '.obj'

Expand Down Expand Up @@ -387,7 +395,7 @@ class ds_sp_export_sel(bpy.types.Operator):

def execute(self, context):

_object_name = bpy.context.active_object.name
_object_name = ds_sp_get_object_name()
_export_path = bpy.path.abspath('//')
_export_project = _export_path + _object_name + '.spp'
_textures_path = ds_sp_get_textures_path()
Expand Down Expand Up @@ -418,7 +426,7 @@ class ds_sp_export_scene(bpy.types.Operator):

def execute(self, context):

_export_name = bpy.path.basename(bpy.context.blend_data.filepath).replace('.blend','')
_export_name = ds_sp_get_file_name()
_export_path = bpy.path.abspath('//')
_export_project = _export_path + _export_name + '.spp'
_textures_path = ds_sp_get_textures_path()
Expand Down

0 comments on commit 45f4266

Please sign in to comment.