File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,6 @@ def MakeInputsJS(node_tree):
8383def SaveBlenderInputs (be_base_stuff : BEUtils .BaseStuff , node_tree ):
8484 js_output_data = MakeInputsJS (node_tree )
8585
86- # If No JSON File
8786 gn_js_path = be_base_stuff .blendfolder + be_base_stuff .blendfile_name + '_' + be_base_stuff .node_sys_name + '.json'
8887
8988 print ("JSON Path to Save: " + gn_js_path )
Original file line number Diff line number Diff line change 1+ import os
2+ import stat
13import bpy
24
35import json
@@ -27,8 +29,14 @@ def LoadJSON(bengineInputs_path: str):
2729
2830
2931def SaveJSON (gn_js_path , js_data ):
30- with open (gn_js_path , 'w' ) as json_file :
3132
33+ # Set Writable
34+ if os .path .exists (gn_js_path ) and not os .access (gn_js_path , os .W_OK ):
35+ os .chmod (gn_js_path , stat .S_IWRITE )
36+ print ("File Was Read-Only and Has Been Changed: " + gn_js_path )
37+
38+ # Save JSON
39+ with open (gn_js_path , 'w' ) as json_file :
3240 json .dump (js_data , json_file )
3341
3442
You can’t perform that action at this time.
0 commit comments