-
Notifications
You must be signed in to change notification settings - Fork 2
/
zync_c4d_arnold_settings.py
49 lines (38 loc) · 1.4 KB
/
zync_c4d_arnold_settings.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
"""" Contains C4dArnoldSettings class. """
from importlib import import_module
import zync_c4d_constants
import zync_c4d_utils
zync_threading = zync_c4d_utils.import_zync_module('zync_threading')
main_thread = zync_threading.MainThreadCaller.main_thread
c4d = import_module('c4d')
class C4dArnoldSettings(zync_threading.MainThreadCaller):
"""
Implements Arnold-specific operations.
:param zync_threading.MainThreadExecutor main_thread_executor:
:param c4d.documents.BaseVideoPost video_post:
:param c4d.documents.BaseDocument document:
"""
def __init__(self, main_thread_executor, video_post, document):
zync_threading.MainThreadCaller.__init__(self, main_thread_executor)
self._video_post = video_post
self._document = document
@main_thread
def is_skip_license_check_enabled(self):
"""
Checks if license check is enabled.
:return bool:
"""
return self._video_post[c4d.C4DAIP_OPTIONS_SKIP_LICENSE_CHECK]
@main_thread
def get_version(self):
"""
Returns C4DtoA version.
:return str:
"""
arnold_hook = self._document.FindSceneHook(zync_c4d_constants.ARNOLD_SCENE_HOOK)
if arnold_hook is None:
return ""
msg = c4d.BaseContainer()
msg.SetInt32(zync_c4d_constants.C4DTOA_MSG_TYPE, zync_c4d_constants.C4DTOA_MSG_GET_VERSION)
arnold_hook.Message(c4d.MSG_BASECONTAINER, msg)
return msg.GetString(zync_c4d_constants.C4DTOA_MSG_RESP1)