Map of the Code Base
This chapter is a directory-level tour. Use it to find where something lives; the later chapters explain how each part works.
Top-level directories
Engine/The core, GUI-free library. Nodes, the parameter (“knob”) system, the rendering pipeline, the RAM/disk cache, the OpenFX host glue, the built-in effects (Roto, RotoPaint, Tracker, Read, Write, Group, Backdrop, Dot, Viewer, Precomp, …), color management, image classes, the project model, animation curves, serialization, and the Python API (the
Py*classes). This is by far the largest and most important module. It links against Qt (forQObject, threads, mutexes and containers) but not against any GUI widgets.Gui/The Qt desktop application: the node graph (
NodeGraph*), the OpenGL viewer (ViewerGL,ViewerTab*), the animation curve editor (CurveEditor,CurveWidget) and dope sheet (DopeSheet*), the dockable parameter panels (DockablePanel,KnobGui*), roto and tracker panels, the preferences panel, the script editor, and dozens of custom widgets. Everything here can depend onEngine; nothing inEnginemay depend on anything here.App/NatronApp_main.cpp— themain()for theNatronGUI executable.Renderer/NatronRenderer_main.cpp— themain()for the headlessNatronRendererexecutable.PythonBin/python_main.cpp— thenatron-pythoninterpreter, a Python binary with the Natron modules available. It also doubles as Natron’s Python package manager (see Python Bindings (Shiboken / PySide)).Global/Small shared headers used across all modules:
Macros.h(namespace, version and compiler-diagnostic macros),Enums.handGlobalDefines.h(project-wide enums and typedefs),QtCompat.h(Qt5/Qt6 shims),GLIncludes.h(thegladOpenGL loader),KeySymbols.h(toolkit- independent key codes), and utility code (StrUtils,ProcInfo,PythonUtils,FStreamsSupport).HostSupport/Natron’s OpenFX host support library — the C++ classes that implement the host side of the OpenFX plug-in contract, built on top of the reference OpenFX headers in
libs/OpenFX.libs/Bundled third-party libraries built from source:
OpenFXandOpenFX_extensions(the plug-in API),ceres/openMVG/libmv(the tracker’s solver and matcher),Eigen3(linear algebra headers),hoedown(Markdown),libtess(tessellation),gflags/glog,qhttpserver(internal docs server),SequenceParsingandgoogle-breakpad(crash reporting).Tests/Google Test / Google Mock unit tests.
CrashReporter/,CrashReporterCLI/,BreakpadClient/The out-of-process crash reporter (built on Google Breakpad) and its GUI/CLI front-ends. Natron renders in a separate process from the reporter so that a crash in one does not take down the other.
Documentation/The Sphinx sources for this manual (see Contributing and Workflow for how the manual is organized and built).
tools/Release and CI engineering:
jenkinsandbuildmasterbuild farms,MacPortsandMINGW-packagesport files,dockerimages,appimagepackaging, and helper scripts such asgenStaticDocs.sh.
Naming conventions you will see everywhere
Once you recognize a handful of file-name suffixes, the ~600 files in
Engine and Gui become navigable:
FooFwd.hForward declarations and smart-pointer typedefs for a whole module.
Engine/EngineFwd.handGui/GuiFwd.hare the master catalogs — start there when you meet an unfamiliar type.FooI.hAn abstract interface (pure virtual class), e.g.
NodeGuiI,KnobGuiI,OpenGLViewerI,NodeGraphI,DockablePanelI. These are the seams betweenEngineandGui(see Design Techniques and Idioms).FooPrivate.h/FooPrivate.cppThe private implementation of a class
Foo(the “PIMPL” idiom). The publicFoo.hholds only a pointer toFooPrivate.FooSerialization.hThe
boost::serializationdescription of howFoois written to and read from a project file.PyFoo.h/PyFoo.cppThe Python-facing wrapper class for
Foo(exposed through Shiboken).OfxFoo.h/OfxFoo.cppThe OpenFX host implementation for
Foo(e.g.OfxEffectInstance,OfxClipInstance,OfxParamInstance).- Numbered GUI files (
Gui20.cpp,ViewerTab30.cpp,NodeGraph45.cpp…) Several large GUI classes are split across many
.cppfiles purely to keep individual translation units to a manageable size; they all implement the same class declared in the corresponding.h. There is no semantic meaning to the numbers beyond grouping related methods.