1
2 """module with option implementations, to be shown in finder layouts"""
3 __docformat__ = "restructuredtext"
4
5 from interface import iOptions
6 import mrv.maya.ui as ui
7 import mrv.maya
8 import mrv.maya.util
9 Mel = mrv.maya.Mel
10 opts = mrv.maya.util.optionvars
11
13 """Options implementation providing options useful during file-open"""
14
15
16 kOVExecuteScriptNodes = 'fileExecuteSN'
17 kOVIgnoreVersion = 'fileOpenIgnoreVersion'
18 kOVSelectivePreload = 'fileSelPreload'
19 kOVRefLoadSetting = 'fileOpenRefLoadSetting'
20
21
25
27 self.cbScriptNodes = ui.CheckBox(label="Execute ScriptNodes", value=1)
28 self.cbIgnoreVersion = ui.CheckBox(label="Ignore Version")
29
30 self.omReference = ui.OptionMenu(label="Load Settings")
31
32 ui.MenuItem(label="Load Default References")
33 ui.MenuItem(label="Load All References")
34 ui.MenuItem(label="Load Top References")
35 ui.MenuItem(label="Load No References")
36
37 self.cbSelectivePreload = ui.CheckBox(label="Selective Preload")
38
44
46 """:return: dict with keyword options reflecting the settings of the
47 interface. These should be given to the file command"""
48 options = dict()
49 options['ignoreVersion'] = self.cbIgnoreVersion.p_value
50 options['executeScriptNodes'] = self.cbScriptNodes.p_value
51
52
53
54
55 refsl = self.omReference.p_sl
56 if refsl == 2:
57 options['loadAllReferences'] = True
58 elif refsl == 3:
59 options['loadReferenceDepth'] = "topOnly"
60 elif refsl == 4:
61 options['loadNoReferences'] = True
62
63 return options
64