|
3 | 3 | import shlex |
4 | 4 |
|
5 | 5 | from .computation import Level, StaticNodeSize |
6 | | -from .attribute import StringParam, ColorParam |
| 6 | +from .attribute import StringParam, ColorParam, FloatParam, IntParam |
7 | 7 |
|
8 | 8 | from meshroom.core import cgroup |
9 | 9 |
|
@@ -122,6 +122,68 @@ def __init__(self): |
122 | 122 | def processChunk(self, chunk): |
123 | 123 | pass |
124 | 124 |
|
| 125 | + def stopProcess(self, chunk): |
| 126 | + pass |
| 127 | + |
| 128 | + |
| 129 | +class Backdrop(InputNode): |
| 130 | + """ A Backdrop for other nodes. |
| 131 | + """ |
| 132 | + |
| 133 | + # The internal inputs' of Backdrop Node needs a Integer Field to determine the font size for the comment |
| 134 | + internalInputs = [ |
| 135 | + StringParam( |
| 136 | + name="invalidation", |
| 137 | + label="Invalidation Message", |
| 138 | + description="A message that will invalidate the node's output folder.\n" |
| 139 | + "This is useful for development, we can invalidate the output of the node when we modify the code.\n" |
| 140 | + "It is displayed in bold font in the invalidation/comment messages tooltip.", |
| 141 | + value="", |
| 142 | + semantic="multiline", |
| 143 | + advanced=True, |
| 144 | + uidIgnoreValue="", # If the invalidation string is empty, it does not participate to the node's UID |
| 145 | + ), |
| 146 | + StringParam( |
| 147 | + name="comment", |
| 148 | + label="Comments", |
| 149 | + description="User comments describing this specific node instance.\n" |
| 150 | + "It is displayed in regular font in the invalidation/comment messages tooltip.", |
| 151 | + value="", |
| 152 | + semantic="multiline", |
| 153 | + invalidate=False, |
| 154 | + ), |
| 155 | + IntParam( |
| 156 | + name="fontSize", |
| 157 | + label="Font Size", |
| 158 | + description="The Font size for the User Comment on the Backdrop.", |
| 159 | + value=12, |
| 160 | + range=(6, 100, 1), |
| 161 | + ), |
| 162 | + FloatParam( |
| 163 | + name="nodeWidth", |
| 164 | + label="Node Width", |
| 165 | + description="The Backdrop Node's Width.", |
| 166 | + value=600, |
| 167 | + range=None, |
| 168 | + enabled=False # Hidden always |
| 169 | + ), |
| 170 | + FloatParam( |
| 171 | + name="nodeHeight", |
| 172 | + label="Node Height", |
| 173 | + description="The Backdrop Node's Height.", |
| 174 | + value=400, |
| 175 | + range=None, |
| 176 | + enabled=False # Hidden always |
| 177 | + ), |
| 178 | + ColorParam( |
| 179 | + name="color", |
| 180 | + label="Color", |
| 181 | + description="Custom color for the node (SVG name or hexadecimal code).", |
| 182 | + value="", |
| 183 | + invalidate=False, |
| 184 | + ) |
| 185 | + ] |
| 186 | + |
125 | 187 |
|
126 | 188 | class CommandLineNode(Node): |
127 | 189 | """ |
|
0 commit comments