-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfast_properties.py
1526 lines (1217 loc) · 65.7 KB
/
fast_properties.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import bpy
import os
import sys
from pathlib import Path
from .fast_global import *
from .fast_keymaps import *
from datetime import datetime, timedelta
from bpy.props import (
BoolProperty,
IntProperty,
FloatVectorProperty,
StringProperty,
FloatProperty,
EnumProperty,
CollectionProperty,
)
import requests
def update_gpt_node_image_path(self, context):
scn = bpy.context.scene
abs_path = bpy.path.abspath(self.gpt_node_image_path)
if self.gpt_node_image_path != abs_path:
self.gpt_node_image_path = abs_path
# If gpt_node_image_path is set, set gpt_node_screenshot_path to False (or None)
if self.gpt_node_image_path:
self.gpt_node_screenshot_path = ""
def update_gpt_file_permission_fixer_path(self, context):
scn = bpy.context.scene
# Define the hard-coded path
hard_coded_path = os.path.join(os.path.expanduser("~"), "Desktop", "AGPT-4")
# Check if the path has been changed
if self.gpt_file_permission_fixer_path != hard_coded_path:
# Reset the path to the hard-coded value
self.gpt_file_permission_fixer_path = hard_coded_path
def update_gpt_boost_user_command(self, context):
scn = bpy.context.scene
manager = bpy.context.preferences.addons[__name__].preferences.Prop
if not scn.gpt_boost_user_command:
# If boost is turned off, also turn off advanced boost
if scn.gpt_advanced_boost_user_command:
scn.gpt_advanced_boost_user_command = False
my_redraw()
def update_gpt_advanced_boost_user_command(self, context):
scn = bpy.context.scene
if scn.gpt_advanced_boost_user_command and not scn.gpt_boost_user_command:
# If advanced boost is turned on and boost is not on, turn on boost
scn.gpt_boost_user_command = True
my_redraw()
def update_bse_current_line(self, context):
log_file_path = os.path.join(bpy.utils.user_resource('SCRIPTS'), 'addons', __name__, 'data', 'autogpt', 'BSE', "BSE_current_line.txt")
with open(log_file_path, 'w', encoding='utf-8') as log_file:
log_file.write(str(self.bse_current_line))
def update_gpt_blender_stack_exchange_tag(self, context):
if self.gpt_blender_stack_exchange_tag != "#AutoGPT_Fix":
bpy.ops.fast.info('INVOKE_DEFAULT', message="The tag cannot be changed. It has been reset to the default value. Please read tool-tip.", duration=1)
self.gpt_blender_stack_exchange_tag = "#AutoGPT_Fix"
def update_gpt_max_iterations(self, context):
scn = bpy.context.scene
manager = bpy.context.preferences.addons[__name__].preferences.Prop
if manager.autogpt_processing == 'Initializing' or manager.autogpt_processing == 'Analyzing' or manager.autogpt_processing == 'Waiting for Input' or manager.monitor_daz_studio_save_directory:
return
try:
gpt_save_user_pref_block_info()
except:
pass
def update_api_key(self, context):
import csv
scn = bpy.context.scene
# Define the file path for the API key file
api_key_fp = os.path.join(os.path.expanduser('~'), 'Documents', 'FAST Settings', 'api_key.csv')
# Check if the API key is being set or cleared
if self.api_key:
# Create the FAST Settings directory if it doesn't exist
os.makedirs(os.path.dirname(api_key_fp), exist_ok=True)
# Write the new API key to the file
with open(api_key_fp, mode='w', newline='') as file:
if self.api_key is not None:
writer = csv.writer(file)
# CSV with header
writer.writerow(['API Key', self.api_key])
else:
pass
from . import __name__
class GPTScriptFileItem(bpy.types.PropertyGroup):
name: bpy.props.StringProperty(name="Script Name")
script_filepath: bpy.props.StringProperty(name="Script Filepath")
class FAST_Properties(bpy.types.PropertyGroup):
is_restarting: bpy.props.BoolProperty(name="Internal", default=False)
collect_error_message_only: bpy.props.BoolProperty(
name="Enable Anonymous Error Reporting",
description=(
"This property enables anonymous error data reporting.\n\n"
"If enabled, the system captures error messages using the 'traceback' library.\n\n"
"It sends only the full error message and line number to us, ensuring no sensitive data is included.\n\n"
"The function handling this is located at the top of the FAST Global file, it's named 'capture_and_copy_traceback'.\n\n"
"If an error occurs, the system will email the error details to us automatically,\n\n"
"allowing us to test, fix, and send updates quickly.\n\n"
"If this property is enabled, you do not need to manually report errors.\n\n"
"By default, this property is disabled (False).\n\n"
"If you enable it and see 'Error details sent successfully.' under an error message,\n\n"
"you can relax as we are already working on a fix.\n\n"
"If you do not see this message, click 'Report Issues' to notify us.\n\n"
"On the FAST Messages panel, this setting can be toggled on at any time.\n\n"
"This ensures you have control over whether error reporting is active.\n\n"
"Please note: If you enable this property, errors will be emailed to us anonymously."
),
default=False
)
run_it_first_2: bpy.props.BoolProperty(default=True)
gpt_re_add_able_error: bpy.props.StringProperty(name="Internal", default="")
gpt_q_run: bpy.props.BoolProperty(default=False)
new_addition: bpy.props.BoolProperty(default=False)
gpt_error_line: bpy.props.StringProperty(default="")
verbose_tooltips: bpy.props.BoolProperty(
name="Verbose Tooltip", description="Toggle tooltip verbosity for operator and property tool-tips.", default=False
)
sna_imprompt: bpy.props.StringProperty(
name="Image Prompt",
description="Enter the necessary prompt to create your image here",
default="",
)
sna_serpenspathimg: bpy.props.StringProperty(
name="Image Path",
description="receives the path where your image is saved",
default="",
)
sna_imprompt: bpy.props.StringProperty(
name="Prompt",
description="Image prompt for generation",
default=""
)
sna_currentstatus: bpy.props.StringProperty(
name="Current Status",
description="Current status of the operation",
default=""
)
sna_statusfloat: bpy.props.FloatProperty(
name="Status Progress",
description="Progress of the operation",
default=0.0,
min=0.0,
max=1.0
)
sna_serpenspathimg: bpy.props.StringProperty(
name="Generated Image Path",
description="Path to the generated image",
default=""
)
timeout_duration_prop: bpy.props.FloatProperty(
name="Timeout Duration",
default=5.0,
min=0.01,
max=5.0,
description="Duration (in seconds) to speak your search term",
)
verbose_logging: bpy.props.BoolProperty(
default=False,
description="Enables verbose logging. When off, won't see API/manual lookups, code, and others. Developers turn this on."
)
new_section: bpy.props.BoolProperty(default=False)
restarting_blender: bpy.props.BoolProperty(default=False)
draw_open: bpy.props.BoolProperty(default=False)
gpt_do_not_save_userpref_while_running: bpy.props.BoolProperty(
default=False,
description=(
"Disable saving prefs while running AGPT-4. Not recommended under normal circumstances, "
"as saving preferences ensures consistent behavior. However, this can be useful for creating,"
"clean console outputs or demonstration videos."
)
)
gpt_img_run: bpy.props.BoolProperty(
default=False,
description=(
"Generates an image you describe in your user command and applies it to an image plane."
)
)
semitones: bpy.props.IntProperty(
name="Semitones",
description="Pitch shift in semitones",
default=0,
min=-12,
max=12,
step=1,
)
gpt_random_user_command_line_count: bpy.props.IntProperty(
name="Random Command Line Count",
description="The max number of commands the random user command can have (influences script length.)",
default=10,
min=1,
max=100
)
gpt_test_mode: bpy.props.BoolProperty(default=False)
te_script_not_tested: bpy.props.BoolProperty(default=False)
gpt_show_code_to_be_fixed: bpy.props.BoolProperty(default=False)
new_addition: bpy.props.BoolProperty(default=False)
gpt_do_not_save_userpref_while_running: bpy.props.BoolProperty(
default=False,
description=(
"Disable saving prefs while running AGPT-4. Not recommended under normal circumstances, "
"as saving preferences ensures consistent behavior. However, this can be useful for creating,"
"clean console outputs or demonstration videos."
)
)
gpt_img_run: bpy.props.BoolProperty(
default=False,
description=(
"Generates an image you describe in your user command and applies it to an image plane."
)
)
gpt_error_mssg_list: bpy.props.StringProperty(name="Temp User Command", description="Internal", default="")
se_boosted_user_command: bpy.props.StringProperty(name="Internal", default="")
print_example_message: bpy.props.BoolProperty(name="Internal", default=False)
last_clip_name: bpy.props.StringProperty(name="Internal", default="")
previous_file_id: bpy.props.StringProperty(name="Internal", default="")
gpt_error_mssg_list: bpy.props.StringProperty(name="Temp User Command", description="Internal", default="")
gpt_temp_edit_user_command_prompt: bpy.props.BoolProperty(name="Temp Edit User Command Prompt", description="Internal", default=False)
gpt_temp_user_command: bpy.props.StringProperty(name="Temp User Command", description="Internal", default="")
gpt_temp_confirm_object_is_selected: bpy.props.BoolProperty(name="Temp Confirm Object Is Selected", description="Internal", default=False)
gpt_temp_boost_user_command: bpy.props.BoolProperty(name="Temp Boost User Command", description="Internal", default=False)
gpt_temp_find_code_examples: bpy.props.BoolProperty(name="Temp Find Code Examples", description="Internal", default=False)
gpt_temp_run_final_script: bpy.props.BoolProperty(name="Temp Run Final Script", description="Internal", default=False)
gpt_temp_random_user_command: bpy.props.BoolProperty(name="Temp Random User Command", description="Internal", default=False)
gpt_temp_run_lookups: bpy.props.BoolProperty(name="Temp Run Lookups", description="Internal", default=False)
se_changed_values: bpy.props.BoolProperty(name="Internal", default=False)
gpt_show_console_on_run: bpy.props.BoolProperty(name="Show Console on Run", default=True)
full_error_message: bpy.props.StringProperty(name="Internal", default="")
use_o1_mini_model: bpy.props.BoolProperty(
name="Use O1 Mini Model",
description="Enable/Disable usage of the latest O1 model for script generation only.\n\n"
"Requests to fixed code will automatically use the GPT 4o model.\n\n"
"The O1 model is highly adept at reasoning and provides an improved,\n\n"
"script output compared to previous models",
default=True,
)
use_o1_model: bpy.props.BoolProperty(
name="Use O1 Mini Model",
description="Enable/Disable usage of the latest O1 model for script generation.\n\n"
"The O1 model is highly adept at reasoning and provides an improved "
"script output compared to previous models.",
default=True,
)
gpt_beep_volume: bpy.props.FloatProperty(
name="GPT Beep Volume",
description="The volume of the beep sound",
default=0.1,
min=0.0,
max=1.0,
)
gpt_show_cost: bpy.props.BoolProperty(
name="Show Tokens",
description=("Shows the token printouts in the console so you could see token usage per function. \n\nYou can turn this on at anytime while your code is processing"),
default=False
)
beep_frequency: bpy.props.IntProperty(
name="Fast Frequency",
description="The frequency of the beep sound",
default=963,
min=1,
max=2500,
)
beep_duration: bpy.props.IntProperty(
name="Fast Duration",
description="The duration of the beep sound in milliseconds",
default=635,
min=1,
max=2500,
)
beep_volume: bpy.props.FloatProperty(
name="Fast Volume",
description="The volume of the beep sound (0.0 to 1.0)",
default=0.1,
min=0.0,
max=1.0,
)
use_beep: bpy.props.BoolProperty(
name="Use Beep",
description="Enable/Disable BEEP for all operators that use.\n\nSome operators do use beep functionality to alert you,\n\nbut do so as a secondary measure only.\n\nBeep settings are on the FAST AUDIO panel\n\nDon't hear beep?? Turn up System Sounds in your OS",
default=True,
)
restart_after_addons: bpy.props.BoolProperty(
name="Restart Blender After Add-Ons",
description="Setting a property to True to restart Blender after installing add-ons to improve window handling",
default=False
)
restart_after_addon_enabled: bpy.props.BoolProperty(
name="Restart Blender After Addon Enabled",
description="Setting a property to True to restart Blender after you enable addon to improve window handling",
default=False
)
restart_after_dependencies: bpy.props.BoolProperty(
name="Restart Blender After Dependencies",
description="Setting a property to True to restart Blender after installing dependencies to improve window handling",
default=False
)
restart_after_update: bpy.props.BoolProperty(
name="Restart Blender After Update",
description="Setting a property to True to restart Blender after installing update to improve window handling",
default=False
)
restart_after_key: bpy.props.BoolProperty(
name="Restart Blender After Key",
description="Setting a property to True to restart Blender after keying to improve window handling",
default=False
)
restart_after_verify: bpy.props.BoolProperty(
name="Restart Blender After Verify",
description="Setting a property to True to restart Blender after verifying to improve window handling",
default=False
)
gpt_visual_verification: bpy.props.BoolProperty(
name="GPT Visual Verification",
description="Enables GPT to take screenshots during the error checking process to verify operations visually.",
default=True
)
test_tensorflow: bpy.props.BoolProperty(
name="Import TensorFlow Library at Startup",
description=(
"With this selected, Tensorflow will be imported during Blender's startup.\n\n"
"This ensures the Tensorflow library included with the add-on is ready for scripts.\n\n"
"As TensorFlow can take 3-5 seconds to import, Leaving unchecked default allows for fast startups"
),
default=False
)
def draw(self, context):
layout = self.layout
layout.prop(self, "test_tensorflow")
toggle_pip_print_statements: bpy.props.BoolProperty(
name="Toggle Pip Print Statements",
description=("Turns off the print statements that shows which PIP libraries we import at startup"),
default=False
)
handler_processing: bpy.props.BoolProperty(name="Internal", default=False)
startup_done_1: bpy.props.BoolProperty(name="Internal", default=False)
startup_done_2: bpy.props.BoolProperty(name="Internal", default=False)
run_once_prop: bpy.props.BoolProperty(name="Internal", default=False)
ran_checker_from_outside_main_code: bpy.props.BoolProperty(name="Internal", default=False)
gpt_using_data: bpy.props.BoolProperty(name="Internal", default=False)
gpt_choose_to_take_snapshot: bpy.props.BoolProperty(
name="GPT Choose to Take Snapshot",
description=(
"Check this property to take a screenshot of your entire screen instead of,\n\n"
"using an image that you supplied in the 'Node Image Path' box"
),
default=True
)
gpt_data_limit: bpy.props.IntProperty(
name="GPT Data Limit",
description=
"Default value is 5000 characters. Increase it if you need to, but realize,\n\n"
"that this could increase token usage quite a bit. So if you do increase it past,\n\n"
"5000, which is already pretty high, then keep looking at your credit usage on the website,\n\n"
"and see how much it costs you every time you run it with that amount of data",
default=5000,
min=1,
max=20000,
)
se_show_content: bpy.props.BoolProperty(
name="Show Body Content",
description=("Shows the body content of the Stack Exchange questions we're scanning.\n\nYou can turn this on at anytime while your code is processing"),
default=True
)
gpt_show_tokens: bpy.props.BoolProperty(
name="Show Tokens",
description=("Shows the token printouts in the console so you could see token usage per function. \n\nYou can turn this on at anytime while your code is processing"),
default=False
)
gpt_show_keyword_on_printout: bpy.props.BoolProperty(
name="Show Keyword on User Command",
description=("We remove it from user command console printout for decorative purposes, this will reverse that"),
default=False
)
set_output_sound_file_level: bpy.props.FloatProperty(
name="Set Output File Sound Level",
description=
"Automatically sets the volume of the clip after you get done recording",
default=1.0,
min=1.0,
max=100.0,
)
force_solid_mode: bpy.props.BoolProperty(
name="Force Solid Mode",
description="If checked, forces solid mode whenever a scene is opened or restart feature is used",
default=False # You can change this to True if you want it enabled by default
)
disable_restart_blender: BoolProperty(
name="Disable Restart Blender",
description="Disable the Restart Blender option in the right-click context menu",
default=True,
)
disable_save_startup: BoolProperty(
name="Disable Save Startup File",
description="Disable the Save Startup File option in the right-click context menu",
default=True,
)
disable_delete_startup: BoolProperty(
name="Disable Delete Startup File",
description="Disable the Delete Startup File option in the right-click context menu",
default=True,
)
# New Properties for Vernors Ginger Ale Section
disable_show_console: BoolProperty(
name="Disable Show Console",
description="Disable the Show Console option in the right-click context menu",
default=True,
)
disable_n_panel: BoolProperty(
name="Disable N-Panel",
description="Disable the N-Panel option in the right-click context menu",
default=True,
)
disable_verbose_tool_tips: BoolProperty(
name="Disable Verbose Tooltips",
description="Disable the Verbose Tooltips option in the right-click context menu",
default=True,
)
gpt_last_examples_vector_store_id: bpy.props.StringProperty(name="Internal", default="")
gpt_first_code: bpy.props.StringProperty(name="Internal", default="")
gpt_file_path_notification: bpy.props.BoolProperty(name="Internal", default=False)
gpt_final_print_string: bpy.props.StringProperty(name="Internal", default="{}")
fast_lines_of_code: bpy.props.StringProperty(name="Internal", default="7,197,771")
alm_processing: bpy.props.BoolProperty(name="Internal", default=False)
# alm_ready_for_undo: bpy.props.BoolProperty(name="Internal", default=False)
inst_dependencies: bpy.props.BoolProperty(name="Internal", default=False)
gpt_re_run_script_checker: bpy.props.BoolProperty(name="Internal", default=False)
gpt_last_added_code_base_name: bpy.props.StringProperty(name="Internal", default="")
gpt_choose_random_command_type: bpy.props.BoolProperty(
name="GPT Random Command Type",
description=(
"Choose type, Blender or standard Python, of random user command."
),
default=True
)
gpt_re_add_able_blender_output: bpy.props.StringProperty(name="Internal", default="")
gpt_re_add_able_code: bpy.props.StringProperty(name="Internal", default="")
gpt_set_panel_enable: bpy.props.BoolProperty(name="Internal", default=False)
bmesh_register: bpy.props.BoolProperty(name="Internal", default=False)
se_fix_code: bpy.props.BoolProperty(name="Internal", default=False)
se_user_command_pass: bpy.props.StringProperty(name="Internal", default="")
se_error_message_pass: bpy.props.StringProperty(name="Internal", default="")
se_user_command: bpy.props.StringProperty(name="Internal", default="")
allow_auto_gpt_assistant: bpy.props.BoolProperty(name="Internal", default=False)
se_pull_cancel_op: bpy.props.BoolProperty(name="Cancel Pull Operation", default=False)
updating_from_panel: bpy.props.BoolProperty(name="Cancel Pull Operation", default=False)
gpt_edit_user_command_prompt: bpy.props.BoolProperty(
name="Show Edit User Command Prompt",
description=(
"Check this to regain the prompt to edit your user command in the console.\n\n"
"The prompt was added to the console in the 1st Place because the user command is so important.\n\n"
"If you toggle this off please make sure to keep that in mind and check it before you run AGPT-4.\n\n"
"It's in the checklist to serve as a visual reminder to check user command"
),
default=False
)
gpt_send_anonymous_data: bpy.props.BoolProperty(
name="Send Anonymous Error Data",
description=(
"Enable this option to send the red error section (only) to our public GitHub repository if the\n\n"
"Autonomous GPT-4 functionality encounters the same error for every iteration.\n\n"
"This helps us identify and address issues, such as missing login credentials for the SMTPLIB library,\n\n"
"incorrect file paths being added, or access denied errors or other unforeseen errors.\n\n"
"When enabled, this feature will automatically send the error message to a publicly accessible\n\n"
"file on GitHub. No personal information, such as email addresses, is collected or transmitted.\n\n"
"The data is used solely for improving the add-on's functionality and ensuring it performs\n\n"
"smoothly for all users.\n\n"
"We appreciate your help in making the Autonomous GPT-4 functionality more robust. You can view\n\n"
"the collected error messages on our public GitHub repository to stay informed about the issues\n\n"
"we are addressing.\n\n"
"The function we use to collect data is at the top of the fast_global.py file in scripts/addons/FAST.\n\n"
"You can inspect the function we use and search for the function name, which is 'append_error_to_github',\n\n"
"in all the files in the add-on to inspect where it's used.\n\n"
"Just so you know, we're being completely transparent in what we collect"
),
default=False
)
image_save_index: bpy.props.IntProperty(
name="Image Save Index",
description="Tracks the index for saved images",
default=1
)
register_done_bse: bpy.props.BoolProperty(name="Register Done N Panel", default=False)
register_done_gpt: bpy.props.BoolProperty(name="Register Done GPT", default=False)
copy_traceback: bpy.props.BoolProperty(
name="Copy Traceback",
description="Enable/Disable copying of traceback information to the clipboard on error",
default=True,
)
collect_error_message_only: bpy.props.BoolProperty(name="Register Done N Panel", default=False)
play_error_sound: bpy.props.BoolProperty(
name="Enable Error Sound",
description="Enable this checkbox to get an audible warning when you encounter an error in the add-on.",
default=False
)
restart_after_addon_enabled: bpy.props.BoolProperty(
name="Restart Blender After Addon Enabled",
description="Setting a property to True to restart Blender after you enable addon to improve window handling",
default=False
)
gpt_file_permission_fixer_path: bpy.props.StringProperty(
name="File Permission Fixer Path",
description=(
"This path is used when fixing FILE PERMISSION errors in file paths within your generated scripts.\n\n"
"If the path causing the error is for non-critical data like saving renders or writing log files,\n\n"
"it will be replaced with this path. The default path is set to a folder on your desktop named 'AGPT-4'.\n\n"
"This prop is shown for reference only, so you know what the code is doing, this path cannot be changed"
),
default="os.path.join(os.path.expanduser('~'), 'Desktop', 'AGPT-4')",
maxlen=1024,
subtype='FILE_PATH',
update=update_gpt_file_permission_fixer_path
)
gpt_smtp_lib_username: StringProperty(
name="SMTP Username",
description="This is your email address (e.g., [email protected]) that will be used for SMTP authentication.\n\n"
"Refer to the 'App Password' tooltip for more information on what these properties are for",
default="",
)
gpt_smtp_lib_app_password: StringProperty(
name="SMTP App Password",
description="This is your SMTP app password. You only need to provide this if you are intending to ask,\n\n"
"AGPT-4 to generate code that uses the SMTPLIB library to send emails (e.g., through Gmail).\n\n"
"The username will be your email address (e.g., [email protected]).\n\n"
"To generate an app password for Gmail, follow these steps:\n\n"
"1. Go to your Google Account.\n"
"2. Select 'Security'.\n"
"3. Under 'Signing in to Google', select 'App Passwords'.\n"
"4. Sign in...At the bottom, choose 'Select app' and 'Select device' and choose the appropriate options.\n"
"5. Follow the instructions to generate the app password.\n\n"
"If you don't know what the SMTPLIB library is, you don't need to worry about this setting.\n\n"
"If these credentials are provided, you can request the Autonomous GPT-4 operator to generate scripts,\n\n"
"for you that will send emails. For example, you could request a script to automatically send an email,\n\n"
"when a process is completed in Blender. Ensure your user command includes something like,\n\n"
"'write a script that will use the SMTPLIB library to send an email' so the assistant understands your request",
default="",
subtype='PASSWORD'
)
gpt_smtp_lib_server: StringProperty(
name="SMTP Server",
description="This is the SMTP server for your email provider. For Gmail, this should be 'smtp.gmail.com'.\n\nEnsure the SMTP server matches your email provider's settings.",
default="smtp.gmail.com",
)
gpt_node_image_path: StringProperty(
name="Node Image Path",
description="\nPath to the screenshot image or add your own image here.\n\n"
"Make sure the path is correctly specified to avoid errors during script execution.\n\n"
"The path to the screenshot is auto added here so can be opened with 'Open Image'",
default="",
maxlen=1024,
subtype='FILE_PATH',
update=update_gpt_node_image_path,
)
gpt_confirm_object_is_selected: bpy.props.BoolProperty(
name="Confirm Object Is Selected",
description="This replaces the object reference section that showed up in the console.\n\n"
"This property is toggled off when operator finishes or restart Blender so important to check each time.\n\n"
"Checklist:\n"
"1. Are objects needed by the script?\n"
"2. Are the objects selected?\n"
"3. If no, select the objects, then check this property.\n\n"
"Confirmation Information:\n"
"1. If you check this, a reference will be added and the current file will be used.\n"
"2. If you check this, the objects will be referenced for you in the user command (internally) without changing the file.\n"
"3. If you check this, your Blender file containing the objects will be used for error tests.\n\n"
"Note: If providing bone data, the rig must be selected",
default=False
)
gpt_confirm_data: bpy.props.BoolProperty(
name="Confirm Object Is Selected",
description=("This replaces the data confirmation section that showed up in the console.\n\nIf checked it will automatically confirm yes for you,\n\nif unchecked the confirmation dialog will show up as normal.\n\nIf using 'Pull SE & BSE Examples' button to generate an example,\n\nthis is toggled off just so we could be sure that you meant to send bone or node data"
),
default=False
)
gpt_boost_user_command: BoolProperty(
name="Boost User Command",
description="Checked: Autonomous GPT-4 analyzes request, added user instruction sets + Blender 4.3 manual to, \n\n"
"refine your request. Doesn't alter your initial goal but provides a detailed command that, \n\n"
"matches your intended purpose. Ideal for solving complex issues with greater precision. \n\n"
"You don't have to look up the manual to accomplish tasks in Blender! \n\n"
"Hint: Boosted command is auto-added to user command file. \n\n"
"Hint: 'user-command-backup.txt' is created before boost, next to 'user-command.txt'.",
default=True,
update=update_gpt_boost_user_command)
# Save as reminder to get this added
# "Note: If adding code in example file you got off Blender Stack Exchange for example,\n"
# " when this is checked, it will pick that up and verify it for you against the Blender manual,\n"
# " and output the new user command as a nicely verified set of instructions.\n"
# " You can rerun Autonomous GPT-4 with those inst. & remove the code if script generation fails,\n"
# " retrying that way may help as maybe manual verified inst. are better than poss. outdated code.\n\n"
gpt_advanced_boost_user_command: bpy.props.BoolProperty(
name="Use Advanced Model for Boost User Command",
description="Check to use the advanced GPT-4o model for boosting user command.\n\n"
"When checked it also looks up the API which will improve your script.\n\n"
"Standard boost uses the GPT-4o mini model, this uses the GPT-4o model.\n\n"
"Costs more but some e.g. scripts for modeling, may require it to be successful",
default=False,
update=update_gpt_advanced_boost_user_command
)
pull_se_examples_iterations: bpy.props.IntProperty(
name="SE Search Iterations",
description="Number of iterations for searching Stack Exchange.\n\n"
"Make sure to set this to a reasonable amount, or you risk not getting good example.\n\n"
"For example, setting it to 10 may not find any good matches, whereas 100 ensures better results.\n\n"
"The A.I. deciding if example pertains to user command needs enough iterations to find good examples.\n\n"
"If unsure just leave at 50, better to spend 5 minutes here and have a better chance at a good script.\n\n"
"I've got good standard Python examples set to 10...for Blender Python I set to 50 as BSE has less examples\n\n"
"If you change your mind while the scanner is running you can change iterations and it'll recognize it in real time\n\n"
"Note: We allow the slider to go down to one for tests but ten is the minimum recommended.",
default=25,
min=1,
max=200,
)
bse_search_term: bpy.props.StringProperty(
name="BSE Search Term",
description="Enter a search term to look up on Blender Stack Exchange.\n\nA precursor to AGPT-4 Auto-BSE lookup (providing here until I get it implemented)",
default=""
)
bse_search_result: bpy.props.StringProperty(
name="BSE Search Result",
description="Internal",
default="",
options={'HIDDEN', 'SKIP_SAVE'}
)
bse_search_light_button: bpy.props.BoolProperty(
name="Internal",
description="Internal",
default=False
)
bse_accepted_answer_id: bpy.props.IntProperty(
name="Accepted Answer ID",
description="Internal",
default=False
)
bse_current_line: IntProperty(
name="BSE Current Line",
description="Current line being processed in the BSE scan",
default=0,
min=0,
max=300000,
update=update_bse_current_line
)
bse_fix_code: bpy.props.BoolProperty(
name="BSE Fix Code",
description="Internal",
default=False
)
bse_scan_cancel_op: bpy.props.BoolProperty(
name="Cancel Scan Operation",
description="Internal",
default=False
)
gpt_allow_change_instruction_sets: bpy.props.BoolProperty(
name="Allow Change Instruction Sets",
description=(
"\nPlease read all 'AGPT-4' documentation before you attempt the following...this includes reminder of key points\n\n"
"When this feature is on, all inst set files in the 'AGPT-4 Instructions' directory, that are shipped with the add-on,\n\n"
"can be edited. Normally they cannot because they're set to be auto created/verified at Blender startup.\n\n"
"E.G. If you make a mistake, turn this property off + restart Blender, and they'll all be regenerated.\n\n"
"If the files get deleted, turning this property off/restarting Blender will regenerate them.\n\n"
"It's recommended to be very careful because the inst sets are a culmination of 4 months of design.\n\n"
"Pls read the 'Edit User Instruction Set' info + all other documentation before attempting edits.\n\n"
"Even though you could edit the base instructions...for WRITE-CODE in 'AGPT-4 Instructions/script_generation',\n\n"
"it's recommended to duplicate it per the instructions in 'Edit User Instruction Set' info button, which say, partly,\n\n"
"....it's recommended to not change WRITE-CODE keyword...but make a derivative inst. set containing its contents ++\n\n"
"other concise instructions you would like to add to it, as those inst are well made/will ensure new inst. set works.\n\n"
"You can't create a derivative for ('fix-code, fix-py, standard-q, blender-q, fast-4-mini, fast-4),\n\n"
"like you can with the WRITE-CODE keyword, the system will not recognize it, as it looks for those names directly.\n\n"
"PROC-MAT, ANIM-INST, THEME-INST are already derivatives of WRITE-CODE(contain its instructions) edit them how you choose.\n\n"
"If you remove any instruction from them they will not work as well, you can try to make them better but please be careful,\n\n"
"e.g. change 1 inst of a set at a time, in response to an issue you're having, if change doesn't help, revert/try again.\n\n"
"Note: Please do not change these file names: (write-code, write-py, fix-code, fix-py, standard-q, blender-q, fast-4-mini, fast-4).\n\n"
"They are looked for by name by AGPT-4 so please only edit the contents of those files"
),
default=False
)
gpt_blender_stack_exchange_title: StringProperty(
name="Blender Stack Exchange Title",
description="Title for Blender Stack Exchange 'Accepted Answer' code you retrieved from 'Scan BSE For Errors'.",
default="",
)
gpt_blender_stack_exchange_tag: StringProperty(
name="Blender Stack Exchange Tag",
description="Tag to append to fixed scripts when added to local Blender Stack Exchange 'Posts.xml' file.\n\nThis tag cannot be changed, it's here so you know what to search for in the,\n\nfile to locate sections that have been changed.\n\n'Posts.xml' File Path: '\FAST\data\autogpt\BSE\Posts.xml'",
default="#AutoGPT_Fix",
update=update_gpt_blender_stack_exchange_tag
)
gpt_find_code_examples: bpy.props.BoolProperty(
name="Find Examples",
description="Find code examples from FAST Add-on by analyzing your user command.\n\nWhen requesting code on ChatGPT we always give it examples from our add-on,\n\nand as that works EXTREMELY WELL, we incorporated it into AGPT-4.\n\nThis costs $0.10 and it needs to boost your user command to work and that adds $0.10.\n\nThis works irrespective of the boost feature being on.\n\nWhy analyze boosted user command and not original user command??\n\nBecause when user command is boosted it's verified against the Blender 4.3 manual,\n\nand it's important when searching for examples to verify user command gives proper instr.\n\nif your user command is a request to fix code, you're provided code to fix is used,\n\nto create a boosted command for this feature",
default=True,
)
gpt_optimize: bpy.props.BoolProperty(
name="Optimize",
description="Internal",
default=False,
)
gpt_run_lookups: bpy.props.BoolProperty(
name="Run Lookups",
description="Internal.",
default=True
)
gpt_show_lookups: bpy.props.BoolProperty(
name="Show Lookups",
description="Turn this property on to show API, Manual, & Code lookup printed output.\n\nOtherwise they aren't printed though still generated and given to 'Autonomous GPT-4'.\n\nYou can turn this on at anytime while your code is processing",
default=True
)
gpt_optimize_set_internally: bpy.props.BoolProperty(
name="Optimize Set Internally",
description="Indicates that GPT Optimize was set to true internally.",
default=False
)
gpt_o3_mini_total_cost: bpy.props.FloatProperty(
name="GPT o3 Mini Total Cost",
description="Calculated cost of GPT o3 Mini usage in dollars and cents.\n\nUpdated automatically.",
default=0.0,
precision=2,
)
gpt_4o_mini_total_cost: bpy.props.FloatProperty(
name="GPT 4o Mini Total Cost",
description="Calculated cost of GPT 4o Mini usage in dollars and cents.\n\nUpdated automatically.",
default=0.0,
precision=2,
)
gpt_4o_total_cost: bpy.props.FloatProperty(
name="GPT 4o Total Cost",
description="Calculated cost of GPT 4o usage in dollars and cents.\n\nUpdated automatically.",
default=0.0,
precision=2,
)
gpt_o3_mini_total_cost: bpy.props.FloatProperty(
name="GPT o3 Mini Total Cost",
description="Calculated cost of GPT o3 Mini usage in dollars and cents.\n\nUpdated automatically.",
default=0.0,
precision=2,
)
gpt_o1_mini_total_cost: bpy.props.FloatProperty(
name="GPT o1 Mini Total Cost",
description="Displays the total cost of GPT o1 Mini usage in dollars and cents, (auto updated based on usage)",
default=0.0,
)
gpt_verify_code_instructions: bpy.props.BoolProperty(
name="Pause Before Fixing Errors",
description="This pauses so you could verify fixes as far as not adhering to instructions.",
default=True
)
gpt_pause_before_fixing_errors: bpy.props.BoolProperty(
name="Pause Before Fixing Errors",
description="This pauses after the error is generated before we try to fix the code each iteration,\n\nallowing you to make a quick edit to the code to help it get past an error.\n\nIf you edit code only replace items do not add, otherwise it will not work.\n\nAutonomous GPT-4 will not be able to hold the intended change in memory,\n\nif it doesn't have an item to recognize and replace each iteration.\n\nThis functionality is new and it will improve.\n\nYou can untick this property at any time, and it'll be recognized by Autonomous GPT-4.\n\nFilepath to add edits = 'FAST Settings\AGPT-4 Script Testing\modified_user_script.py'.\n\nThis file is updated each iteration with your, generated code plus extra code added for testing",
default=False
)
gpt_use_current_file_for_error_check: bpy.props.BoolProperty(
name="Save User File for Error Checking",
description="Checked it saves the current Blender file to a temporary directory for error checking,\n\nUnchecked it uses the Blender default file for error checking.\n\nFile is saved to = '\AppData\Local\Temp\temp_blender_file.blend' (if you need to inspect it)\n\nAs this uses your current file for error checking, selecting any objects,\n\nthat you're asking the script to be written to interact with, will help in error checking process.\n\nThis is connected to a console message that will prompt you to select those object/s.\n\nDisable if using current file it's causing issues in error checking",
default=False
)
gpt_relevant_bones: bpy.props.StringProperty(
name="GPT Relevant Bones",
description="Comma-separated list of relevant bone names",
default="",
)
gpt_relevant_bone_frames: bpy.props.StringProperty(
name="Relevant Bone Frames",
description="\nComma-separated list of timeline frame numbers",
default="",
)
GPTScriptFileItems: bpy.props.CollectionProperty(
name="GPT Script Files",
type=GPTScriptFileItem, # Specify the correct type for the items in this collection
)
gpt_list_display_rows: bpy.props.IntProperty(
name="Display Rows",
description="Number of items to display in the list at once",
default=5,
min=1,
)
gpt_run_final_script: BoolProperty(
name="GPT Run Final Script",
description="Controls whether to run the final script at the end of processing.\n\nWhen enabled, the script that was generated and refined through the iterations,\n\nwill be executed, resulting in visible changes in the viewport,\n\nsuch as creating objects or applying transformations based on the script's commands.\n\nDisable this if you plan to work on your scene while the script is being created,\n\nor, if you're unsure if the results of script might cause unintended effects in your scene",
default=True)
tfe_pass_dependency_message: bpy.props.IntProperty(
name="Pass dependency message",
description="Passes the dependency message boolean to the threaded call for the check dependencies operator",
default=0
)
tfe_pass_dependency_string: bpy.props.StringProperty(
name="Pass dependency message",
description="Passes the dependency message to the threaded call for the check dependencies operator",
default=''
)
gpt_check_errors_using_default_addons: bpy.props.BoolProperty(
name="Test Errors Using Default Add-ons",
description="Disable this to test GPT-generated scripts with default Blender add-ons disabled.\n\n"
"To test scripts, Blender starts in Factory Startup Mode, ensuring clean settings.\n\n"
"If enabled, default add-ons that you had previously enabled will be re-enabled in this mode,\n\n"
"allowing the use of any operators or properties from them to be in your scripts without issue.\n\n"