This repository was archived by the owner on Mar 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInit.py
More file actions
77 lines (65 loc) · 4.62 KB
/
Init.py
File metadata and controls
77 lines (65 loc) · 4.62 KB
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
# SPDX-License-Identifier: MIT
# ***************************************************************************
# * *
# * Copyright (c) 2023 2023 Ondsel, Inc. *
# * *
# * This file is part of Ondsel Preference Pack *
# * *
# * See LICENSE file for details about copyright. *
# * *
# ***************************************************************************
import platform
import FreeCAD as App
params = App.ParamGet('User parameter:BaseApp')
if not params.GetGroup('Ondsel/mods/AssemblyWorkbench').GetBool('firstForceEnableDone', False):
disabledWBs = params.GetGroup('Preferences/Workbenches').GetString('Disabled')
if disabledWBs.__contains__('AssemblyWorkbench'):
disabledWBs = disabledWBs.split(',')
disabledWBs.remove('AssemblyWorkbench')
disabledWBs = ','.join(disabledWBs)
params.GetGroup('Preferences/Workbenches').SetString('Disabled',disabledWBs)
params.GetGroup('Preferences/Workbenches').RemString('Ordered')
params.GetGroup('Ondsel/mods/AssemblyWorkbench').SetBool('firstForceEnableDone', True)
App.Console.PrintLog('Force enabled AssemblyWorkbench')
if not params.GetGroup('Ondsel/mods/Assembly').GetBool('firstEnableExperimental', False):
params.GetGroup('Preferences/Mod/Assembly').SetBool('ExperimentalFeatures',True)
params.GetGroup('Ondsel/mods/Assembly').SetBool('firstEnableExperimental', True)
if not params.GetGroup('Ondsel/mods/ArchWorkbench').GetBool('firstForceDisableDone', False):
disabledWBs = params.GetGroup('Preferences/Workbenches').GetString('Disabled')
if not disabledWBs.__contains__('ArchWorkbench'):
disabledWBs = disabledWBs.split(',')
disabledWBs.append('ArchWorkbench')
disabledWBs = ','.join(disabledWBs)
params.GetGroup('Preferences/Workbenches').SetString('Disabled',disabledWBs)
params.GetGroup('Preferences/Workbenches').RemString('Ordered')
params.GetGroup('Ondsel/mods/ArchWorkbench').SetBool('firstForceDisableDone', True)
App.Console.PrintLog('Force disabled ArchWorkbench')
if not params.GetGroup('Ondsel/mods/Websites').GetBool('firstForceClean', False):
params.GetGroup('Preferences').RemGroup('Websites')
params.GetGroup('Ondsel/mods/Websites').SetBool('firstForceClean', True)
if not params.GetGroup('Ondsel/mods/TechDraw').GetBool('firstForceEnableSingleDimension', False):
params.GetGroup('Preferences/Mod/TechDraw').SetBool('SingleDimensioningTool',True)
params.GetGroup('Preferences/Mod/TechDraw').SetBool('SeparatedDimensioningTools',False)
params.GetGroup('Ondsel/mods/TechDraw').SetBool('firstForceEnableSingleDimension', True)
if not params.GetGroup('Ondsel/mods/AddonManager').GetBool('firstSetScoreUrl', False):
params.GetGroup('Preferences/Addons').SetString('AddonsScoreURL',"https://ondsel.com/RecommendedAddons.json")
params.GetGroup('Ondsel/mods/AddonManager').SetBool('firstSetScoreUrl', True)
if not params.GetGroup('Ondsel').GetBool('firstUnSetHeadlightPrefs', False):
if params.GetGroup('Preferences/View').GetInt('HeadlightIntensity') == 80:
params.GetGroup('Preferences/View').RemInt('HeadlightIntensity')
if params.GetGroup('Preferences/View').GetString('HeadlightDirection') == '(-0.00994448,0.318473,-0.94788)':
params.GetGroup('Preferences/View').RemString('HeadlightDirection')
params.GetGroup('Preferences/View').RemFloat('HeadlightRotationX')
params.GetGroup('Preferences/View').RemFloat('HeadlightRotationY')
params.GetGroup('Preferences/View').RemFloat('HeadlightRotationZ')
params.GetGroup('Preferences/View').RemFloat('HeadlightRotationW')
params.GetGroup('Ondsel').SetBool('firstUnSetHeadlightPrefs', True)
if not params.GetGroup('Ondsel').GetBool('firstSet_WorkbenchSelectorType', False):
params.GetGroup('Preferences/Workbenches').SetInt('WorkbenchSelectorType', 1)
if params.GetGroup('Preferences/MainWindow').GetString('WSPosition') != 'WSToolbar':
params.GetGroup('Preferences/MainWindow').SetString('WSPosition','WSToolbar')
params.GetGroup('Ondsel').SetBool('firstSet_WorkbenchSelectorType', True)
if not params.GetGroup('Ondsel').GetBool('firstSetQtStyle', False):
params.GetGroup('Preferences/General').SetString('QtStyle', 'Fusion')
params.GetGroup('Ondsel').SetBool('firstSetQtStyle', True)
App.saveParameter()