-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaae-export.py
5271 lines (3944 loc) · 287 KB
/
aae-export.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
# aae-export.py
# Copyright (c) Akatsumekusa, arch1t3cht, bucket3432, Martin Herkt and
# contributors
#
# ::: ::: ::::::::::
# :+: :+: :+: :+: :+:
# +:+ +:+ +:+ +:+ +:+
# +#++:++#++: +#++:++#++: +#++:++#
# +#+ +#+ +#+ +#+ +#+
# #+# #+# #+# #+# #+#
# ### ### ### ### ##########
# :::::::::: ::: ::: ::::::::: :::::::: ::::::::: :::::::::::
# :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
# +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
# +#++:++# +#++:+ +#++:++#+ +#+ +:+ +#++:++#: +#+
# +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
# #+# #+# #+# #+# #+# #+# #+# #+# #+#
# ########## ### ### ### ######## ### ### ###
#
# ---------------------------------------------------------------------
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# ---------------------------------------------------------------------
# Title font: Alligator by Simon Bradley
# ---------------------------------------------------------------------
bl_info = {
"name": "AAE Export",
"description": "Export tracks and plane tracks to Aegisub-Motion and Aegisub-Perspective-Motion compatible AAE data",
"author": "Akatsumekusa, arch1t3cht, bucket3432, Martin Herkt and contributors",
"version": (1, 2, 4),
"support": "COMMUNITY",
"category": "Video Tools",
"blender": (3, 1, 0),
"location": "Clip Editor > Tools > Solve > AAE Export",
"warning": "",
"doc_url": "https://github.com/Akatmks/Akatsumekusa-Aegisub-Scripts",
"tracker_url": "https://github.com/Akatmks/Akatsumekusa-Aegisub-Scripts/issues"
}
import bpy
import bpy_extras.io_utils
# -------------------------------------
# Top-level functions and classes layout
# -------------------------------------
# First, a small section for smoothing modules:
# smoothing_modules.
# is_smoothing_modules_available.
# get_smoothing_modules_install_description().
# -------------------------------------
# There are three bpy.types.PropertyGroup for settings:
# AAEExportSettings, registered to bpy.types.Screen for general
# settings like whether save a copy of AAE data to file.
# AAEExportSettingsClip, registered to bpy.types.MovieClip for clip-
# wise settings, such as Power Pin remap and section blending.
# It also contains a fake set of AAEExportSettingsSectionL for
# placeholding before section settings are initialised in
# AAEExportSettingsClip._do_smoothing_update().
# AAEExportSettingsSectionL, registered as
# bpy.props.CollectionProperty to bpy.types.MovieClip. Contains
# section-wise smoothing settings.
# -------------------------------------
# After the settings are three bpy.types.Operator for export:
# AAEExportExportAll for the All tracks > Export button. This class
# also contains all the actual export functions, the entrance
# point of which is AAEExportExportAll._generate(),
# AAEExportExportAll._plot_result(),
# AAEExportExportAll._plot_section(), and also
# AAEExportExportAll._copy_to_clipboard() and
# AAEExportExportAll._export_to_file()
# AAEExportCopySingleTrack for
# Selected track > Selected track > Copy.
# AAEExportCopyPlaneTrack for
# Selected track > Selected plane track > Copy.
# AAEExportPlotResult for Export Options > Smoothing > Plot Result
# when AAEExportSettings.do_advanced_smoothing.
# AAEExportPlotSection for Export Options > Smoothing > Plot Section
# when AAEExportSettings.do_advanced_smoothing.
# AAEExportPlot for Export Options > Smoothing > Plot when
# not AAEExportSettings.do_advanced_smoothing.
# -------------------------------------
# After the operators are the bpy.types.Panel classes for UI:
# AAEExport.
# AAEExportSelectedTrack.
# AAEExportAllTracks.
# AAEExportOptions.
# A bpy.types.UIList and two operators for sections:
# AAEExportSectionL.
# AAEExportSectionAddS.
# AAEExportSectionRemoveS.
# -------------------------------------
# At last the legacy File > Export bpy.types.Operator:
# AAEExportLegacy.
# -------------------------------------
# This is all the main classes and it is collected in a tuple:
# classes.
# -------------------------------------
# After the main classes are the preference classes related to
# installing dependencies:
# AAEExportRegisterSettings as bpy.types.PropertyGroup.
# AAEExportRegisterSmoothingID as bpy.types.Operator.
# AAEExportRegisterPreferencePanel as bpy.types.AddonPreferences.
# register_classes as tuple.
# is_register_classes_registered as bool
# -------------------------------------
# The last is the standard Blender register functions:
# register
# register_export_legacy
# register_main_classes
# register_register_classes
# unregister
# unregister_main_classes
# unregister_register_classes
# -------------------------------------
# ("import name", "PyPI name", "minimum version")
smoothing_modules = (("numpy", "numpy", ""),
("sklearn", "scikit-learn", "0.18"),
("matplotlib", "matplotlib", ""),
("PIL", "Pillow", ""))
is_smoothing_modules_available = False
def get_smoothing_modules_install_description():
from pathlib import PurePath
import sys
pre_modules = "This will download and install "
modules = " and ".join([", ".join(["pip"] + [module[1] for module in smoothing_modules[:-1]]), smoothing_modules[-1][1]]) if len(smoothing_modules) != 0 else "pip"
post_modules_pre_path = " to Blender's python environment at „"
path = PurePath(sys.prefix).as_posix()
post_path = "“. This process normally takes about 2 minutes"
if len(pre_modules) + len(modules) + len(post_modules_pre_path) + len(path) + len(post_path) < 240:
return pre_modules + modules + post_modules_pre_path + path + post_path
else:
available_len = 240 - len(pre_modules) - len(modules) - len(post_modules_pre_path) - len(post_path)
path_last_two_parts = "/" + (parts := PurePath(path).parts)[-2] + "/" + parts[-1]
return pre_modules + modules + post_modules_pre_path + path[:available_len - len(path_last_two_parts) - 3] + "..." + path_last_two_parts + post_path
class AAEExportSettings(bpy.types.PropertyGroup):
bl_label = "AAEExportSettings"
bl_idname = "AAEExportSettings"
do_includes_power_pin: bpy.props.BoolProperty(name="Includes Power Pin",
description="Includes Power Pin data in the export for tracks and plane tracks.\nIf Aegisub-Perspective-Motion is unable to recognise the data, please update Aegisub-Perspective-Motion to the newest version.\nThis option will be removed by late January and Power Pin data will be included by default",
default=True)
do_do_not_overwrite: bpy.props.BoolProperty(name="Do not overwrite",
description="Generate unique filename every time",
default=False)
do_also_export: bpy.props.BoolProperty(name="Auto export",
description="Automatically export AAE data to file when copying",
default=True)
do_advanced_smoothing: bpy.props.BoolProperty(name="Advanced",
description="Reveal more options for smoothing, including using different smoothing settings for different section of the clip and for different data and axis",
default=False)
def _null_property_update(self, context):
if self.null_property != "":
self.null_property = ""
null_property: bpy.props.StringProperty(name="",
description="An empty field; Nothing to see here",
default="",
update=_null_property_update)
class AAEExportSettingsClip(bpy.types.PropertyGroup):
bl_label = "AAEExportSettingsClip"
bl_idname = "AAEExportSettingsClip"
def _do_smoothing_update(self, context):
# Create the first section if there aren't
if context.edit_movieclip.AAEExportSettingsSectionLL == 0:
self.smoothing_blending_cubic_p1 = 0.10
self.smoothing_blending_cubic_p2 = 0.90
self.smoothing_blending_cubic_range = 3.0
item = context.edit_movieclip.AAEExportSettingsSectionL.add()
context.edit_movieclip.AAEExportSettingsSectionLL = 1
context.edit_movieclip.AAEExportSettingsSectionLI = 0
item.frame_update_suppress = False
item.start_frame = 1
item.end_frame = 1
do_smoothing_fake: bpy.props.BoolProperty(name="Enable",
description="Perform smoothing on tracking data.\nThis feature requires additional packages to be installed. Please head to „Edit > Preference > Add-ons > Video Tools: AAE Export > Preferences“ to install the dependencies",
default=False)
do_smoothing: bpy.props.BoolProperty(name="Enable",
description="Perform smoothing on tracking data.\nThis uses the track's position, scale, rotation and Power Pin data to fit polynomial regression models, and then uses the fit models to generate smoothed data",
default=False,
update=_do_smoothing_update)
def _do_predictive_smoothing_update(self, context):
context.edit_movieclip.AAEExportSettingsSectionL[0].smoothing_extrapolate = self.do_predictive_smoothing
do_predictive_smoothing: bpy.props.BoolProperty(name="Extrapolate",
description="Generate position, scale, rotation and Power Pin data over the whole length of the clip, even if the track is disabled on some of the frames.\n\nThe four options above, „Smooth Position“, „Smooth Scale“, „Smooth Rotation“ and „Smooth Power Pin“, decides whether to use predicted data to replace the existing data on frames where the track is enabled, while this option decides whether to use predicted data to fill the gaps in frames where the track is not enabled",
default=False,
update=_do_predictive_smoothing_update)
smoothing_blending: bpy.props.EnumProperty(items=(("NONE", "No Blending", "Average the frame on the section boundaries and do not perform any blending for the other frames"),
("CUBIC", "Cubic", "Use a cubic curve to ease the transition between the sections"),
("SHIFT", "Shift", "Shift sections until they match up at the boundaries.\nThe amount each section is shifted is proportional to the number of frames in each section")),
name="Section Blending",
default="CUBIC")
smoothing_blending_cubic_p1: bpy.props.FloatProperty(name="p₁",
description="The cubic curve is given as (1-t)³ × 0 + (1-t)² × t × p₁ + (1-t) × t² × p₂ + t³ × 1. p₁ is the the second control point on the cubic curve",
default=0.00,
min=0.0,
max=1.0,
step=1,
precision=2)
smoothing_blending_cubic_p2: bpy.props.FloatProperty(name="p₂",
description="The cubic curve is given as (1-t)³ × 0 + (1-t)² × t × p₁ + (1-t) × t² × p₂ + t³ × 1. p₂ is the the third control point on the cubic curve",
default=0.00,
min=0.0,
max=1.0,
step=1,
precision=2)
smoothing_blending_cubic_range: bpy.props.FloatProperty(name="Range",
description="Number of frames prior to and following the section boundaries where the blending is applied",
default=0.0,
min=1.0,
soft_max=24.0,
step=50,
precision=1)
power_pin_remap_0002: bpy.props.EnumProperty(items=(("0002", "0002 (Upper-left)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select target Power Pin for the upper-left corner of the track"),
("0003", "0003 (Upper-right)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select target Power Pin for the upper-left corner of the track"),
("0004", "0004 (Lower-left)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select target Power Pin for the upper-left corner of the track"),
("0005", "0005 (Lower-right)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select target Power Pin for the upper-left corner of the track")),
name="0002 (Upper-left)",
default="0002")
power_pin_remap_0003: bpy.props.EnumProperty(items=(("0002", "0002 (Upper-left)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select target Power Pin for the upper-right corner of the track"),
("0003", "0003 (Upper-right)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select target Power Pin for the upper-right corner of the track"),
("0004", "0004 (Lower-left)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select target Power Pin for the upper-right corner of the track"),
("0005", "0005 (Lower-right)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select target Power Pin for the upper-right corner of the track")),
name="0003 (Upper-right)",
default="0003")
power_pin_remap_0004: bpy.props.EnumProperty(items=(("0002", "0002 (Upper-left)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select the target Power Pin for the lower-left corner of the track"),
("0003", "0003 (Upper-right)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select the target Power Pin for the lower-left corner of the track"),
("0004", "0004 (Lower-left)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select the target Power Pin for the lower-left corner of the track"),
("0005", "0005 (Lower-right)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select the target Power Pin for the lower-left corner of the track")),
name="0004 (Lower-left)",
default="0004")
power_pin_remap_0005: bpy.props.EnumProperty(items=(("0002", "0002 (Upper-left)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select the target Power Pin for the lower-right corner of the track"),
("0003", "0003 (Upper-right)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select the target Power Pin for the lower-right corner of the track"),
("0004", "0004 (Lower-left)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select the target Power Pin for the lower-right corner of the track"),
("0005", "0005 (Lower-right)", "The four Power Pin data, Power Pin-0002 to 0005, follows the order of upper-left, upper-right, lower-left, lower-right.\nTo remap, select the target Power Pin for the lower-right corner of the track")),
name="0005 (Lower-right)",
default="0005")
# fake settings before the first section is created
start_frame: bpy.props.IntProperty(name="Start Frame",
description="The first frame of the section",
default=0
)
end_frame: bpy.props.IntProperty(name="End Frame",
description="The last frame of the section",
default=0
)
disable_section: bpy.props.BoolProperty(name="Disable section",
description="Ignore the section and don't export anything from the section",
default=False)
smoothing_use_different_x_y: bpy.props.BoolProperty(name="Axes",
description="Use different regression settings for x and y axes of position, scale and Power Pin data",
default=False)
smoothing_use_different_model: bpy.props.BoolProperty(name="Data",
description="Use different regression models for position, scale, rotation and Power Pin data",
default=False)
smoothing_extrapolate: bpy.props.BoolProperty(name="Extrapolate",
description="Generate position, scale, rotation and Power Pin data over the whole length of the section, even if the track is disabled on some of the frames.\n\nThe four options below, „Smooth Position“, „Smooth Scale“, „Smooth Rotation“ and „Smooth Power Pin“, decides whether to use predicted data to replace the existing data on frames where the track is enabled, while this option decides whether to use predicted data to fill the gaps in frames where the track is not enabled",
default=False)
def _smoothing_regressor_update(self, context):
self.smoothing_position_regressor = self.smoothing_regressor
self.smoothing_scale_regressor = self.smoothing_regressor
self.smoothing_rotation_regressor = self.smoothing_regressor
self.smoothing_power_pin_regressor = self.smoothing_regressor
pass
smoothing_regressor: bpy.props.EnumProperty(
items=(("HUBER", "Huber Regressor", "Huber Regressor is an L2-regularised regression model that is robust to outliers.\n\nFor more information, visit „https://scikit-learn.org/stable/modules/linear_model.html#robustness-regression-outliers-and-modeling-errors“ and „https://en.wikipedia.org/wiki/Huber_loss“"),
("LASSO", "Lasso Regressor", "Lasso Regressor is an L1-regularised regression model.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#lasso“ and „https://en.wikipedia.org/wiki/Lasso_(statistics)“"),
("LINEAR", "Linear Regressor", "Ordinary least squares regression model.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#ordinary-least-squares“ and „https://en.wikipedia.org/wiki/Ordinary_least_squares“")),
name="Linear Model",
default="LINEAR",
update=_smoothing_regressor_update)
def _smoothing_huber_epsilon_update(self, context):
self.smoothing_position_huber_epsilon = self.smoothing_huber_epsilon
self.smoothing_scale_huber_epsilon = self.smoothing_huber_epsilon
self.smoothing_rotation_huber_epsilon = self.smoothing_huber_epsilon
self.smoothing_power_pin_huber_epsilon = self.smoothing_huber_epsilon
pass
smoothing_huber_epsilon: bpy.props.FloatProperty(
name="Epsilon",
description="The epsilon of a Huber Regressor controls the number of samples that should be classified as outliers. The smaller the epsilon, the more robust it is to outliers.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.HuberRegressor.html“",
default=1.50,
min=1.00,
soft_max=10.00,
step=1,
precision=2,
update=_smoothing_huber_epsilon_update)
def _smoothing_lasso_alpha_update(self, context):
self.smoothing_position_lasso_alpha = self.smoothing_lasso_alpha
self.smoothing_scale_lasso_alpha = self.smoothing_lasso_alpha
self.smoothing_rotation_lasso_alpha = self.smoothing_lasso_alpha
self.smoothing_power_pin_lasso_alpha = self.smoothing_lasso_alpha
pass
smoothing_lasso_alpha: bpy.props.FloatProperty(
name="Alpha",
description="The alpha of a Lasso Regressor controls the regularisation strength.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lasso.html“",
default=0.10,
min=0.00,
soft_max=100.0,
step=1,
precision=2,
update=_smoothing_lasso_alpha_update)
def _smoothing_do_position_update(self, context):
pass
smoothing_do_position: bpy.props.BoolProperty(
name="Smooth",
description="Perform smoothing on position data",
default=True,
update=_smoothing_do_position_update)
def _smoothing_position_degree_update(self, context):
pass
smoothing_position_degree: bpy.props.IntProperty(
name="Max Degree",
description="The maximal polynomial degree for position data.\nSet degree to 0 to average the data in the section, 1 to perform linear regression on the data, 2 to perform quadratic regression on the data, and 3 to perform cubic regression on the data.\n\nSetting this too high may cause overfitting.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#polynomial-regression-extending-linear-models-with-basis-functions“ and „https://en.wikipedia.org/wiki/Polynomial_regression“",
default=0,
min=0,
soft_max=16,
update=_smoothing_position_degree_update)
def _smoothing_do_scale_update(self, context):
pass
smoothing_do_scale: bpy.props.BoolProperty(
name="Smooth",
description="Perform smoothing on scale data",
default=True,
update=_smoothing_do_scale_update)
def _smoothing_scale_degree_update(self, context):
pass
smoothing_scale_degree: bpy.props.IntProperty(
name="Max Degree",
description="The maximal polynomial degree for scale data.\nSet degree to 0 to average the data in the section, 1 to perform linear regression on the data, 2 to perform quadratic regression on the data, and 3 to perform cubic regression on the data.\n\nSetting this too high may cause overfitting.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#polynomial-regression-extending-linear-models-with-basis-functions“ and „https://en.wikipedia.org/wiki/Polynomial_regression“",
default=0,
min=0,
soft_max=16,
update=_smoothing_scale_degree_update)
def _smoothing_do_rotation_update(self, context):
pass
smoothing_do_rotation: bpy.props.BoolProperty(
name="Smooth",
description="Perform smoothing on rotation data",
default=True,
update=_smoothing_do_rotation_update)
def _smoothing_rotation_degree_update(self, context):
pass
smoothing_rotation_degree: bpy.props.IntProperty(
name="Max Degree",
description="The maximal polynomial degree for rotation data.\nSet degree to 0 to average the data in the section, 1 to perform linear regression on the data, 2 to perform quadratic regression on the data, and 3 to perform cubic regression on the data.\n\nSetting this too high may cause overfitting.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#polynomial-regression-extending-linear-models-with-basis-functions“ and „https://en.wikipedia.org/wiki/Polynomial_regression“",
default=0,
min=0,
soft_max=16,
update=_smoothing_rotation_degree_update)
def _smoothing_do_power_pin_update(self, context):
pass
smoothing_do_power_pin: bpy.props.BoolProperty(
name="Smooth",
description="Perform smoothing on Power Pin data",
default=True,
update=_smoothing_do_power_pin_update)
def _smoothing_power_pin_degree_update(self, context):
pass
smoothing_power_pin_degree: bpy.props.IntProperty(
name="Max Degree",
description="The maximal polynomial degree for power_pin data.\nSet degree to 0 to average the data in the section, 1 to perform linear regression on the data, 2 to perform quadratic regression on the data, and 3 to perform cubic regression on the data.\n\nSetting this too high may cause overfitting.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#polynomial-regression-extending-linear-models-with-basis-functions“ and „https://en.wikipedia.org/wiki/Polynomial_regression“",
default=0,
min=0,
soft_max=16,
update=_smoothing_power_pin_degree_update)
class AAEExportSettingsSectionL(bpy.types.PropertyGroup):
bl_label = "AAEExportSettingsSectionL"
bl_idname = "AAEExportSettingsSectionL"
frame_update_suppress: bpy.props.BoolProperty(default=True)
frame_update_tooltip: bpy.props.StringProperty(name="frame_update_tooltip", default="Sadly you can't rename sections")
def _start_frame_update(self, context):
if not self.frame_update_suppress:
if context.edit_movieclip.AAEExportSettingsSectionLI == 0:
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].start_frame \
= context.edit_movieclip.frame_start
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= False
else:
if context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].start_frame < context.edit_movieclip.frame_start + context.edit_movieclip.AAEExportSettingsSectionLI:
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].start_frame \
= context.edit_movieclip.frame_start + context.edit_movieclip.AAEExportSettingsSectionLI
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= False
if context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].start_frame > context.edit_movieclip.frame_start + context.edit_movieclip.frame_duration - context.edit_movieclip.AAEExportSettingsSectionLL + context.edit_movieclip.AAEExportSettingsSectionLI:
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].start_frame \
= context.edit_movieclip.frame_start + context.edit_movieclip.frame_duration - context.edit_movieclip.AAEExportSettingsSectionLL + context.edit_movieclip.AAEExportSettingsSectionLI
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= False
for i in range(context.edit_movieclip.AAEExportSettingsSectionLI - 1, -1, -1):
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[i].end_frame \
= context.edit_movieclip.AAEExportSettingsSectionL[i + 1].start_frame
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= False
if context.edit_movieclip.AAEExportSettingsSectionL[i].start_frame >= context.edit_movieclip.AAEExportSettingsSectionL[i].end_frame:
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[i].start_frame \
= context.edit_movieclip.AAEExportSettingsSectionL[i].end_frame - 1
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= False
else:
break
for i in range(context.edit_movieclip.AAEExportSettingsSectionLI, context.edit_movieclip.AAEExportSettingsSectionLL - 1):
if context.edit_movieclip.AAEExportSettingsSectionL[i].end_frame <= context.edit_movieclip.AAEExportSettingsSectionL[i].start_frame:
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= context.edit_movieclip.AAEExportSettingsSectionL[i + 1].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[i].end_frame \
= context.edit_movieclip.AAEExportSettingsSectionL[i + 1].start_frame \
= context.edit_movieclip.AAEExportSettingsSectionL[i].start_frame + 1
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= context.edit_movieclip.AAEExportSettingsSectionL[i + 1].frame_update_suppress \
= False
else:
break
def _end_frame_update(self, context):
if not self.frame_update_suppress:
if context.edit_movieclip.AAEExportSettingsSectionLI == context.edit_movieclip.AAEExportSettingsSectionLL - 1:
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].end_frame \
= context.edit_movieclip.frame_start + context.edit_movieclip.frame_duration - 1
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= False
else:
if context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].end_frame > context.edit_movieclip.frame_start + context.edit_movieclip.frame_duration - context.edit_movieclip.AAEExportSettingsSectionLL + context.edit_movieclip.AAEExportSettingsSectionLI:
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].end_frame \
= context.edit_movieclip.frame_start + context.edit_movieclip.frame_duration - context.edit_movieclip.AAEExportSettingsSectionLL + context.edit_movieclip.AAEExportSettingsSectionLI
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= False
if context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].end_frame < context.edit_movieclip.frame_start + context.edit_movieclip.AAEExportSettingsSectionLI + 1:
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].end_frame \
= context.edit_movieclip.frame_start + context.edit_movieclip.AAEExportSettingsSectionLI + 1
context.edit_movieclip.AAEExportSettingsSectionL[context.edit_movieclip.AAEExportSettingsSectionLI].frame_update_suppress \
= False
for i in range(context.edit_movieclip.AAEExportSettingsSectionLI + 1, context.edit_movieclip.AAEExportSettingsSectionLL):
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[i].start_frame \
= context.edit_movieclip.AAEExportSettingsSectionL[i - 1].end_frame
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= False
if context.edit_movieclip.AAEExportSettingsSectionL[i].end_frame <= context.edit_movieclip.AAEExportSettingsSectionL[i].start_frame:
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[i].end_frame \
= context.edit_movieclip.AAEExportSettingsSectionL[i].start_frame + 1
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= False
else:
break
for i in range(context.edit_movieclip.AAEExportSettingsSectionLI, 0, -1):
if context.edit_movieclip.AAEExportSettingsSectionL[i].start_frame >= context.edit_movieclip.AAEExportSettingsSectionL[i].end_frame:
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= context.edit_movieclip.AAEExportSettingsSectionL[i - 1].frame_update_suppress \
= True
context.edit_movieclip.AAEExportSettingsSectionL[i].start_frame \
= context.edit_movieclip.AAEExportSettingsSectionL[i - 1].end_frame \
= context.edit_movieclip.AAEExportSettingsSectionL[i].end_frame - 1
context.edit_movieclip.AAEExportSettingsSectionL[i].frame_update_suppress \
= context.edit_movieclip.AAEExportSettingsSectionL[i - 1].frame_update_suppress \
= False
else:
break
start_frame: bpy.props.IntProperty(name="Start Frame",
description="The first frame of the section",
default=0,
update=_start_frame_update)
end_frame: bpy.props.IntProperty(name="End Frame",
description="The last frame of the section",
default=0,
update=_end_frame_update)
disable_section: bpy.props.BoolProperty(name="Disable section",
description="Ignore the section and don't export anything from the section",
default=False)
smoothing_use_different_x_y: bpy.props.BoolProperty(name="Axes",
description="Use different regression settings for x and y axes of position, scale and Power Pin data",
default=False)
smoothing_use_different_model: bpy.props.BoolProperty(name="Data",
description="Use different regression models for position, scale, rotation and Power Pin data",
default=False)
smoothing_extrapolate: bpy.props.BoolProperty(name="Extrapolate",
description="Generate position, scale, rotation and Power Pin data over the whole length of the section, even if the track is disabled on some of the frames.\n\nThe four options below, „Smooth Position“, „Smooth Scale“, „Smooth Rotation“ and „Smooth Power Pin“, decides whether to use predicted data to replace the existing data on frames where the track is enabled, while this option decides whether to use predicted data to fill the gaps in frames where the track is not enabled",
default=False)
def _smoothing_regressor_update(self, context):
self.smoothing_position_regressor = self.smoothing_regressor
self.smoothing_scale_regressor = self.smoothing_regressor
self.smoothing_rotation_regressor = self.smoothing_regressor
self.smoothing_power_pin_regressor = self.smoothing_regressor
self.smoothing_x_regressor = self.smoothing_regressor
self.smoothing_y_regressor = self.smoothing_regressor
pass
smoothing_regressor: bpy.props.EnumProperty(
items=(("HUBER", "Huber Regressor", "Huber Regressor is an L2-regularised regression model that is robust to outliers.\n\nFor more information, visit „https://scikit-learn.org/stable/modules/linear_model.html#robustness-regression-outliers-and-modeling-errors“ and „https://en.wikipedia.org/wiki/Huber_loss“"),
("LASSO", "Lasso Regressor", "Lasso Regressor is an L1-regularised regression model.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#lasso“ and „https://en.wikipedia.org/wiki/Lasso_(statistics)“"),
("LINEAR", "Linear Regressor", "Ordinary least squares regression model.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#ordinary-least-squares“ and „https://en.wikipedia.org/wiki/Ordinary_least_squares“")),
name="Linear Model",
default="LINEAR",
update=_smoothing_regressor_update)
def _smoothing_huber_epsilon_update(self, context):
self.smoothing_position_huber_epsilon = self.smoothing_huber_epsilon
self.smoothing_scale_huber_epsilon = self.smoothing_huber_epsilon
self.smoothing_rotation_huber_epsilon = self.smoothing_huber_epsilon
self.smoothing_power_pin_huber_epsilon = self.smoothing_huber_epsilon
self.smoothing_x_huber_epsilon = self.smoothing_huber_epsilon
self.smoothing_y_huber_epsilon = self.smoothing_huber_epsilon
pass
smoothing_huber_epsilon: bpy.props.FloatProperty(
name="Epsilon",
description="The epsilon of a Huber Regressor controls the number of samples that should be classified as outliers. The smaller the epsilon, the more robust it is to outliers.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.HuberRegressor.html“",
default=1.50,
min=1.00,
soft_max=10.00,
step=1,
precision=2,
update=_smoothing_huber_epsilon_update)
def _smoothing_lasso_alpha_update(self, context):
self.smoothing_position_lasso_alpha = self.smoothing_lasso_alpha
self.smoothing_scale_lasso_alpha = self.smoothing_lasso_alpha
self.smoothing_rotation_lasso_alpha = self.smoothing_lasso_alpha
self.smoothing_power_pin_lasso_alpha = self.smoothing_lasso_alpha
self.smoothing_x_lasso_alpha = self.smoothing_lasso_alpha
self.smoothing_y_lasso_alpha = self.smoothing_lasso_alpha
pass
smoothing_lasso_alpha: bpy.props.FloatProperty(
name="Alpha",
description="The alpha of a Lasso Regressor controls the regularisation strength.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lasso.html“",
default=0.10,
min=0.00,
soft_max=100.0,
step=1,
precision=2,
update=_smoothing_lasso_alpha_update)
def _smoothing_x_regressor_update(self, context):
self.smoothing_position_x_regressor = self.smoothing_x_regressor
self.smoothing_scale_x_regressor = self.smoothing_x_regressor
self.smoothing_rotation_regressor = self.smoothing_x_regressor
self.smoothing_power_pin_x_regressor = self.smoothing_x_regressor
pass
smoothing_x_regressor: bpy.props.EnumProperty(
items=(("HUBER", "Huber Regressor", "Huber Regressor is an L2-regularised regression model that is robust to outliers.\n\nFor more information, visit „https://scikit-learn.org/stable/modules/linear_model.html#robustness-regression-outliers-and-modeling-errors“ and „https://en.wikipedia.org/wiki/Huber_loss“"),
("LASSO", "Lasso Regressor", "Lasso Regressor is an L1-regularised regression model.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#lasso“ and „https://en.wikipedia.org/wiki/Lasso_(statistics)“"),
("LINEAR", "Linear Regressor", "Ordinary least squares regression model.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#ordinary-least-squares“ and „https://en.wikipedia.org/wiki/Ordinary_least_squares“")),
name="Linear Model",
default="LINEAR",
update=_smoothing_x_regressor_update)
def _smoothing_x_huber_epsilon_update(self, context):
self.smoothing_position_x_huber_epsilon = self.smoothing_x_huber_epsilon
self.smoothing_scale_x_huber_epsilon = self.smoothing_x_huber_epsilon
self.smoothing_rotation_huber_epsilon = self.smoothing_x_huber_epsilon
self.smoothing_power_pin_x_huber_epsilon = self.smoothing_x_huber_epsilon
pass
smoothing_x_huber_epsilon: bpy.props.FloatProperty(
name="Epsilon",
description="The epsilon of a Huber Regressor controls the number of samples that should be classified as outliers. The smaller the epsilon, the more robust it is to outliers.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.HuberRegressor.html“",
default=1.50,
min=1.00,
soft_max=10.00,
step=1,
precision=2,
update=_smoothing_x_huber_epsilon_update)
def _smoothing_x_lasso_alpha_update(self, context):
self.smoothing_position_x_lasso_alpha = self.smoothing_x_lasso_alpha
self.smoothing_scale_x_lasso_alpha = self.smoothing_x_lasso_alpha
self.smoothing_rotation_lasso_alpha = self.smoothing_x_lasso_alpha
self.smoothing_power_pin_x_lasso_alpha = self.smoothing_x_lasso_alpha
pass
smoothing_x_lasso_alpha: bpy.props.FloatProperty(
name="Alpha",
description="The alpha of a Lasso Regressor controls the regularisation strength.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lasso.html“",
default=0.10,
min=0.00,
soft_max=100.0,
step=1,
precision=2,
update=_smoothing_x_lasso_alpha_update)
def _smoothing_y_regressor_update(self, context):
self.smoothing_position_y_regressor = self.smoothing_y_regressor
self.smoothing_scale_y_regressor = self.smoothing_y_regressor
self.smoothing_power_pin_y_regressor = self.smoothing_y_regressor
pass
smoothing_y_regressor: bpy.props.EnumProperty(
items=(("HUBER", "Huber Regressor", "Huber Regressor is an L2-regularised regression model that is robust to outliers.\n\nFor more information, visit „https://scikit-learn.org/stable/modules/linear_model.html#robustness-regression-outliers-and-modeling-errors“ and „https://en.wikipedia.org/wiki/Huber_loss“"),
("LASSO", "Lasso Regressor", "Lasso Regressor is an L1-regularised regression model.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#lasso“ and „https://en.wikipedia.org/wiki/Lasso_(statistics)“"),
("LINEAR", "Linear Regressor", "Ordinary least squares regression model.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#ordinary-least-squares“ and „https://en.wikipedia.org/wiki/Ordinary_least_squares“")),
name="Linear Model",
default="LINEAR",
update=_smoothing_y_regressor_update)
def _smoothing_y_huber_epsilon_update(self, context):
self.smoothing_position_y_huber_epsilon = self.smoothing_y_huber_epsilon
self.smoothing_scale_y_huber_epsilon = self.smoothing_y_huber_epsilon
self.smoothing_power_pin_y_huber_epsilon = self.smoothing_y_huber_epsilon
pass
smoothing_y_huber_epsilon: bpy.props.FloatProperty(
name="Epsilon",
description="The epsilon of a Huber Regressor controls the number of samples that should be classified as outliers. The smaller the epsilon, the more robust it is to outliers.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.HuberRegressor.html“",
default=1.50,
min=1.00,
soft_max=10.00,
step=1,
precision=2,
update=_smoothing_y_huber_epsilon_update)
def _smoothing_y_lasso_alpha_update(self, context):
self.smoothing_position_y_lasso_alpha = self.smoothing_y_lasso_alpha
self.smoothing_scale_y_lasso_alpha = self.smoothing_y_lasso_alpha
self.smoothing_power_pin_y_lasso_alpha = self.smoothing_y_lasso_alpha
pass
smoothing_y_lasso_alpha: bpy.props.FloatProperty(
name="Alpha",
description="The alpha of a Lasso Regressor controls the regularisation strength.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lasso.html“",
default=0.10,
min=0.00,
soft_max=100.0,
step=1,
precision=2,
update=_smoothing_y_lasso_alpha_update)
def _smoothing_do_position_update(self, context):
self.smoothing_do_position_x = self.smoothing_do_position
self.smoothing_do_position_y = self.smoothing_do_position
pass
smoothing_do_position: bpy.props.BoolProperty(
name="Smooth",
description="Perform smoothing on position data",
default=True,
update=_smoothing_do_position_update)
def _smoothing_position_degree_update(self, context):
self.smoothing_position_x_degree = self.smoothing_position_degree
self.smoothing_position_y_degree = self.smoothing_position_degree
pass
smoothing_position_degree: bpy.props.IntProperty(
name="Max Degree",
description="The maximal polynomial degree for position data.\nSet degree to 0 to average the data in the section, 1 to perform linear regression on the data, 2 to perform quadratic regression on the data, and 3 to perform cubic regression on the data.\n\nSetting this too high may cause overfitting.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#polynomial-regression-extending-linear-models-with-basis-functions“ and „https://en.wikipedia.org/wiki/Polynomial_regression“",
default=2,
min=0,
soft_max=16,
update=_smoothing_position_degree_update)
def _smoothing_position_regressor_update(self, context):
self.smoothing_position_x_regressor = self.smoothing_position_regressor
self.smoothing_position_y_regressor = self.smoothing_position_regressor
pass
smoothing_position_regressor: bpy.props.EnumProperty(
items=(("HUBER", "Huber Regressor", "Huber Regressor is an L2-regularised regression model that is robust to outliers.\n\nFor more information, visit „https://scikit-learn.org/stable/modules/linear_model.html#robustness-regression-outliers-and-modeling-errors“ and „https://en.wikipedia.org/wiki/Huber_loss“"),
("LASSO", "Lasso Regressor", "Lasso Regressor is an L1-regularised regression model.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#lasso“ and „https://en.wikipedia.org/wiki/Lasso_(statistics)“"),
("LINEAR", "Linear Regressor", "Ordinary least squares regression model.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/linear_model.html#ordinary-least-squares“ and „https://en.wikipedia.org/wiki/Ordinary_least_squares“")),
name="Linear Model",
default="LINEAR",
update=_smoothing_position_regressor_update)
def _smoothing_position_huber_epsilon_update(self, context):
self.smoothing_position_x_huber_epsilon = self.smoothing_position_huber_epsilon
self.smoothing_position_y_huber_epsilon = self.smoothing_position_huber_epsilon
pass
smoothing_position_huber_epsilon: bpy.props.FloatProperty(
name="Epsilon",
description="The epsilon of a Huber Regressor controls the number of samples that should be classified as outliers. The smaller the epsilon, the more robust it is to outliers.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.HuberRegressor.html“",
default=1.50,
min=1.00,
soft_max=10.00,
step=1,
precision=2,
update=_smoothing_position_huber_epsilon_update)
def _smoothing_position_lasso_alpha_update(self, context):
self.smoothing_position_x_lasso_alpha = self.smoothing_position_lasso_alpha
self.smoothing_position_y_lasso_alpha = self.smoothing_position_lasso_alpha
pass
smoothing_position_lasso_alpha: bpy.props.FloatProperty(
name="Alpha",
description="The alpha of a Lasso Regressor controls the regularisation strength.\n\nFor more information, please visit „https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lasso.html“",
default=0.10,
min=0.00,
soft_max=100.0,
step=1,
precision=2,
update=_smoothing_position_lasso_alpha_update)