Skip to content

imageio

ImageIOSettings

Bases: BaseSettingsModel

Nuke color management project settings.

Source code in server/settings/imageio.py
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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
class ImageIOSettings(BaseSettingsModel):
    """Nuke color management project settings. """

    activate_host_color_management: bool = SettingsField(
        True, title="Enable Color Management")
    file_rules: ImageIOFileRulesModel = SettingsField(
        default_factory=ImageIOFileRulesModel,
        title="File Rules"
    )
    viewer: ViewProcessModel = SettingsField(
        default_factory=ViewProcessModel,
        title="Viewer",
        description=(
            "Viewer profile is used during Creation of new viewer node at knob"
            " viewerProcess"
        )
    )
    monitor: MonitorProcessModel = SettingsField(
        default_factory=MonitorProcessModel,
        title="Monitor OUT",
        description=(
            "Viewer Monitor Out settings is used during creation of new viewer"
            " node. This is used for external monitors used with a Nuke"
            " viewer."
        )
    )
    baking_target: ColorspaceConfigurationModel = SettingsField(
        default_factory=ColorspaceConfigurationModel,
        title="Baking Target Colorspace"
    )

    workfile: WorkfileColorspaceSettings = SettingsField(
        default_factory=WorkfileColorspaceSettings,
        title="Workfile"
    )

    nodes: NodesSetting = SettingsField(
        default_factory=NodesSetting,
        title="Nodes"
    )
    """# TODO: enhance settings with host api:
    - [ ] no need for `inputs` middle part. It can stay
      directly on `regex_inputs`
    """
    regex_inputs: RegexInputsModel = SettingsField(
        default_factory=RegexInputsModel,
        title="Assign colorspace to read nodes via rules"
    )

nodes = SettingsField(default_factory=NodesSetting, title='Nodes') class-attribute instance-attribute

TODO: enhance settings with host api:

  • [ ] no need for inputs middle part. It can stay directly on regex_inputs

OverrideNodesModel

Bases: NodesModel

Source code in server/settings/imageio.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
class OverrideNodesModel(NodesModel):
    product_names: list[str] = SettingsField(
        default_factory=list,
        title="Product names"
    )

    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/imageio.py
83
84
85
86
87
@validator("knobs")
def ensure_unique_names(cls, value):
    """Ensure name fields within the lists have unique names."""
    ensure_unique_names(value)
    return value

RequiredNodesModel

Bases: NodesModel

Source code in server/settings/imageio.py
59
60
61
62
63
64
65
66
67
68
69
class RequiredNodesModel(NodesModel):
    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/imageio.py
65
66
67
68
69
@validator("knobs")
def ensure_unique_names(cls, value):
    """Ensure name fields within the lists have unique names."""
    ensure_unique_names(value)
    return value

WorkfileColorspaceSettings

Bases: BaseSettingsModel

Workfile colorspace for Nuke root's project settings.

Source code in server/settings/imageio.py
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
class WorkfileColorspaceSettings(BaseSettingsModel):
    """Workfile colorspace for Nuke root's project settings."""

    _isGroup: bool = True

    color_management: Literal["Nuke", "OCIO"] = SettingsField(
        title="Color Management Workflow",
        description=(
            "Switch between native OCIO configs.\n\n"
            "This is only used if global color management is **disabled** and"
            " hence there is no global OCIO environment variable being set."
        ),
    )

    native_ocio_config: str = SettingsField(
        title="Native OpenColorIO Config",
        description=(
            "Nuke native OCIO config. The number between between the brackets"
            " after the configs describe which Nuke versions these are"
            " compatible with.\n\n"
            "This is only used if global color management is **disabled** and"
            " hence there is no global OCIO environment variable being set"
            " **AND** Color Management Workflow above is set to 'OCIO'."
        ),
        enum_resolver=ocio_configs_switcher_enum,
        conditionalEnum=True
    )

    working_space: str = SettingsField(
        title="Working Space"
    )
    monitor_lut: str = SettingsField(
        title="Thumbnails"
    )
    monitor_out_lut: str = SettingsField(
        title="Monitor Out"
    )
    int_8_lut: str = SettingsField(
        title="8-bit Files"
    )
    int_16_lut: str = SettingsField(
        title="16-bit Files"
    )
    log_lut: str = SettingsField(
        title="Log Files"
    )
    float_lut: str = SettingsField(
        title="Float Files"
    )