-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,266 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
* [email protected] | ||
* [email protected] | ||
* [email protected] | ||
* youngjaekim | ||
|
||
* Nattapong Khwanpray | ||
* Florian Schreiber | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
############################################################################ | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
############################################################################ | ||
# 2024/12/27 | ||
|
||
import bpy | ||
import os | ||
import subprocess | ||
import platform | ||
import json | ||
|
||
|
||
def get_datafiles_path(): | ||
""" return datafile path and create if not exist """ | ||
datafiles_path = bpy.utils.user_resource("SCRIPTS", path="addons") | ||
|
||
datafiles_path += os.sep + 'BsMax-datafiles' | ||
|
||
if not os.path.isdir(datafiles_path): | ||
os.mkdir(datafiles_path) | ||
|
||
return datafiles_path | ||
|
||
|
||
def open_folder_in_explorer(path): | ||
if not os.path.isdir(path): | ||
return | ||
|
||
if platform.system() == "Windows": | ||
os.startfile(path) | ||
|
||
elif platform.system() == "Darwin": | ||
subprocess.call(["open", path]) | ||
|
||
elif platform.system() == "Linux": | ||
subprocess.call(["xdg-open", path]) | ||
|
||
|
||
def write_dictionary_to_json_file(data, file_path): | ||
try: | ||
with open(file_path, 'w', encoding='utf-8') as json_file: | ||
json.dump(data, json_file, ensure_ascii=False, indent=4) | ||
return True | ||
except: | ||
return False | ||
|
||
|
||
def read_json_file_to_dictionary(file_path): | ||
try: | ||
with open(file_path, 'r', encoding='utf-8') as json_file: | ||
data = json.load(json_file) | ||
return data | ||
except: | ||
return {} |
Oops, something went wrong.