Skip to content

create_plugins

CreateWriteImageModel

Bases: DefaultPluginModel

Source code in server/settings/create_plugins.py
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
class CreateWriteImageModel(DefaultPluginModel):
    temp_rendering_path_template: str = SettingsField(
        title="Temporary rendering path template"
    )
    default_variants: list[str] = SettingsField(
        title="Default variants",
        default_factory=list
    )
    instance_attributes: list[str] = SettingsField(
        default_factory=list,
        enum_resolver=instance_attributes_enum,
        title="Instance attributes"
    )
    conditional_reviewable: ConditionalReviewableModel = SettingsField(
        default_factory=ConditionalReviewableModel,
        title="Conditional Reviewable Profiles",
        description=DISABLE_REVIEW_TOGGLE_DESCRIPTION,
        conditional_enum=True,
    )
    render_target: str = SettingsField(
        enum_resolver=render_target_enum,
        conditional_enum=True,
        title="Render target",
        description=RENDER_TARGET_DESCRIPTION,
    )
    exposed_knobs: list[str] = SettingsField(
        title="Write Node Exposed Knobs",
        default_factory=list
    )
    prenodes: list[PrenodeModel] = SettingsField(
        default_factory=list,
        title="Preceding nodes",
        description=PRENODES_LIST_DESCRIPTION,
    )

    @validator("prenodes")
    def ensure_unique_names(cls, value):
        """Ensure name fields within the lists have unique names."""
        ensure_unique_names(value)
        return value

    @validator("instance_attributes")
    def validate_instance_attributes(cls, value):
        """Ensure reviewable and conditional_reviewable are exclusive."""
        return validate_instance_attributes(value)

ensure_unique_names(value)

Ensure name fields within the lists have unique names.

Source code in server/settings/create_plugins.py
279
280
281
282
283
@validator("prenodes")
def ensure_unique_names(cls, value):
    """Ensure name fields within the lists have unique names."""
    ensure_unique_names(value)
    return value

validate_instance_attributes(value)

Ensure reviewable and conditional_reviewable are exclusive.

Source code in server/settings/create_plugins.py
285
286
287
288
@validator("instance_attributes")
def validate_instance_attributes(cls, value):
    """Ensure reviewable and conditional_reviewable are exclusive."""
    return validate_instance_attributes(value)

CreateWritePrerenderModel

Bases: DefaultPluginModel

Source code in server/settings/create_plugins.py
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
class CreateWritePrerenderModel(DefaultPluginModel):
    temp_rendering_path_template: str = SettingsField(
        title="Temporary rendering path template"
    )
    default_variants: list[str] = SettingsField(
        title="Default variants",
        default_factory=list
    )
    instance_attributes: list[str] = SettingsField(
        default_factory=list,
        enum_resolver=instance_attributes_enum,
        title="Instance attributes",
        description = INSTANCE_ATTRIBUTES_DESCRIPTION
    )
    conditional_reviewable: ConditionalReviewableModel = SettingsField(
        default_factory=ConditionalReviewableModel,
        title="Conditional Reviewable Profiles",
        description=DISABLE_REVIEW_TOGGLE_DESCRIPTION,
        conditional_enum=True,
    )
    render_target: str = SettingsField(
        enum_resolver=render_target_enum,
        conditional_enum=True,
        title="Render target",
        description=RENDER_TARGET_DESCRIPTION,
    )
    exposed_knobs: list[str] = SettingsField(
        title="Write Node Exposed Knobs", default_factory=list
    )
    prenodes: list[PrenodeModel] = SettingsField(
        default_factory=list,
        title="Preceding nodes",
        description=PRENODES_LIST_DESCRIPTION,
    )

    @validator("prenodes")
    def ensure_unique_names(cls, value):
        """Ensure name fields within the lists have unique names."""
        ensure_unique_names(value)
        return value

    @validator("instance_attributes")
    def validate_instance_attributes(cls, value):
        """Ensure reviewable and conditional_reviewable are exclusive."""
        return validate_instance_attributes(value)

ensure_unique_names(value)

Ensure name fields within the lists have unique names.

Source code in server/settings/create_plugins.py
232
233
234
235
236
@validator("prenodes")
def ensure_unique_names(cls, value):
    """Ensure name fields within the lists have unique names."""
    ensure_unique_names(value)
    return value

validate_instance_attributes(value)

Ensure reviewable and conditional_reviewable are exclusive.

Source code in server/settings/create_plugins.py
238
239
240
241
@validator("instance_attributes")
def validate_instance_attributes(cls, value):
    """Ensure reviewable and conditional_reviewable are exclusive."""
    return validate_instance_attributes(value)

CreateWriteRenderModel

Bases: DefaultPluginModel

