forked from cgtoolbox/HoudiniEasyCompileBlock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OPmenu.xml
87 lines (84 loc) · 2.49 KB
/
OPmenu.xml
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
<menuDocument>
<!-- menuDocument can only contain 1 menu element, whose id is
implicitly "root_menu"
-->
<menu>
<subMenu id="houdini_easy_compile_block_menu">
<label>Easy Compile</label>
<context>
<expression>
<![CDATA[
try:
from HoudiniEasyCompileBlock import houdini_easy_compile_block
reload(houdini_easy_compile_block)
return houdini_easy_compile_block.is_valid_forloop_compilation(kwargs["node"]) or \
len(hou.selectedNodes()) > 1
except Exception as e:
return False]]>
</expression>
</context>
<scriptItem id="houdini_easy_compile_block">
<label>Compile For loop</label>
<context>
<expression>
<![CDATA[
try:
from HoudiniEasyCompileBlock import houdini_easy_compile_block
reload(houdini_easy_compile_block)
return houdini_easy_compile_block.is_valid_forloop_compilation(kwargs["node"])
except Exception as e:
return False]]>
</expression>
</context>
<scriptCode>
<![CDATA[
from HoudiniEasyCompileBlock import houdini_easy_compile_block
reload(houdini_easy_compile_block)
houdini_easy_compile_block.compile_forloop(node=kwargs["node"])
]]>
</scriptCode>
</scriptItem>
<scriptItem id="houdini_easy_compile_block_selection">
<label>Compile Node Selection</label>
<context>
<expression>
<![CDATA[
try:
import hou
return len(hou.selectedNodes()) > 1
except Exception as e:
return False]]>
</expression>
</context>
<scriptCode>
<![CDATA[
from HoudiniEasyCompileBlock import houdini_easy_compile_block
reload(houdini_easy_compile_block)
houdini_easy_compile_block.compile_selection()
]]>
</scriptCode>
</scriptItem>
<scriptItem id="houdini_easy_compile_updade_node">
<label>Easy Compile Block: Update Node</label>
<context>
<expression>
<![CDATA[
try:
from HoudiniEasyCompileBlock import houdini_easy_compile_block
reload(houdini_easy_compile_block)
return houdini_easy_compile_block.is_valid_for_node_update(node=kwargs["node"])
except Exception as e:
return False]]>
</expression>
</context>
<scriptCode>
<![CDATA[
from HoudiniEasyCompileBlock import houdini_easy_compile_block
reload(houdini_easy_compile_block)
houdini_easy_compile_block.update_selected_node(node=kwargs["node"])
]]>
</scriptCode>
</scriptItem>
</subMenu>
</menu>
</menuDocument>