Skip to content

Commit

Permalink
Quick & dirty sanitization for file names to cover common cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightriff committed Dec 20, 2024
1 parent 8a7f544 commit b841565
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/upload_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ def upload(cls, window_manager, area, scene, view_layer, preferences, target_obj

add_on_preferences = get_add_on_preferences(preferences)
temporary_directory = TemporaryDirectory()
exported_file_path = Path(temporary_directory.name) / f"{target_object.name}.fbx"
sanitized_object_name = "".join(c for c in target_object.name if c.isalnum() or c in (' ','.','_')).rstrip()
exported_file_path = Path(temporary_directory.name) / f"exported_{sanitized_object_name}.fbx"
from .export_fbx import export_fbx

export_fbx(scene, view_layer, target_object, exported_file_path, add_on_preferences)
Expand Down

0 comments on commit b841565

Please sign in to comment.