forked from NatronGitHub/Natron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Settings.cpp
3833 lines (3340 loc) · 164 KB
/
Settings.cpp
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
/* ***** BEGIN LICENSE BLOCK *****
* This file is part of Natron <https://natrongithub.github.io/>,
* (C) 2018-2021 The Natron developers
* (C) 2013-2018 INRIA and Alexandre Gauthier-Foichat
*
* Natron is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Natron is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Natron. If not, see <http://www.gnu.org/licenses/gpl-2.0.html>
* ***** END LICENSE BLOCK ***** */
// ***** BEGIN PYTHON BLOCK *****
// from <https://docs.python.org/3/c-api/intro.html#include-files>:
// "Since Python may define some pre-processor definitions which affect the standard headers on some systems, you must include Python.h before any standard headers are included."
#include <Python.h>
// ***** END PYTHON BLOCK *****
#include "Settings.h"
#include <cassert>
#include <stdexcept>
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QSettings>
#include <QtCore/QThreadPool>
#include <QtCore/QThread>
#include <QtCore/QTextStream>
#ifdef WINDOWS
#include <tchar.h>
#endif
#include "Global/StrUtils.h"
#include "Engine/AppManager.h"
#include "Engine/AppInstance.h"
#include "Engine/KnobFactory.h"
#include "Engine/KnobFile.h"
#include "Engine/KnobTypes.h"
#include "Engine/LibraryBinary.h"
#include "Engine/MemoryInfo.h" // getSystemTotalRAM, isApplication32Bits, printAsRAM
#include "Engine/Node.h"
#include "Engine/OSGLContext.h"
#include "Engine/OutputSchedulerThread.h"
#include "Engine/Plugin.h"
#include "Engine/Project.h"
#include "Engine/StandardPaths.h"
#include "Engine/Utils.h"
#include "Engine/ViewIdx.h"
#include "Engine/ViewerInstance.h"
#include "Gui/GuiDefines.h"
#include <SequenceParsing.h> // for removePath
#ifdef WINDOWS
#include <ofxhPluginCache.h>
#endif
#define NATRON_DEFAULT_OCIO_CONFIG_NAME "blender"
#define NATRON_CUSTOM_OCIO_CONFIG_NAME "Custom config"
#define NATRON_DEFAULT_APPEARANCE_VERSION 1
#define NATRON_CUSTOM_HOST_NAME_ENTRY "Custom..."
NATRON_NAMESPACE_ENTER
Settings::Settings()
: KnobHolder( AppInstancePtr() ) // < Settings are process wide and do not belong to a single AppInstance
, _restoringSettings(false)
, _ocioRestored(false)
, _settingsExisted(false)
, _defaultAppearanceOutdated(false)
{
}
static QStringList
getDefaultOcioConfigPaths()
{
QString binaryPath = appPTR->getApplicationBinaryPath();
StrUtils::ensureLastPathSeparator(binaryPath);
#ifdef __NATRON_LINUX__
QStringList ret;
ret.push_back( QString::fromUtf8("/usr/share/OpenColorIO-Configs") );
ret.push_back( QString( binaryPath + QString::fromUtf8("../share/OpenColorIO-Configs") ) );
ret.push_back( QString( binaryPath + QString::fromUtf8("../Resources/OpenColorIO-Configs") ) );
return ret;
#elif defined(__NATRON_WIN32__)
return QStringList( QString( binaryPath + QString::fromUtf8("../Resources/OpenColorIO-Configs") ) );
#elif defined(__NATRON_OSX__)
return QStringList( QString( binaryPath + QString::fromUtf8("../Resources/OpenColorIO-Configs") ) );
#endif
}
void
Settings::initializeKnobs()
{
initializeKnobsGeneral();
initializeKnobsThreading();
initializeKnobsRendering();
initializeKnobsGPU();
initializeKnobsProjectSetup();
initializeKnobsDocumentation();
initializeKnobsUserInterface();
initializeKnobsColorManagement();
initializeKnobsCaching();
initializeKnobsViewers();
initializeKnobsNodeGraph();
initializeKnobsPlugins();
initializeKnobsPython();
initializeKnobsAppearance();
initializeKnobsGuiColors();
initializeKnobsCurveEditorColors();
initializeKnobsDopeSheetColors();
initializeKnobsNodeGraphColors();
initializeKnobsScriptEditorColors();
setDefaultValues();
}
void
Settings::initializeKnobsGeneral()
{
_generalTab = AppManager::createKnob<KnobPage>( this, tr("General") );
_natronSettingsExist = AppManager::createKnob<KnobBool>( this, tr("Existing settings") );
_natronSettingsExist->setName("existingSettings");
_natronSettingsExist->setSecretByDefault(true);
_generalTab->addKnob(_natronSettingsExist);
_saveSettings = AppManager::createKnob<KnobBool>( this, tr("Save settings on change") );
_saveSettings->setName("saveSettings");
_saveSettings->setDefaultValue(true);
_saveSettings->setSecretByDefault(true);
_generalTab->addKnob(_saveSettings);
_checkForUpdates = AppManager::createKnob<KnobBool>( this, tr("Always check for updates on start-up") );
_checkForUpdates->setName("checkForUpdates");
_checkForUpdates->setHintToolTip( tr("When checked, %1 will check for new updates on start-up of the application.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_generalTab->addKnob(_checkForUpdates);
#ifdef NATRON_USE_BREAKPAD
_enableCrashReports = AppManager::createKnob<KnobBool>( this, tr("Enable crash reporting") );
_enableCrashReports->setName("enableCrashReports");
_enableCrashReports->setHintToolTip( tr("When checked, if %1 crashes a window will pop-up asking you "
"whether you want to upload the crash dump to the developers or not. "
"This can help them track down the bug.\n"
"If you need to turn the crash reporting system off, uncheck this.\n"
"Note that when using the application in command-line mode, if crash reports are "
"enabled, they will be automatically uploaded.\n"
"Changing this requires a restart of the application to take effect.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_enableCrashReports->setAddNewLine(false);
_generalTab->addKnob(_enableCrashReports);
_testCrashReportButton = AppManager::createKnob<KnobButton>( this, tr("Test Crash Reporting") );
_testCrashReportButton->setName("testCrashReporting");
_testCrashReportButton->setHintToolTip( tr("This button is for developers only to test whether the crash reporting system "
"works correctly. Do not use this.") );
_generalTab->addKnob(_testCrashReportButton);
#endif
_autoSaveDelay = AppManager::createKnob<KnobInt>( this, tr("Auto-save trigger delay") );
_autoSaveDelay->setName("autoSaveDelay");
_autoSaveDelay->disableSlider();
_autoSaveDelay->setMinimum(0);
_autoSaveDelay->setMaximum(60);
_autoSaveDelay->setHintToolTip( tr("The number of seconds after an event that %1 should wait before "
" auto-saving. Note that if a render is in progress, %1 will "
" wait until it is done to actually auto-save.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_generalTab->addKnob(_autoSaveDelay);
_autoSaveUnSavedProjects = AppManager::createKnob<KnobBool>( this, tr("Enable Auto-save for unsaved projects") );
_autoSaveUnSavedProjects->setName("autoSaveUnSavedProjects");
_autoSaveUnSavedProjects->setHintToolTip( tr("When activated %1 will auto-save projects that have never been "
"saved and will prompt you on startup if an auto-save of that unsaved project was found. "
"Disabling this will no longer save un-saved project.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_generalTab->addKnob(_autoSaveUnSavedProjects);
_hostName = AppManager::createKnob<KnobChoice>( this, tr("Appear to plug-ins as") );
_hostName->setName("pluginHostName");
_hostName->setHintToolTip( tr("%1 will appear with the name of the selected application to the OpenFX plug-ins. "
"Changing it to the name of another application can help loading plugins which "
"restrict their usage to specific OpenFX host(s). "
"If a Host is not listed here, use the \"Custom\" entry to enter a custom host name. Changing this requires "
"a restart of the application and requires clearing "
"the OpenFX plugins cache from the Cache menu.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_knownHostNames.clear();
std::vector<ChoiceOption> visibleHostEntries;
assert(visibleHostEntries.size() == (int)eKnownHostNameNatron);
visibleHostEntries.push_back(ChoiceOption(NATRON_ORGANIZATION_DOMAIN_TOPLEVEL "." NATRON_ORGANIZATION_DOMAIN_SUB "." NATRON_APPLICATION_NAME, NATRON_APPLICATION_NAME, ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameNuke);
visibleHostEntries.push_back(ChoiceOption("uk.co.thefoundry.nuke", "Nuke", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameFusion);
visibleHostEntries.push_back(ChoiceOption("com.eyeonline.Fusion", "Fusion", "")); // or com.blackmagicdesign.Fusion
assert(visibleHostEntries.size() == (int)eKnownHostNameCatalyst);
visibleHostEntries.push_back(ChoiceOption("com.sony.Catalyst.Edit", "Sony Catalyst Edit", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameVegas);
visibleHostEntries.push_back(ChoiceOption("com.sonycreativesoftware.vegas", "Sony Vegas", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameToxik);
visibleHostEntries.push_back(ChoiceOption("Autodesk Toxik", "Toxik", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameScratch);
visibleHostEntries.push_back(ChoiceOption("Assimilator", "Scratch", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameDustBuster);
visibleHostEntries.push_back(ChoiceOption("Dustbuster", "DustBuster", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameResolve);
visibleHostEntries.push_back(ChoiceOption("DaVinciResolve", "Da Vinci Resolve", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameResolveLite);
visibleHostEntries.push_back(ChoiceOption("DaVinciResolveLite", "Da Vinci Resolve Lite", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameMistika);
visibleHostEntries.push_back(ChoiceOption("Mistika", "SGO Mistika", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNamePablo);
visibleHostEntries.push_back(ChoiceOption("com.quantel.genq", "Quantel Pablo Rio", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameMotionStudio);
visibleHostEntries.push_back(ChoiceOption("com.idtvision.MotionStudio", "IDT Motion Studio", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameShake);
visibleHostEntries.push_back(ChoiceOption("com.apple.shake", "Shake", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameBaselight);
visibleHostEntries.push_back(ChoiceOption("Baselight", "Baselight", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameFrameCycler);
visibleHostEntries.push_back(ChoiceOption("IRIDAS Framecycler", "FrameCycler", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameNucoda);
visibleHostEntries.push_back(ChoiceOption("Nucoda", "Nucoda Film Master", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameAvidDS);
visibleHostEntries.push_back(ChoiceOption("DS OFX HOST", "Avid DS", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameDX);
visibleHostEntries.push_back(ChoiceOption("com.chinadigitalvideo.dx", "China Digital Video DX", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameTitlerPro);
visibleHostEntries.push_back(ChoiceOption("com.newblue.titlerpro", "NewBlueFX Titler Pro", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameNewBlueOFXBridge);
visibleHostEntries.push_back(ChoiceOption("com.newblue.ofxbridge", "NewBlueFX OFX Bridge", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameRamen);
visibleHostEntries.push_back(ChoiceOption("Ramen", "Ramen", ""));
assert(visibleHostEntries.size() == (int)eKnownHostNameTuttleOfx);
visibleHostEntries.push_back(ChoiceOption("TuttleOfx", "TuttleOFX", ""));
_knownHostNames = visibleHostEntries;
visibleHostEntries.push_back(ChoiceOption(NATRON_CUSTOM_HOST_NAME_ENTRY, "Custom host name", ""));
_hostName->populateChoices(visibleHostEntries);
_hostName->setAddNewLine(false);
_generalTab->addKnob(_hostName);
_customHostName = AppManager::createKnob<KnobString>( this, tr("Custom Host name") );
_customHostName->setName("customHostName");
_customHostName->setHintToolTip( tr("This is the name of the OpenFX host (application) as it appears to the OpenFX plugins. "
"Changing it to the name of another application can help loading some plugins which "
"restrict their usage to specific OpenFX hosts. You should leave "
"this to its default value, unless a specific plugin refuses to load or run. "
"Changing this takes effect upon the next application launch, and requires clearing "
"the OpenFX plugins cache from the Cache menu. "
"The default host name is: \n%1").arg( QString::fromUtf8(NATRON_ORGANIZATION_DOMAIN_TOPLEVEL "." NATRON_ORGANIZATION_DOMAIN_SUB "." NATRON_APPLICATION_NAME) ) );
_customHostName->setSecretByDefault(true);
_generalTab->addKnob(_customHostName);
} // Settings::initializeKnobsGeneral
void
Settings::initializeKnobsThreading()
{
_threadingPage = AppManager::createKnob<KnobPage>( this, tr("Threading") );
_numberOfThreads = AppManager::createKnob<KnobInt>( this, tr("Number of render threads (0=\"guess\")") );
_numberOfThreads->setName("noRenderThreads");
QString numberOfThreadsToolTip = tr("Controls how many threads %1 should use to render. \n"
"-1: Disable multithreading totally (useful for debugging) \n"
"0: Guess the thread count from the number of cores and the available memory (min(num_cores,memory/3.5Gb)). The ideal threads count for this hardware is %2.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).arg( QThread::idealThreadCount() );
_numberOfThreads->setHintToolTip( numberOfThreadsToolTip.toStdString() );
_numberOfThreads->disableSlider();
_numberOfThreads->setMinimum(-1);
_numberOfThreads->setDisplayMinimum(-1);
_threadingPage->addKnob(_numberOfThreads);
#ifndef NATRON_PLAYBACK_USES_THREAD_POOL
_numberOfParallelRenders = AppManager::createKnob<KnobInt>( this, tr("Number of parallel renders (0=\"guess\")") );
_numberOfParallelRenders->setHintToolTip( tr("Controls the number of parallel frame that will be rendered at the same time by the renderer. "
"A value of 0 indicate that %1 should automatically determine "
"the best number of parallel renders to launch given your CPU activity. "
"Setting a value different than 0 should be done only if you know what you're doing and can lead "
"in some situations to worse performances. Overall to get the best performances you should have your "
"CPU at 100% activity without idle times.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_numberOfParallelRenders->setName("nParallelRenders");
_numberOfParallelRenders->setMinimum(0);
_numberOfParallelRenders->disableSlider();
_threadingPage->addKnob(_numberOfParallelRenders);
#endif
_useThreadPool = AppManager::createKnob<KnobBool>( this, tr("Effects use the thread-pool") );
_useThreadPool->setName("useThreadPool");
_useThreadPool->setHintToolTip( tr("When checked, all effects will use a global thread-pool to do their processing instead of launching "
"their own threads. "
"This suppresses the overhead created by the operating system creating new threads on demand for "
"each rendering of a special effect. As a result of this, the rendering might be faster on systems "
"with a lot of cores (>= 8). \n"
"WARNING: This is known not to work when using The Foundry's Furnace plug-ins (and potentially "
"some other plug-ins that the dev team hasn't not tested against it). When using these plug-ins, "
"make sure to uncheck this option first otherwise it will crash %1.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_threadingPage->addKnob(_useThreadPool);
_nThreadsPerEffect = AppManager::createKnob<KnobInt>( this, tr("Max threads usable per effect (0=\"guess\")") );
_nThreadsPerEffect->setName("nThreadsPerEffect");
_nThreadsPerEffect->setHintToolTip( tr("Controls how many threads a specific effect can use at most to do its processing. "
"A high value will allow 1 effect to spawn lots of thread and might not be efficient because "
"the time spent to launch all the threads might exceed the time spent actually processing. "
"By default (0) the renderer applies an heuristic to determine what's the best number of threads "
"for an effect.") );
_nThreadsPerEffect->setMinimum(0);
_nThreadsPerEffect->disableSlider();
_threadingPage->addKnob(_nThreadsPerEffect);
_renderInSeparateProcess = AppManager::createKnob<KnobBool>( this, tr("Render in a separate process") );
_renderInSeparateProcess->setName("renderNewProcess");
_renderInSeparateProcess->setHintToolTip( tr("If true, %1 will render frames to disk in "
"a separate process so that if the main application crashes, the render goes on.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_threadingPage->addKnob(_renderInSeparateProcess);
_queueRenders = AppManager::createKnob<KnobBool>( this, tr("Append new renders to queue") );
_queueRenders->setHintToolTip( tr("When checked, renders will be queued in the Progress Panel and will start only when all "
"other prior tasks are done.") );
_queueRenders->setName("queueRenders");
_threadingPage->addKnob(_queueRenders);
} // Settings::initializeKnobsThreading
void
Settings::initializeKnobsRendering()
{
_renderingPage = AppManager::createKnob<KnobPage>( this, tr("Rendering") );
_convertNaNValues = AppManager::createKnob<KnobBool>( this, tr("Convert NaN values") );
_convertNaNValues->setName("convertNaNs");
_convertNaNValues->setHintToolTip( tr("When activated, any pixel that is a Not-a-Number will be converted to 1 to avoid potential crashes from "
"downstream nodes. These values can be produced by faulty plug-ins when they use wrong arithmetic such as "
"division by zero. Disabling this option will keep the NaN(s) in the buffers: this may lead to an "
"undefined behavior.") );
_renderingPage->addKnob(_convertNaNValues);
_pluginUseImageCopyForSource = AppManager::createKnob<KnobBool>( this, tr("Copy input image before rendering any plug-in") );
_pluginUseImageCopyForSource->setName("copyInputImage");
_pluginUseImageCopyForSource->setHintToolTip( tr("If checked, when before rendering any node, %1 will copy "
"the input image to a local temporary image. This is to work-around some plug-ins "
"that write to the source image, thus modifying the output of the node upstream in "
"the cache. This is a known bug of an old version of RevisionFX REMap for instance. "
"By default, this parameter should be leaved unchecked, as this will require an extra "
"image allocation and copy before rendering any plug-in.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_renderingPage->addKnob(_pluginUseImageCopyForSource);
_activateRGBSupport = AppManager::createKnob<KnobBool>( this, tr("RGB components support") );
_activateRGBSupport->setHintToolTip( tr("When checked %1 is able to process images with only RGB components "
"(support for images with RGBA and Alpha components is always enabled). "
"Un-checking this option may prevent plugins that do not well support RGB components from crashing %1. "
"Changing this option requires a restart of the application.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_activateRGBSupport->setName("rgbSupport");
_renderingPage->addKnob(_activateRGBSupport);
_activateTransformConcatenationSupport = AppManager::createKnob<KnobBool>( this, tr("Transforms concatenation support") );
_activateTransformConcatenationSupport->setHintToolTip( tr("When checked %1 is able to concatenate transform effects "
"when they are chained in the compositing tree. This yields better results and faster "
"render times because the image is only filtered once instead of as many times as there are "
"transformations.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_activateTransformConcatenationSupport->setName("transformCatSupport");
_renderingPage->addKnob(_activateTransformConcatenationSupport);
}
void
Settings::populateOpenGLRenderers(const std::list<OpenGLRendererInfo>& renderers)
{
if ( renderers.empty() ) {
_availableOpenGLRenderers->setSecret(true);
_nOpenGLContexts->setSecret(true);
_enableOpenGL->setSecret(true);
return;
}
_nOpenGLContexts->setSecret(false);
_enableOpenGL->setSecret(false);
std::vector<ChoiceOption> entries( renderers.size() );
int i = 0;
for (std::list<OpenGLRendererInfo>::const_iterator it = renderers.begin(); it != renderers.end(); ++it, ++i) {
std::string option = it->vendorName + ' ' + it->rendererName + ' ' + it->glVersionString;
entries[i] = ChoiceOption(option);
}
_availableOpenGLRenderers->populateChoices(entries);
_availableOpenGLRenderers->setSecret(renderers.size() == 1);
}
bool
Settings::isOpenGLRenderingEnabled() const
{
if (_enableOpenGL->getIsSecret()) {
return false;
}
EnableOpenGLEnum enableOpenGL = (EnableOpenGLEnum)_enableOpenGL->getValue();
return enableOpenGL == eEnableOpenGLEnabled || (enableOpenGL == eEnableOpenGLDisabledIfBackground && !appPTR->isBackground());
}
int
Settings::getMaxOpenGLContexts() const
{
return _nOpenGLContexts->getValue();
}
GLRendererID
Settings::getActiveOpenGLRendererID() const
{
if ( _availableOpenGLRenderers->getIsSecret() ) {
// We were not able to detect multiple renderers, use default
return GLRendererID();
}
int activeIndex = _availableOpenGLRenderers->getValue();
const std::list<OpenGLRendererInfo>& renderers = appPTR->getOpenGLRenderers();
if ( (activeIndex < 0) || ( activeIndex >= (int)renderers.size() ) ) {
// Invalid index
return GLRendererID();
}
int i = 0;
for (std::list<OpenGLRendererInfo>::const_iterator it = renderers.begin(); it != renderers.end(); ++it, ++i) {
if (i == activeIndex) {
return it->rendererID;
}
}
return GLRendererID();
}
void
Settings::initializeKnobsGPU()
{
_gpuPage = AppManager::createKnob<KnobPage>( this, tr("GPU Rendering") );
_openglRendererString = AppManager::createKnob<KnobString>( this, tr("Active OpenGL renderer") );
_openglRendererString->setName("activeOpenGLRenderer");
_openglRendererString->setHintToolTip( tr("The currently active OpenGL renderer.") );
_openglRendererString->setAsLabel();
_gpuPage->addKnob(_openglRendererString);
_availableOpenGLRenderers = AppManager::createKnob<KnobChoice>( this, tr("OpenGL renderer") );
_availableOpenGLRenderers->setName("chooseOpenGLRenderer");
_availableOpenGLRenderers->setHintToolTip( tr("The renderer used to perform OpenGL rendering. Changing the OpenGL renderer requires a restart of the application.") );
_gpuPage->addKnob(_availableOpenGLRenderers);
_nOpenGLContexts = AppManager::createKnob<KnobInt>( this, tr("No. of OpenGL Contexts") );
_nOpenGLContexts->setName("maxOpenGLContexts");
_nOpenGLContexts->setMinimum(1);
_nOpenGLContexts->setDisplayMinimum(1);
_nOpenGLContexts->setDisplayMaximum(8);
_nOpenGLContexts->setMaximum(8);
_nOpenGLContexts->setHintToolTip( tr("The number of OpenGL contexts created to perform OpenGL rendering. Each OpenGL context can be attached to a CPU thread, allowing for more frames to be rendered simultaneously. Increasing this value may increase performances for graphs with mixed CPU/GPU nodes but can drastically reduce performances if too many OpenGL contexts are active at once.") );
_gpuPage->addKnob(_nOpenGLContexts);
_enableOpenGL = AppManager::createKnob<KnobChoice>( this, tr("OpenGL Rendering") );
_enableOpenGL->setName("enableOpenGLRendering");
{
std::vector<ChoiceOption> entries;
assert(entries.size() == (int)Settings::eEnableOpenGLEnabled);
entries.push_back(ChoiceOption("enabled",
tr("Enabled").toStdString(),
tr("If a plug-in support GPU rendering, prefer rendering using the GPU if possible.").toStdString()));
assert(entries.size() == (int)Settings::eEnableOpenGLDisabled);
entries.push_back(ChoiceOption("disabled",
tr("Disabled").toStdString(),
tr("Disable GPU rendering for all plug-ins.").toStdString()));
assert(entries.size() == (int)Settings::eEnableOpenGLDisabledIfBackground);
entries.push_back(ChoiceOption("foreground",
tr("Disabled If Background").toStdString(),
tr("Disable GPU rendering when rendering with NatronRenderer but not in GUI mode.").toStdString()));
_enableOpenGL->populateChoices(entries);
}
_enableOpenGL->setHintToolTip( tr("Select whether to activate OpenGL rendering or not. If disabled, even though a Project enable GPU rendering, it will not be activated.") );
_gpuPage->addKnob(_enableOpenGL);
}
void
Settings::initializeKnobsProjectSetup()
{
_projectsPage = AppManager::createKnob<KnobPage>( this, tr("Project Setup") );
_firstReadSetProjectFormat = AppManager::createKnob<KnobBool>( this, tr("First image read set project format") );
_firstReadSetProjectFormat->setName("autoProjectFormat");
_firstReadSetProjectFormat->setHintToolTip( tr("If checked, the project size is set to this of the first image or video read within the project.") );
_projectsPage->addKnob(_firstReadSetProjectFormat);
_autoPreviewEnabledForNewProjects = AppManager::createKnob<KnobBool>( this, tr("Auto-preview enabled by default for new projects") );
_autoPreviewEnabledForNewProjects->setName("enableAutoPreviewNewProjects");
_autoPreviewEnabledForNewProjects->setHintToolTip( tr("If checked, then when creating a new project, the Auto-preview option"
" is enabled.") );
_projectsPage->addKnob(_autoPreviewEnabledForNewProjects);
_fixPathsOnProjectPathChanged = AppManager::createKnob<KnobBool>( this, tr("Auto fix relative file-paths") );
_fixPathsOnProjectPathChanged->setHintToolTip( tr("If checked, when a project-path changes (either the name or the value pointed to), %1 checks all file-path parameters in the project and tries to fix them.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_fixPathsOnProjectPathChanged->setName("autoFixRelativePaths");
_projectsPage->addKnob(_fixPathsOnProjectPathChanged);
_enableMappingFromDriveLettersToUNCShareNames = AppManager::createKnob<KnobBool>( this, tr("Use drive letters instead of server names (Windows only)") );
_enableMappingFromDriveLettersToUNCShareNames->setHintToolTip( tr("This is only relevant for Windows: If checked, %1 will not convert a path starting with a drive letter from the file dialog to a network share name. You may use this if for example you want to share a same project with several users across facilities with different servers but where users have all the same drive attached to a server.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_enableMappingFromDriveLettersToUNCShareNames->setName("useDriveLetters");
#ifndef __NATRON_WIN32__
_enableMappingFromDriveLettersToUNCShareNames->setAllDimensionsEnabled(false);
#endif
_projectsPage->addKnob(_enableMappingFromDriveLettersToUNCShareNames);
}
void
Settings::initializeKnobsDocumentation()
{
_documentationPage = AppManager::createKnob<KnobPage>( this, tr("Documentation") );
#ifdef NATRON_DOCUMENTATION_ONLINE
_documentationSource = AppManager::createKnob<KnobChoice>( this, tr("Documentation Source") );
_documentationSource->setName("documentationSource");
_documentationSource->setHintToolTip( tr("Documentation source.") );
_documentationSource->appendChoice(ChoiceOption("local",
tr("Local").toStdString(),
tr("Use the documentation distributed with the software.").toStdString()));
_documentationSource->appendChoice(ChoiceOption("online",
tr("Online").toStdString(),
tr("Use the online version of the documentation (requires an internet connection).").toStdString()));
_documentationSource->appendChoice(ChoiceOption("none",
tr("None").toStdString(),
tr("Disable documentation").toStdString()));
_documentationPage->addKnob(_documentationSource);
#endif
/// used to store temp port for local webserver
_wwwServerPort = AppManager::createKnob<KnobInt>( this, tr("Documentation local port (0=auto)") );
_wwwServerPort->setName("webserverPort");
_wwwServerPort->setHintToolTip( tr("The port onto which the documentation server will listen to. A value of 0 indicate that the documentation should automatically find a port by itself.") );
_documentationPage->addKnob(_wwwServerPort);
}
void
Settings::initializeKnobsUserInterface()
{
_uiPage = AppManager::createKnob<KnobPage>( this, tr("User Interface") );
_uiPage->setName("userInterfacePage");
_notifyOnFileChange = AppManager::createKnob<KnobBool>( this, tr("Warn when a file changes externally") );
_notifyOnFileChange->setName("warnOnExternalChange");
_notifyOnFileChange->setHintToolTip( tr("When checked, if a file read from a file parameter changes externally, a warning will be displayed "
"on the viewer. Turning this off will suspend the notification system.") );
_uiPage->addKnob(_notifyOnFileChange);
#ifdef NATRON_ENABLE_IO_META_NODES
_filedialogForWriters = AppManager::createKnob<KnobBool>( this, tr("Prompt with file dialog when creating Write node") );
_filedialogForWriters->setName("writeUseDialog");
_filedialogForWriters->setDefaultValue(true);
_filedialogForWriters->setHintToolTip( tr("When checked, opens-up a file dialog when creating a Write node") );
_uiPage->addKnob(_filedialogForWriters);
#endif
_renderOnEditingFinished = AppManager::createKnob<KnobBool>( this, tr("Refresh viewer only when editing is finished") );
_renderOnEditingFinished->setName("renderOnEditingFinished");
_renderOnEditingFinished->setHintToolTip( tr("When checked, the viewer triggers a new render only when mouse is released when editing parameters, curves "
" or the timeline. This setting doesn't apply to roto splines editing.") );
_uiPage->addKnob(_renderOnEditingFinished);
_linearPickers = AppManager::createKnob<KnobBool>( this, tr("Linear color pickers") );
_linearPickers->setName("linearPickers");
_linearPickers->setHintToolTip( tr("When activated, all colors picked from the color parameters are linearized "
"before being fetched. Otherwise they are in the same colorspace "
"as the viewer they were picked from.") );
_uiPage->addKnob(_linearPickers);
_maxPanelsOpened = AppManager::createKnob<KnobInt>( this, tr("Maximum number of open settings panels (0=\"unlimited\")") );
_maxPanelsOpened->setName("maxPanels");
_maxPanelsOpened->setHintToolTip( tr("This property holds the maximum number of settings panels that can be "
"held by the properties dock at the same time. "
"The special value of 0 indicates there can be an unlimited number of panels opened.") );
_maxPanelsOpened->disableSlider();
_maxPanelsOpened->setMinimum(0);
_maxPanelsOpened->setMaximum(99);
_uiPage->addKnob(_maxPanelsOpened);
_useCursorPositionIncrements = AppManager::createKnob<KnobBool>( this, tr("Value increments based on cursor position") );
_useCursorPositionIncrements->setName("cursorPositionAwareFields");
_useCursorPositionIncrements->setHintToolTip( tr("When enabled, incrementing the value fields of parameters with the "
"mouse wheel or with arrow keys will increment the digits on the right "
"of the cursor. \n"
"When disabled, the value fields are incremented given what the plug-in "
"decided it should be. You can alter this increment by holding "
"Shift (x10) or Control (/10) while incrementing.") );
_uiPage->addKnob(_useCursorPositionIncrements);
_defaultLayoutFile = AppManager::createKnob<KnobFile>( this, tr("Default layout file") );
_defaultLayoutFile->setName("defaultLayout");
_defaultLayoutFile->setHintToolTip( tr("When set, %1 uses the given layout file "
"as default layout for new projects. You can export/import a layout to/from a file "
"from the Layout menu. If empty, the default application layout is used.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_uiPage->addKnob(_defaultLayoutFile);
_loadProjectsWorkspace = AppManager::createKnob<KnobBool>( this, tr("Load workspace embedded within projects") );
_loadProjectsWorkspace->setName("loadProjectWorkspace");
_loadProjectsWorkspace->setHintToolTip( tr("When checked, when loading a project, the workspace (windows layout) will also be loaded, otherwise it "
"will use your current layout.") );
_uiPage->addKnob(_loadProjectsWorkspace);
#ifdef Q_OS_WIN
_enableConsoleWindow = AppManager::createKnob<KnobBool>( this, tr("Enable console window") );
_enableConsoleWindow->setName("enableConsoleWindow");
_enableConsoleWindow->setHintToolTip( tr("When checked show console window on Windows.") );
_uiPage->addKnob(_enableConsoleWindow);
#endif
} // Settings::initializeKnobsUserInterface
void
Settings::initializeKnobsColorManagement()
{
_ocioTab = AppManager::createKnob<KnobPage>( this, tr("Color Management") );
_ocioConfigKnob = AppManager::createKnob<KnobChoice>( this, tr("OpenColorIO configuration") );
_ocioConfigKnob->setName("ocioConfig");
std::vector<ChoiceOption> configs;
int defaultIndex = 0;
QStringList defaultOcioConfigsPaths = getDefaultOcioConfigPaths();
Q_FOREACH(const QString &defaultOcioConfigsDir, defaultOcioConfigsPaths) {
QDir ocioConfigsDir(defaultOcioConfigsDir);
if ( ocioConfigsDir.exists() ) {
QStringList entries = ocioConfigsDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
for (int j = 0; j < entries.size(); ++j) {
if ( entries[j] == QString::fromUtf8(NATRON_DEFAULT_OCIO_CONFIG_NAME) ) {
defaultIndex = j;
}
configs.push_back(ChoiceOption( entries[j].toStdString() ));
}
break; //if we found 1 OpenColorIO-Configs directory, skip the next
}
}
configs.push_back(ChoiceOption(NATRON_CUSTOM_OCIO_CONFIG_NAME));
_ocioConfigKnob->populateChoices(configs);
_ocioConfigKnob->setDefaultValue(defaultIndex, 0);
_ocioConfigKnob->setHintToolTip( tr("Select the OpenColorIO configuration you would like to use globally for all "
"operators and plugins that use OpenColorIO, by setting the \"OCIO\" "
"environment variable. Only nodes created after changing this parameter will take "
"it into account, and it is better to restart the application after changing it. "
"When \"%1\" is selected, the "
"\"Custom OpenColorIO config file\" parameter is used.").arg( QString::fromUtf8(NATRON_CUSTOM_OCIO_CONFIG_NAME) ) );
_ocioTab->addKnob(_ocioConfigKnob);
_customOcioConfigFile = AppManager::createKnob<KnobFile>( this, tr("Custom OpenColorIO configuration file") );
_customOcioConfigFile->setName("ocioCustomConfigFile");
if (_ocioConfigKnob->getNumEntries() == 1) {
_customOcioConfigFile->setDefaultAllDimensionsEnabled(true);
} else {
_customOcioConfigFile->setDefaultAllDimensionsEnabled(false);
}
_customOcioConfigFile->setHintToolTip( tr("OpenColorIO configuration file (config.ocio) to use when \"%1\" "
"is selected as the OpenColorIO config.").arg( QString::fromUtf8(NATRON_CUSTOM_OCIO_CONFIG_NAME) ) );
_ocioTab->addKnob(_customOcioConfigFile);
_warnOcioConfigKnobChanged = AppManager::createKnob<KnobBool>( this, tr("Warn on OpenColorIO config change") );
_warnOcioConfigKnobChanged->setName("warnOCIOChanged");
_warnOcioConfigKnobChanged->setHintToolTip( tr("Show a warning dialog when changing the OpenColorIO config to remember that a restart is required.") );
_ocioTab->addKnob(_warnOcioConfigKnobChanged);
_ocioStartupCheck = AppManager::createKnob<KnobBool>( this, tr("Warn on startup if OpenColorIO config is not the default") );
_ocioStartupCheck->setName("startupCheckOCIO");
_ocioTab->addKnob(_ocioStartupCheck);
} // Settings::initializeKnobsColorManagement
void
Settings::initializeKnobsAppearance()
{
//////////////APPEARANCE TAB/////////////////
_appearanceTab = AppManager::createKnob<KnobPage>( this, tr("Appearance") );
_defaultAppearanceVersion = AppManager::createKnob<KnobInt>( this, tr("Appearance version") );
_defaultAppearanceVersion->setName("appearanceVersion");
_defaultAppearanceVersion->setSecretByDefault(true);
_appearanceTab->addKnob(_defaultAppearanceVersion);
_systemFontChoice = AppManager::createKnob<KnobChoice>( this, tr("Font") );
_systemFontChoice->setHintToolTip( tr("List of all fonts available on your system") );
_systemFontChoice->setName("systemFont");
_systemFontChoice->setAddNewLine(false);
_appearanceTab->addKnob(_systemFontChoice);
_fontSize = AppManager::createKnob<KnobInt>( this, tr("Font size") );
_fontSize->setName("fontSize");
_appearanceTab->addKnob(_fontSize);
_qssFile = AppManager::createKnob<KnobFile>( this, tr("Stylesheet file (.qss)") );
_qssFile->setName("stylesheetFile");
_qssFile->setHintToolTip( tr("When pointing to a valid .qss file, the stylesheet of the application will be set according to this file instead of the default "
"stylesheet. You can adapt the default stylesheet that can be found in your distribution of %1.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) );
_appearanceTab->addKnob(_qssFile);
} // Settings::initializeKnobsAppearance
void
Settings::initializeKnobsGuiColors()
{
_guiColorsTab = AppManager::createKnob<KnobPage>( this, tr("Main Window") );
_appearanceTab->addKnob(_guiColorsTab);
_useBWIcons = AppManager::createKnob<KnobBool>( this, tr("Use black & white toolbutton icons") );
_useBWIcons->setName("useBwIcons");
_useBWIcons->setHintToolTip( tr("When checked, the tools icons in the left toolbar are greyscale. Changing this takes "
"effect upon the next launch of the application.") );
_guiColorsTab->addKnob(_useBWIcons);
_sunkenColor = AppManager::createKnob<KnobColor>(this, tr("Sunken"), 3);
_sunkenColor->setName("sunken");
_sunkenColor->setSimplified(true);
_guiColorsTab->addKnob(_sunkenColor);
_baseColor = AppManager::createKnob<KnobColor>(this, tr("Base"), 3);
_baseColor->setName("base");
_baseColor->setSimplified(true);
_guiColorsTab->addKnob(_baseColor);
_raisedColor = AppManager::createKnob<KnobColor>(this, tr("Raised"), 3);
_raisedColor->setName("raised");
_raisedColor->setSimplified(true);
_guiColorsTab->addKnob(_raisedColor);
_selectionColor = AppManager::createKnob<KnobColor>(this, tr("Selection"), 3);
_selectionColor->setName("selection");
_selectionColor->setSimplified(true);
_guiColorsTab->addKnob(_selectionColor);
_textColor = AppManager::createKnob<KnobColor>(this, tr("Text"), 3);
_textColor->setName("text");
_textColor->setSimplified(true);
_guiColorsTab->addKnob(_textColor);
_altTextColor = AppManager::createKnob<KnobColor>(this, tr("Unmodified text"), 3);
_altTextColor->setName("unmodifiedText");
_altTextColor->setSimplified(true);
_guiColorsTab->addKnob(_altTextColor);
_timelinePlayheadColor = AppManager::createKnob<KnobColor>(this, tr("Timeline playhead"), 3);
_timelinePlayheadColor->setName("timelinePlayhead");
_timelinePlayheadColor->setSimplified(true);
_guiColorsTab->addKnob(_timelinePlayheadColor);
_timelineBGColor = AppManager::createKnob<KnobColor>(this, tr("Timeline background"), 3);
_timelineBGColor->setName("timelineBG");
_timelineBGColor->setSimplified(true);
_guiColorsTab->addKnob(_timelineBGColor);
_timelineBoundsColor = AppManager::createKnob<KnobColor>(this, tr("Timeline bounds"), 3);
_timelineBoundsColor->setName("timelineBound");
_timelineBoundsColor->setSimplified(true);
_guiColorsTab->addKnob(_timelineBoundsColor);
_cachedFrameColor = AppManager::createKnob<KnobColor>(this, tr("Cached frame"), 3);
_cachedFrameColor->setName("cachedFrame");
_cachedFrameColor->setSimplified(true);
_guiColorsTab->addKnob(_cachedFrameColor);
_diskCachedFrameColor = AppManager::createKnob<KnobColor>(this, tr("Disk cached frame"), 3);
_diskCachedFrameColor->setName("diskCachedFrame");
_diskCachedFrameColor->setSimplified(true);
_guiColorsTab->addKnob(_diskCachedFrameColor);
_interpolatedColor = AppManager::createKnob<KnobColor>(this, tr("Interpolated value"), 3);
_interpolatedColor->setName("interpValue");
_interpolatedColor->setSimplified(true);
_guiColorsTab->addKnob(_interpolatedColor);
_keyframeColor = AppManager::createKnob<KnobColor>(this, tr("Keyframe"), 3);
_keyframeColor->setName("keyframe");
_keyframeColor->setSimplified(true);
_guiColorsTab->addKnob(_keyframeColor);
_trackerKeyframeColor = AppManager::createKnob<KnobColor>(this, tr("Track User Keyframes"), 3);
_trackerKeyframeColor->setName("trackUserKeyframe");
_trackerKeyframeColor->setSimplified(true);
_guiColorsTab->addKnob(_trackerKeyframeColor);
_exprColor = AppManager::createKnob<KnobColor>(this, tr("Expression"), 3);
_exprColor->setName("exprColor");
_exprColor->setSimplified(true);
_guiColorsTab->addKnob(_exprColor);
_sliderColor = AppManager::createKnob<KnobColor>(this, tr("Slider"), 3);
_sliderColor->setName("slider");
_sliderColor->setSimplified(true);
_guiColorsTab->addKnob(_sliderColor);
} // Settings::initializeKnobsGuiColors
void
Settings::initializeKnobsCurveEditorColors()
{
_curveEditorColorsTab = AppManager::createKnob<KnobPage>( this, tr("Curve Editor") );
_appearanceTab->addKnob(_curveEditorColorsTab);
_curveEditorBGColor = AppManager::createKnob<KnobColor>(this, tr("Background color"), 3);
_curveEditorBGColor->setName("curveEditorBG");
_curveEditorBGColor->setSimplified(true);
_curveEditorColorsTab->addKnob(_curveEditorBGColor);
_gridColor = AppManager::createKnob<KnobColor>(this, tr("Grid color"), 3);
_gridColor->setName("curveditorGrid");
_gridColor->setSimplified(true);
_curveEditorColorsTab->addKnob(_gridColor);
_curveEditorScaleColor = AppManager::createKnob<KnobColor>(this, tr("Scale color"), 3);
_curveEditorScaleColor->setName("curveeditorScale");
_curveEditorScaleColor->setSimplified(true);
_curveEditorColorsTab->addKnob(_curveEditorScaleColor);
}
void
Settings::initializeKnobsDopeSheetColors()
{
_dopeSheetEditorColorsTab = AppManager::createKnob<KnobPage>( this, tr("Dope Sheet") );
_appearanceTab->addKnob(_dopeSheetEditorColorsTab);
_dopeSheetEditorBackgroundColor = AppManager::createKnob<KnobColor>(this, tr("Sheet background color"), 3);
_dopeSheetEditorBackgroundColor->setName("dopesheetBackground");
_dopeSheetEditorBackgroundColor->setSimplified(true);
_dopeSheetEditorColorsTab->addKnob(_dopeSheetEditorBackgroundColor);
_dopeSheetEditorRootSectionBackgroundColor = AppManager::createKnob<KnobColor>(this, tr("Root section background color"), 4);
_dopeSheetEditorRootSectionBackgroundColor->setName("dopesheetRootSectionBackground");
_dopeSheetEditorRootSectionBackgroundColor->setSimplified(true);
_dopeSheetEditorColorsTab->addKnob(_dopeSheetEditorRootSectionBackgroundColor);
_dopeSheetEditorKnobSectionBackgroundColor = AppManager::createKnob<KnobColor>(this, tr("Knob section background color"), 4);
_dopeSheetEditorKnobSectionBackgroundColor->setName("dopesheetKnobSectionBackground");
_dopeSheetEditorKnobSectionBackgroundColor->setSimplified(true);
_dopeSheetEditorColorsTab->addKnob(_dopeSheetEditorKnobSectionBackgroundColor);
_dopeSheetEditorScaleColor = AppManager::createKnob<KnobColor>(this, tr("Sheet scale color"), 3);
_dopeSheetEditorScaleColor->setName("dopesheetScale");
_dopeSheetEditorScaleColor->setSimplified(true);
_dopeSheetEditorColorsTab->addKnob(_dopeSheetEditorScaleColor);
_dopeSheetEditorGridColor = AppManager::createKnob<KnobColor>(this, tr("Sheet grid color"), 3);
_dopeSheetEditorGridColor->setName("dopesheetGrid");
_dopeSheetEditorGridColor->setSimplified(true);
_dopeSheetEditorColorsTab->addKnob(_dopeSheetEditorGridColor);
}
void
Settings::initializeKnobsNodeGraphColors()
{
_nodegraphColorsTab = AppManager::createKnob<KnobPage>( this, tr("Node Graph") );
_appearanceTab->addKnob(_nodegraphColorsTab);
_usePluginIconsInNodeGraph = AppManager::createKnob<KnobBool>( this, tr("Display plug-in icon on node-graph") );
_usePluginIconsInNodeGraph->setName("usePluginIcons");
_usePluginIconsInNodeGraph->setHintToolTip( tr("When checked, each node that has a plug-in icon will display it in the node-graph. "
"Changing this option will not affect already existing nodes, unless a restart of Natron is made.") );
_usePluginIconsInNodeGraph->setAddNewLine(false);
_nodegraphColorsTab->addKnob(_usePluginIconsInNodeGraph);
_useAntiAliasing = AppManager::createKnob<KnobBool>( this, tr("Anti-Aliasing") );
_useAntiAliasing->setName("antiAliasing");
_useAntiAliasing->setHintToolTip( tr("When checked, the node graph will be painted using anti-aliasing. Unchecking it may increase performance. "
" Changing this requires a restart of Natron") );
_nodegraphColorsTab->addKnob(_useAntiAliasing);
_defaultNodeColor = AppManager::createKnob<KnobColor>(this, tr("Default node color"), 3);
_defaultNodeColor->setName("defaultNodeColor");
_defaultNodeColor->setSimplified(true);
_defaultNodeColor->setHintToolTip( tr("The default color used for newly created nodes.") );
_nodegraphColorsTab->addKnob(_defaultNodeColor);
_defaultBackdropColor = AppManager::createKnob<KnobColor>(this, tr("Default backdrop color"), 3);
_defaultBackdropColor->setName("backdropColor");
_defaultBackdropColor->setSimplified(true);
_defaultBackdropColor->setHintToolTip( tr("The default color used for newly created backdrop nodes.") );
_nodegraphColorsTab->addKnob(_defaultBackdropColor);
_defaultReaderColor = AppManager::createKnob<KnobColor>(this, tr(PLUGIN_GROUP_IMAGE_READERS), 3);
_defaultReaderColor->setName("readerColor");
_defaultReaderColor->setSimplified(true);
_defaultReaderColor->setHintToolTip( tr("The color used for newly created Reader nodes.") );
_nodegraphColorsTab->addKnob(_defaultReaderColor);
_defaultWriterColor = AppManager::createKnob<KnobColor>(this, tr(PLUGIN_GROUP_IMAGE_WRITERS), 3);
_defaultWriterColor->setName("writerColor");
_defaultWriterColor->setSimplified(true);
_defaultWriterColor->setHintToolTip( tr("The color used for newly created Writer nodes.") );
_nodegraphColorsTab->addKnob(_defaultWriterColor);
_defaultGeneratorColor = AppManager::createKnob<KnobColor>(this, tr("Generators"), 3);
_defaultGeneratorColor->setName("generatorColor");
_defaultGeneratorColor->setSimplified(true);
_defaultGeneratorColor->setHintToolTip( tr("The color used for newly created Generator nodes.") );
_nodegraphColorsTab->addKnob(_defaultGeneratorColor);
_defaultColorGroupColor = AppManager::createKnob<KnobColor>(this, tr("Color group"), 3);
_defaultColorGroupColor->setName("colorNodesColor");
_defaultColorGroupColor->setSimplified(true);
_defaultColorGroupColor->setHintToolTip( tr("The color used for newly created Color nodes.") );
_nodegraphColorsTab->addKnob(_defaultColorGroupColor);
_defaultFilterGroupColor = AppManager::createKnob<KnobColor>(this, tr("Filter group"), 3);
_defaultFilterGroupColor->setName("filterNodesColor");
_defaultFilterGroupColor->setSimplified(true);
_defaultFilterGroupColor->setHintToolTip( tr("The color used for newly created Filter nodes.") );
_nodegraphColorsTab->addKnob(_defaultFilterGroupColor);
_defaultTransformGroupColor = AppManager::createKnob<KnobColor>(this, tr("Transform group"), 3);
_defaultTransformGroupColor->setName("transformNodesColor");
_defaultTransformGroupColor->setSimplified(true);
_defaultTransformGroupColor->setHintToolTip( tr("The color used for newly created Transform nodes.") );
_nodegraphColorsTab->addKnob(_defaultTransformGroupColor);
_defaultTimeGroupColor = AppManager::createKnob<KnobColor>(this, tr("Time group"), 3);
_defaultTimeGroupColor->setName("timeNodesColor");
_defaultTimeGroupColor->setSimplified(true);
_defaultTimeGroupColor->setHintToolTip( tr("The color used for newly created Time nodes.") );
_nodegraphColorsTab->addKnob(_defaultTimeGroupColor);
_defaultDrawGroupColor = AppManager::createKnob<KnobColor>(this, tr("Draw group"), 3);
_defaultDrawGroupColor->setName("drawNodesColor");
_defaultDrawGroupColor->setSimplified(true);
_defaultDrawGroupColor->setHintToolTip( tr("The color used for newly created Draw nodes.") );
_nodegraphColorsTab->addKnob(_defaultDrawGroupColor);
_defaultKeyerGroupColor = AppManager::createKnob<KnobColor>(this, tr("Keyer group"), 3);
_defaultKeyerGroupColor->setName("keyerNodesColor");
_defaultKeyerGroupColor->setSimplified(true);
_defaultKeyerGroupColor->setHintToolTip( tr("The color used for newly created Keyer nodes.") );
_nodegraphColorsTab->addKnob(_defaultKeyerGroupColor);
_defaultChannelGroupColor = AppManager::createKnob<KnobColor>(this, tr("Channel group"), 3);
_defaultChannelGroupColor->setName("channelNodesColor");
_defaultChannelGroupColor->setSimplified(true);
_defaultChannelGroupColor->setHintToolTip( tr("The color used for newly created Channel nodes.") );
_nodegraphColorsTab->addKnob(_defaultChannelGroupColor);
_defaultMergeGroupColor = AppManager::createKnob<KnobColor>(this, tr("Merge group"), 3);
_defaultMergeGroupColor->setName("defaultMergeColor");
_defaultMergeGroupColor->setSimplified(true);
_defaultMergeGroupColor->setHintToolTip( tr("The color used for newly created Merge nodes.") );
_nodegraphColorsTab->addKnob(_defaultMergeGroupColor);
_defaultViewsGroupColor = AppManager::createKnob<KnobColor>(this, tr("Views group"), 3);
_defaultViewsGroupColor->setName("defaultViewsColor");
_defaultViewsGroupColor->setSimplified(true);
_defaultViewsGroupColor->setHintToolTip( tr("The color used for newly created Views nodes.") );
_nodegraphColorsTab->addKnob(_defaultViewsGroupColor);
_defaultDeepGroupColor = AppManager::createKnob<KnobColor>(this, tr("Deep group"), 3);
_defaultDeepGroupColor->setName("defaultDeepColor");
_defaultDeepGroupColor->setSimplified(true);
_defaultDeepGroupColor->setHintToolTip( tr("The color used for newly created Deep nodes.") );
_nodegraphColorsTab->addKnob(_defaultDeepGroupColor);
} // Settings::initializeKnobsNodeGraphColors
void
Settings::initializeKnobsScriptEditorColors()
{
_scriptEditorColorsTab = AppManager::createKnob<KnobPage>( this, tr("Script Editor") );
_scriptEditorColorsTab->setParentKnob(_appearanceTab);
_scriptEditorFontChoice = AppManager::createKnob<KnobChoice>( this, tr("Font") );
_scriptEditorFontChoice->setHintToolTip( tr("List of all fonts available on your system") );
_scriptEditorFontChoice->setName("scriptEditorFont");
_scriptEditorColorsTab->addKnob(_scriptEditorFontChoice);
_scriptEditorFontSize = AppManager::createKnob<KnobInt>( this, tr("Font Size") );
_scriptEditorFontSize->setHintToolTip( tr("The font size") );
_scriptEditorFontSize->setName("scriptEditorFontSize");
_scriptEditorColorsTab->addKnob(_scriptEditorFontSize);
_curLineColor = AppManager::createKnob<KnobColor>(this, tr("Current Line Color"), 3);
_curLineColor->setName("currentLineColor");
_curLineColor->setSimplified(true);
_scriptEditorColorsTab->addKnob(_curLineColor);