Compositor Addon: 3D LUT Editor

(sunboy) #1


[EDIT: New Version, complete rework]
I have written this addon mainly for video grading tasks as 3D Lookup Tables are a common way to do color correction and grading.

If you aren´t sure what the term 3D LUT means, you will find this link inspiring :slight_smile:

In short:
The 3D Lookuptable works like the RGB Curves node, but in 3D Space. It allows to assign every input R,G,B value to a new one.

And how it works:
To use the Addon, you need to patch Blender using the attached patch file which adds an LUT node.
That code is based on previous work from Alex Babahin and is WIP.
It should compile with blender 2.69; Haven’t tried with 2.7 yet but seems that there was some refactoring in the nodes system :-/

Create a new ApplyLUT node. If it is selected, the LUT Editor operators will appear in the Node Editor Panel:
Setup will create a 3d LUT structure in the 3d View with the Resolution of the steps value and it works on three ways:

  1. If you have already loaded a valid LUT in the node, the operator will generate that one with it’s native resolution.
  2. If you specify a file that doesn’t exist, a new LUT with the steps resolution will be created and saved as the file. This is where you want to start usually.
  3. If you have already opened an LUT and then delete the filepath in the node, the file will be overwritten with a new LUT with the given steps. This is the way to do a reset.

The Curves operator will translate an RGB Curves node to an LUT!
First select the Curves node, then add the LUT node to the selection (shift + RMB). Then click the curves button and the LUT in the node will be overwritten by a new one representing the curves.

The Iterate Operator allows to change the reslution of your LUT whie keeping the changes you have done.

The Save Operator will save the LUT to a new file.

The update operator, which is also found in the 3D View panel, will apply the changes you made in the 3D LUT to the LUT Node.
So does the Dynamic Update Button in the 3d view. This one is a modal operator which tries to update autmatically on changes.

The reset Operator in the 3D View Panel resets the selected points to their default positions.

Using the Color, the 3D pointer will show you where a specific color is located in the LUT Cube.
It´s intended to pick a color from your image and see which sphere you have to move.

If you set the viewport shading to textured, the LUT will become nicely colorful :wink:

Be careful: Creating of LUTs is quite slow because Blender is not fast when creating many objects. For high resolutions (+7), the setup operator may take MUCH time.

Attachments (9.61 KB)

(3pointEdit) #2

Very cool tool. Thanks so much.

(pld) #3

Hah, I’m glad I just found this (my old workflow was to dump the video frames to images, apply a Hald 3D clut to all of them using imagemagick, then coming back into blender for more work).

Any chance you could support importing an existing Hald 3D clut? I have a ton of film presets I think it would be really neat to apply to some footage!

(sunboy) #4

New version added!

With the ApplyLUT node you may apply LUTs easily. You need to convert the data to the color space the node works in of cause by using additional LUT nodes though.
An other way is to manually add the nodes to the OCIO config. In the Blender’s binary folder/2.69/datafiles/colormanagement you may copy the LUT into the luts folder and then edit config.ocio appropriately.

EDIT: Version 0.8 Added, should be working with relative paths, too. And should compile with recent GIT.

(mihnea) #5

This could be one of the most usefull addon for blender but I cant find how to install it. Im using blender (on ubuntu) for a long time but im a noob in programming , but i hope there is a “easy” way to install it. Thanks!

(zenny) #6

@sunboy: Thanks for this very valuable addon which is the most desired. In the meantime, does it work with Blender v2.78?

It is a long time since you posted last time. However just wonder why Blender developers has not upstreamed such a desirable feature?!

(Spirou4D) #7

A great Thanks. :cool: