Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
Bug fixes mainly
Browse files Browse the repository at this point in the history
Fixed a bug when user wants to save a combined morph.
Add "reset character" in tool "Create Morph" because I forgot to put it in.
Corrected texts with \n that doesn't work when shown.
  • Loading branch information
TetoTheSquirrelFox committed Apr 1, 2020
1 parent 8fcfa09 commit 0e561ac
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ def execute(self, context):
sculpted = []

if len(scn.mblab_morph_name) < 1:
self.ShowMessageBox("Please choose a name for the morph !\nNo file saved", "Warning", 'ERROR')
self.ShowMessageBox("Please choose a name for the morph ! No file saved", "Warning", 'ERROR')
return {'FINISHED'}
try:
base = morphcreator.get_vertices_list(0)
Expand All @@ -1117,7 +1117,7 @@ def execute(self, context):
return {'FINISHED'}
indexed_vertices = morphcreator.substract_with_index(base, sculpted)
if len(indexed_vertices) < 1:
self.ShowMessageBox("Models base / sculpted are equals !\nNo file saved", "Warning", 'INFO')
self.ShowMessageBox("Models base / sculpted are equals ! No file saved", "Warning", 'INFO')
return {'FINISHED'}
#-------File name----------
file_name = ""
Expand Down Expand Up @@ -2993,6 +2993,7 @@ def draw(self, context):
box_adaptation_tools.operator('mbcrea.button_morphcreator_off', icon=icon_collapse)
box_morphcreator = self.layout.box()
if is_objet == "FOUND":
box_morphcreator.operator("mbast.reset_allproperties", icon="RECOVER_LAST") # Reset character.
box_morphcreator.operator('mbast.button_store_base_vertices', icon="SPHERE") #Store all vertices of the actual body.
box_morphcreator.label(text="Morph wording - Body parts", icon='SORT_ASC')
box_morphcreator.prop(scn, "mblab_body_part_name") #first part of the morph's name : jaws, legs, ...
Expand Down Expand Up @@ -4216,10 +4217,7 @@ def execute(self, context):
scn = bpy.context.scene
base = []
sculpted = []

if len(scn.mblab_morph_name) < 1:
self.ShowMessageBox("Please choose a name for the morph !\nNo file saved", "Warning", 'ERROR')
return {'FINISHED'}

try:
base = morphcreator.get_vertices_list(0)
except:
Expand Down Expand Up @@ -4251,12 +4249,10 @@ def execute(self, context):
#-------Morph name-----------
morph_name = morphcreator.get_combined_morph_name()
#-------Morphs path----------
#Teto
file_path_name = os.path.join(file_ops.get_data_path(), "morphs", file_name + ".json")
file = file_ops.load_json_data(file_path_name, "Try to load a morph file")
file = file_ops.load_json_data(file_path_name, "Try to save a morph file")
if file == None:
file = {}
#End Teto
#---Creating new morph-------
file[morph_name] = indexed_vertices
file_ops.save_json_data(file_path_name, file)
Expand Down

0 comments on commit 0e561ac

Please sign in to comment.