Source code in server/settings/create_plugins.py
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
class CreateWriteRenderModel(DefaultPluginModel):
    temp_rendering_path_template: str = SettingsField(
        title="Temporary rendering path template"
    )
    default_variants: list[str] = SettingsField(
        title="Default variants",
        default_factory=list
    )
    instance_attributes: list[str] = SettingsField(
        default_factory=list,
        enum_resolver=instance_attributes_enum,
        title="Instance attributes",
        description=INSTANCE_ATTRIBUTES_DESCRIPTION,
        conditional_enum=True,
    )
    conditional_reviewable: ConditionalReviewableModel = SettingsField(
        default_factory=ConditionalReviewableModel,
        title="Conditional Reviewable Profiles",
        description=DISABLE_REVIEW_TOGGLE_DESCRIPTION,
    )
    render_target: str = SettingsField(
        enum_resolver=render_target_enum,
        conditional_enum=True,
        title="Render target",
        description=RENDER_TARGET_DESCRIPTION,
    )
    exposed_knobs: list[str] = SettingsField(
        title="Write Node Exposed Knobs",
        default_factory=list
    )
    prenodes: list[PrenodeModel] = SettingsField(
        default_factory=list,
        title="Preceding nodes",
        description=PRENODES_LIST_DESCRIPTION
    )

    @validator("prenodes")
    def ensure_unique_names(cls, value):
        """Ensure name fields within the lists have unique names."""
        ensure_unique_names(value)
        return value

    @validator("instance_attributes")
    def validate_instance_attributes(cls, value):
        """Ensure reviewable and conditional_reviewable are exclusive."""
        return validate_instance_attributes(value)

ensure_unique_names(value)

Ensure name fields within the lists have unique names.

Source code in server/settings/create_plugins.py
185
186
187
188
189
@validator("prenodes")
def ensure_unique_names(cls, value):
    """Ensure name fields within the lists have unique names."""
    ensure_unique_names(value)
    return value

validate_instance_attributes(value)

Ensure reviewable and conditional_reviewable are exclusive.

Source code in server/settings/create_plugins.py
191
192
193
194
@validator("instance_attributes")
def validate_instance_attributes(cls, value):
    """Ensure reviewable and conditional_reviewable are exclusive."""
    return validate_instance_attributes(value)

PrenodeModel

Bases: BaseSettingsModel

Source code in server/settings/create_plugins.py
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
class PrenodeModel(BaseSettingsModel):
    name: str = SettingsField(
        title="Node name",
        description=(
            "Node name, use this as the name in 'Incoming dependency' on other"
            " preceding nodes if a connection is needed."
        )
    )
    nodeclass: str = SettingsField(
        "",
        title="Node class",
        description="Nuke node class (type) of the node to add."
    )
    dependent: str = SettingsField(
        "",
        title="Incoming dependency",
        description=(
            "Input node name of another preceding node that should"
            "come before this node."
        ),
    )
    knobs: list[KnobModel] = SettingsField(
        default_factory=list,
        title="Knobs",
    )

    @validator("knobs")
    def ensure_unique_names(cls, value):
        """Ensure name fields within the lists have unique names."""
        ensure_unique_names(value)
        return value

ensure_unique_names(value)

Ensure name fields within the lists have unique names.

Source code in server/settings/create_plugins.py
113
114
115
116
117
@validator("knobs")
def ensure_unique_names(cls, value):
    """Ensure name fields within the lists have unique names."""
    ensure_unique_names(value)
    return value

instance_attributes_enum()

Return create write instance attributes.

Source code in server/settings/create_plugins.py
57
58
59
60
61
62
63
64
65
66
def instance_attributes_enum():
    """Return create write instance attributes."""
    return [
        {"value": "reviewable", "label": "Reviewable"},
        {"value": "farm_rendering", "label": "Farm rendering"},
        {"value": "use_range_limit", "label": "Use range limit"},
        {"value": "render_on_farm", "label": "Render On Farm"},
        {"value": "slate_gen", "label": "Slate Generation"},
        {"value": "conditional_reviewable", "label": "Conditional Reviewable"}
    ]

render_target_enum()

Return write render target enum.

Source code in server/settings/create_plugins.py
69
70
71
72
73
74
75
76
def render_target_enum():
    """Return write render target enum."""
    return [
        {"value": "local", "label": "Local machine rendering"},
        {"value": "frames", "label": "Use existing frames"},
        {"value": "frames_farm", "label": "Use existing frames - farm"},
        {"value": "farm", "label": "Farm rendering"}
    ]

validate_instance_attributes(value)

Ensure reviewable and conditional_reviewable are exclusive.

Source code in server/settings/create_plugins.py
47
48
49
50
51
52
53
54
def validate_instance_attributes(value):
    """Ensure reviewable and conditional_reviewable are exclusive."""
    if "reviewable" in value and "conditional_reviewable" in value:
        raise ValueError(
            "'Reviewable' and 'Conditional Reviewable' cannot be "
            "selected together."
        )
    return value