Skip to content

Commit

Permalink
Merge branch 'feat-exposure-bands'
Browse files Browse the repository at this point in the history
  • Loading branch information
MrLixm committed Jun 15, 2024
2 parents c3eb840 + 90596c1 commit b126c0a
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 12 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ Collections of resources I made for Foundry's Nuke software.

_this table might not be always up-to-date_

| tool | description | type | tag |
|--------------------------------------------------|----------------------------------------------------------------------------|---------------|-------------------------------------------------------------|
| [nodeToText](src/nodeToText) | Convert the selected nodes knobs:values to a .json. | script | ![i-o](https://img.shields.io/badge/i--o-9a52dd) |
| [metadataToCamera](src/metadataToCamera) | A custom Nuke node to convert OpenEXR metadata to a Nuke Camera node. | nodes | ![i-o](https://img.shields.io/badge/i--o-9a52dd) |
| [imageCropDivide](src/imageCropDivide) | From given maximum dimensions, divide an input image into multiples crops. | nodes, script | ![transform](https://img.shields.io/badge/transform-4c78a6) |
| [primaries_inset](src/primaries_inset) | colorspace remapping to ensure smooth hue reproduction (AgX like) | nodes, blink | ![grading](https://img.shields.io/badge/grading-43896b) |
| [ocio-contrast-linear](src/ocio-contrast-linear) | contrast on linear encoded imagery based on the OCIO implementation | nodes | ![grading](https://img.shields.io/badge/grading-43896b) |
| [ocio-contrast-log](src/ocio-contrast-log) | contrast on log encoded imagery based on the OCIO implementation | nodes | ![grading](https://img.shields.io/badge/grading-43896b) |
| [ocio-saturation](src/ocio-saturation) | saturation with variable weights also based on OCIO implementation | nodes | ![grading](https://img.shields.io/badge/grading-43896b) |
| [hsv](src/hsv) | color correction with HSV model | nodes | ![grading](https://img.shields.io/badge/grading-43896b) |
| [whitebalance](src/whitebalance) | creative white balance with temperature/tint | nodes, blink | ![grading](https://img.shields.io/badge/grading-43896b) |
| tool | description | type | tag |
|--------------------------------------------------|----------------------------------------------------------------------------|----------------|-------------------------------------------------------------|
| [nodeToText](src/nodeToText) | Convert the selected nodes knobs:values to a .json. | script | ![i-o](https://img.shields.io/badge/i--o-9a52dd) |
| [metadataToCamera](src/metadataToCamera) | A custom Nuke node to convert OpenEXR metadata to a Nuke Camera node. | nodes | ![i-o](https://img.shields.io/badge/i--o-9a52dd) |
| [imageCropDivide](src/imageCropDivide) | From given maximum dimensions, divide an input image into multiples crops. | nodes, script | ![transform](https://img.shields.io/badge/transform-4c78a6) |
| [primaries_inset](src/primaries_inset) | colorspace remapping to ensure smooth hue reproduction (AgX like) | nodes, blink | ![grading](https://img.shields.io/badge/grading-43896b) |
| [ocio-contrast-linear](src/ocio-contrast-linear) | contrast on linear encoded imagery based on the OCIO implementation | nodes | ![grading](https://img.shields.io/badge/grading-43896b) |
| [ocio-contrast-log](src/ocio-contrast-log) | contrast on log encoded imagery based on the OCIO implementation | nodes | ![grading](https://img.shields.io/badge/grading-43896b) |
| [ocio-saturation](src/ocio-saturation) | saturation with variable weights also based on OCIO implementation | nodes | ![grading](https://img.shields.io/badge/grading-43896b) |
| [hsv](src/hsv) | color correction with HSV model | nodes | ![grading](https://img.shields.io/badge/grading-43896b) |
| [whitebalance](src/whitebalance) | creative white balance with temperature/tint | nodes, blink | ![grading](https://img.shields.io/badge/grading-43896b) |
| [exposure-bands](src/exposure-bands) | generate successive bands of gradually increasing exposure | nodes | ![generate](https://img.shields.io/badge/generate-3A3B9F) |

# Utilisation

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "foundry-nuke"
version = "0.6.0"
version = "0.7.0"
description = "Collection of script & resources for Foundry's Nuke software."
authors = ["Liam Collod <[email protected]>"]
readme = "README.md"
Expand Down
38 changes: 38 additions & 0 deletions src/exposure-bands/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# exposure-bands

generate successive bands of gradually increasing exposure.

This is useful when testing and prototyping image-rendering transform and
you need to evaluate its render against different exposure of a same source.

![nuke screenshot as example](example.png)

# design

Be aware that to be dynamic as possible the node generate the exposure bands
on different frames. This implies also having tcl expression using the `frame`
variable which can sometimes lead to unstabilities.

# adding dynamic text on each band

It's possible to add text indicating the exposure value of each band without
manually creating a text node for each band, however it's a bit tricky:

- Go inside the node
- Between the 2 internal nodes add a `ModifyMetadata` node
- add a single `_bands_exposure` key
- as value of that key put the tcl expression `[value parent._exposure]`
- Add a `Text` node after the `ModifyMetadata`
- in the message put the tcl expression `[metadata _bands_exposure]`
- configure the Text node as you wish

> Why using a ModifyMetadata node ?
This is the only hack I found so Nuke properly pickup the band exposure for
its correct frame (remember the tool use the frame-range to work).

> [!TIP]
> If you are using the tool for evaluating image rendering you probably don't
> want the text to be affected by it, so you will have to put an OCIODisplay
> node or whatver you use for your image rendering before the text node but after
> the first internal exposure node.
Binary file added src/exposure-bands/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions src/exposure-bands/exposure-bands.nk
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Group {
name ExposureBandsTest
xpos 0
ypos 0
tile_color 0x64899900
note_font_color 0xffffff00
addUserKnob {20 User l ExposureBandsTest}
addUserKnob {26 txt_exposure l "" +STARTLINE T "<h1> Exposure</h1>"}
addUserKnob {26 txt_exposure_2 l "" +STARTLINE T "All values in Stops."}
addUserKnob {26 spacing1 l "" +STARTLINE T " "}
addUserKnob {3 exposure_start l "start" -STARTLINE}
exposure_start -6
addUserKnob {3 exposure_end l " end" -STARTLINE}
exposure_end 6
addUserKnob {3 exposure_step l " step" -STARTLINE}
exposure_step 2
addUserKnob {26 "" +STARTLINE}
addUserKnob {3 _frames_number l "bands number"}
_frames_number {{"(exposure_end - exposure_start) / exposure_step + 1"}}
addUserKnob {7 _exposure l "current exposure"}
_exposure {{"frame >= 0 & frame <= _frames_number?exposure_start+exposure_step*frame:0"}}
addUserKnob {20 About}
addUserKnob {26 toolName l name T ExposureBandsTest}
addUserKnob {26 toolVersion l version T 0.1.1}
addUserKnob {26 toolAuthor l author T "<a style=\"color: rgb(200,200,200);\" href=\"https://mrlixm.github.io/\">Liam Collod</a>"}
addUserKnob {26 toolDescription l description T "Test image rendering with sucessive bands of gradually increasing exposure."}
addUserKnob {26 toolUrl l url T "<a style=\"color: rgb(200,200,200);\" href=\"https://github.com/MrLixm/Foundry_Nuke\">https://github.com/MrLixm/Foundry_Nuke</a>"}
}
Input {
inputs 0
name image
xpos 0
ypos 0
}
EXPTool {
name BandExposure
xpos 0
ypos 50
mode Stops
gang false
red {{parent._exposure}}
green {{parent._exposure}}
blue {{parent._exposure}}
}
ContactSheet {
name BandsContactSheet
xpos 0
ypos 200
width {{width*columns}}
height {{height}}
rows 1
columns {{parent._frames_number}}
splitinputs true
startframe 0
endframe {{parent._frames_number}}
}
Output {
name Output1
xpos 0
ypos 350
}
end_group

0 comments on commit b126c0a

Please sign in to comment.