Skip to content

Commit

Permalink
Merge branch 'RB-2.1' of github.com:MrKepzie/Natron into RB-2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
olear committed Oct 27, 2016
2 parents e875fee + 90bd399 commit 3644052
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 67 deletions.
114 changes: 77 additions & 37 deletions Gui/DockablePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,9 @@ DockablePanel::DockablePanel(Gui* gui,

DockablePanel::~DockablePanel()
{
if ( getGui() ) {
getGui()->removeVisibleDockablePanel(this);
Gui* gui = getGui();
if (gui) {
gui->removeVisibleDockablePanel(this);
}
}

Expand Down Expand Up @@ -534,13 +535,15 @@ DockablePanel::onKnobsRecreated()

// Refresh the curve editor with potential new animated knobs
if (isNodePanel) {
NodeGuiPtr node = isNodePanel->getNode();

getGui()->getCurveEditor()->removeNode( node.get() );
getGui()->getCurveEditor()->addNode(node);
Gui* gui = getGui();
if (gui) {
NodeGuiPtr node = isNodePanel->getNode();
gui->getCurveEditor()->removeNode( node.get() );
gui->getCurveEditor()->addNode(node);

getGui()->removeNodeGuiFromDopeSheetEditor(node);
getGui()->addNodeGuiToDopeSheetEditor(node);
gui->removeNodeGuiFromDopeSheetEditor(node);
gui->addNodeGuiToDopeSheetEditor(node);
}
}
}

Expand Down Expand Up @@ -966,13 +969,21 @@ DockablePanel::setClosedInternal(bool c)

NodeSettingsPanel* nodePanel = dynamic_cast<NodeSettingsPanel*>(this);
if (nodePanel) {
nodePanel->getNode()->getNode()->getEffectInstance()->refreshAfterTimeChange( false, getGui()->getApp()->getTimeLine()->currentFrame() );


NodeGuiPtr nodeGui = nodePanel->getNode();
NodePtr internalNode = nodeGui->getNode();
boost::shared_ptr<MultiInstancePanel> panel = getMultiInstancePanel();

Gui* gui = getGui();
if (internalNode && gui) {
GuiAppInstPtr app = gui->getApp();
if (app) {
boost::shared_ptr<TimeLine> timeline = app->getTimeLine();
if (timeline) {
internalNode->getEffectInstance()->refreshAfterTimeChange( false, timeline->currentFrame() );
}
}
}

boost::shared_ptr<MultiInstancePanel> panel = getMultiInstancePanel();

if (!c) {
gui->addNodeGuiToCurveEditor(nodeGui);
Expand Down Expand Up @@ -1050,9 +1061,12 @@ DockablePanel::closePanel()
hasFocus->clearFocus();
}

const std::list<ViewerTab*>& viewers = getGui()->getViewersList();
for (std::list<ViewerTab*>::const_iterator it = viewers.begin(); it != viewers.end(); ++it) {
(*it)->getViewer()->redraw();
Gui* gui = getGui();
if (gui) {
const std::list<ViewerTab*>& viewers = gui->getViewersList();
for (std::list<ViewerTab*>::const_iterator it = viewers.begin(); it != viewers.end(); ++it) {
(*it)->getViewer()->redraw();
}
}
}

Expand All @@ -1076,7 +1090,10 @@ DockablePanel::minimizeOrMaximize(bool toggled)
for (U32 i = 0; i < _panels.size(); ++i) {
_imp->_container->addWidget(_panels[i]);
}
getGui()->buildTabFocusOrderPropertiesBin();
Gui* gui = getGui();
if (gui) {
gui->buildTabFocusOrderPropertiesBin();
}
update();
}

Expand Down Expand Up @@ -1116,7 +1133,10 @@ DockablePanel::floatPanel()
_imp->_floatingWidget->deleteLater();
_imp->_floatingWidget = 0;
}
getGui()->buildTabFocusOrderPropertiesBin();
Gui* gui = getGui();
if (gui) {
gui->buildTabFocusOrderPropertiesBin();
}
return _imp->_floatingWidget;
}

Expand Down Expand Up @@ -1257,11 +1277,15 @@ DockablePanel::onOverlayColorDialogColorChanged(const QColor& color)
_imp->_hasOverlayColor = true;
}

NodesList overlayNodes;
getGui()->getNodesEntitledForOverlays(overlayNodes);
NodesList::iterator found = std::find(overlayNodes.begin(), overlayNodes.end(), node);
if ( found != overlayNodes.end() ) {
getGui()->getApp()->redrawAllViewers();
Gui* gui = getGui();
if (gui) {
NodesList overlayNodes;

gui->getNodesEntitledForOverlays(overlayNodes);
NodesList::iterator found = std::find(overlayNodes.begin(), overlayNodes.end(), node);
if ( found != overlayNodes.end() ) {
gui->getApp()->redrawAllViewers();
}
}
}
}
Expand Down Expand Up @@ -1330,11 +1354,15 @@ DockablePanel::onOverlayButtonClicked()
_imp->_overlayButton->setIcon( QIcon(pixOverlay) );
}
}
NodesList overlayNodes;
getGui()->getNodesEntitledForOverlays(overlayNodes);
NodesList::iterator found = std::find(overlayNodes.begin(), overlayNodes.end(), node);
if ( found != overlayNodes.end() ) {
getGui()->getApp()->redrawAllViewers();
Gui* gui = getGui();
if (gui) {
NodesList overlayNodes;

gui->getNodesEntitledForOverlays(overlayNodes);
NodesList::iterator found = std::find(overlayNodes.begin(), overlayNodes.end(), node);
if ( found != overlayNodes.end() ) {
gui->getApp()->redrawAllViewers();
}
}
}

Expand Down Expand Up @@ -1380,11 +1408,15 @@ DockablePanel::resetHostOverlayColor()
appPTR->getIcon(NATRON_PIXMAP_OVERLAY, NATRON_MEDIUM_BUTTON_ICON_SIZE, &pixOverlay);
_imp->_overlayButton->setIcon( QIcon(pixOverlay) );

NodesList overlayNodes;
getGui()->getNodesEntitledForOverlays(overlayNodes);
NodesList::iterator found = std::find(overlayNodes.begin(), overlayNodes.end(), node);
if ( found != overlayNodes.end() ) {
getGui()->getApp()->redrawAllViewers();
Gui* gui = getGui();
if (gui) {
NodesList overlayNodes;

gui->getNodesEntitledForOverlays(overlayNodes);
NodesList::iterator found = std::find(overlayNodes.begin(), overlayNodes.end(), node);
if ( found != overlayNodes.end() ) {
gui->getApp()->redrawAllViewers();
}
}
}

Expand Down Expand Up @@ -1480,15 +1512,19 @@ DockablePanel::onManageUserParametersActionTriggered()
void
DockablePanel::setKeyOnAllParameters()
{
double time = getGui()->getApp()->getTimeLine()->currentFrame();
Gui* gui = getGui();
if (!gui) {
return;
}
double time = gui->getApp()->getTimeLine()->currentFrame();
AddKeysCommand::KeysToAddList keys;
const KnobsGuiMapping& knobsMap = getKnobsMapping();

for (KnobsGuiMapping::const_iterator it = knobsMap.begin(); it != knobsMap.end(); ++it) {
KnobPtr knob = it->first.lock();
if ( knob->isAnimationEnabled() ) {
for (int i = 0; i < knob->getDimension(); ++i) {
std::list<boost::shared_ptr<CurveGui> > curves = getGui()->getCurveEditor()->findCurve(it->second, i);
std::list<boost::shared_ptr<CurveGui> > curves = gui->getCurveEditor()->findCurve(it->second, i);
for (std::list<boost::shared_ptr<CurveGui> >::iterator it2 = curves.begin(); it2 != curves.end(); ++it2) {
AddKeysCommand::KeyToAdd k;
KeyFrame kf;
Expand Down Expand Up @@ -1525,20 +1561,24 @@ DockablePanel::setKeyOnAllParameters()
}
}
}
pushUndoCommand( new AddKeysCommand(getGui()->getCurveEditor()->getCurveWidget(), keys) );
pushUndoCommand( new AddKeysCommand(gui->getCurveEditor()->getCurveWidget(), keys) );
}

void
DockablePanel::removeAnimationOnAllParameters()
{
Gui* gui = getGui();
if (!gui) {
return;
}
std::map< boost::shared_ptr<CurveGui>, std::vector<KeyFrame > > keysToRemove;
const KnobsGuiMapping& knobsMap = getKnobsMapping();

for (KnobsGuiMapping::const_iterator it = knobsMap.begin(); it != knobsMap.end(); ++it) {
KnobPtr knob = it->first.lock();
if ( knob->isAnimationEnabled() ) {
for (int i = 0; i < knob->getDimension(); ++i) {
std::list<boost::shared_ptr<CurveGui> > curves = getGui()->getCurveEditor()->findCurve(it->second, i);
std::list<boost::shared_ptr<CurveGui> > curves = gui->getCurveEditor()->findCurve(it->second, i);

for (std::list<boost::shared_ptr<CurveGui> >::iterator it2 = curves.begin(); it2 != curves.end(); ++it2) {
KeyFrameSet keys = (*it2)->getInternalCurve()->getKeyFrames_mt_safe();
Expand All @@ -1551,7 +1591,7 @@ DockablePanel::removeAnimationOnAllParameters()
}
}
}
pushUndoCommand( new RemoveKeysCommand(getGui()->getCurveEditor()->getCurveWidget(), keysToRemove) );
pushUndoCommand( new RemoveKeysCommand(gui->getCurveEditor()->getCurveWidget(), keysToRemove) );
}

void
Expand Down
6 changes: 6 additions & 0 deletions Gui/GuiPrivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ GuiPrivate::notifyGuiClosing()

const NodesGuiList allNodes = _nodeGraphArea->getAllActiveNodes();

{
// we do not need this list anymore, avoid using it
QMutexLocker k(&this->openedPanelsMutex);
this->openedPanels.clear();
}

for (NodesGuiList::const_iterator it = allNodes.begin(); it != allNodes.end(); ++it) {
DockablePanel* panel = (*it)->getSettingPanel();
if (panel) {
Expand Down
60 changes: 30 additions & 30 deletions INSTALL_OSX.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ OS X 10.6 (a.k.a. Snow Leopard) and newer are supported when building with MacPo

## Checkout sources

git clone https://github.com/MrKepzie/Natron.git
cd Natron
git clone https://github.com/MrKepzie/Natron.git
cd Natron

If you want to compile the bleeding edge version, use the master
branch:

git checkout master
git checkout master

Update the submodules:

git submodule update -i --recursive
git submodule update -i --recursive

## Install libraries

Expand All @@ -31,8 +31,8 @@ Homebrew is easier to set up than MacPorts, but cannot build universal binaries.

You need an up to date MacPorts version. Just download it and install it from <http://www.macports.org>, and execute the following commands in a terminal:

sudo port selfupdate
sudo port upgrade outdated
sudo port selfupdate
sudo port upgrade outdated

Then, you should add the "ports" provided by Natron. Edit as root the file `/opt/local/etc/macports/sources.conf` (as in `sudo nano /opt/local/etc/macports/sources.conf`) and add the following line at the beginning, with the path to the Natron sources (yes, there are three slashes after `file:`):

Expand All @@ -52,9 +52,9 @@ If compiling on Mac OS X 10.6 with Xcode 4, you should also revert to the defaul

And finally install the required packages:

sudo port install qt4-mac boost cairo expat
sudo port install py27-pyside py27-sphinx
sudo ln -s python2.7-config /opt/local/bin/python2-config
sudo port install qt4-mac boost cairo expat gsed
sudo port install py27-pyside py27-sphinx
sudo ln -s python2.7-config /opt/local/bin/python2-config

Create the file /opt/local/lib/pkgconfig/glu.pc containing GLU
configuration, for example using the following comands:
Expand Down Expand Up @@ -107,7 +107,7 @@ Install libraries:

brew tap homebrew/python
brew tap homebrew/science
brew install expat cairo
brew install expat cairo gnu-sed
brew install --build-from-source qt --with-mysql

Qt will not build on macOS Sierra, and the last command fails, but a sierra-compatible brew is available (to be used only in Sierra, since this builds Qt from sources and takes a while)
Expand All @@ -132,7 +132,7 @@ The last command above will take a while, since it builds from sources, and shou

also set the correct value for the pkg-config path (you can also put
this in your .bash_profile):

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig:/usr/local/opt/cairo/lib/pkgconfig

### Installing a patched Qt to avoid stack overflows
Expand Down Expand Up @@ -221,17 +221,17 @@ EOF
You can generate a makefile by opening a Terminal, setting the current
directory to the toplevel source directory, and typing

qmake -r
qmake -r

then type

make
make

This will create all binaries in all the subprojects folders.

If you want to build in DEBUG mode change the qmake call to this line:

qmake -r CONFIG+=debug
qmake -r CONFIG+=debug

* You can also enable logging by adding CONFIG+=log

Expand All @@ -247,34 +247,34 @@ tracker and in CImg-based plugins.

First, install clang 3.8. On OS X 10.6 Snow Leopard 10.6:

sudo port install ld64-136 +llvm38 clang-3.8`
sudo port install ld64-136 +llvm38 clang-3.8`

On OS X 10.7 or later:

sudo port install ld64-latest +llvm38 clang-3.8`
sudo port install ld64-latest +llvm38 clang-3.8`

Then configure using the following qmake command (replace `macx-clang`with `macx-clang-libc++` on OS X 10.9 and later):

/opt/local/libexec/qt4/bin/qmake -spec unsupported/macx-clang QMAKE_CXX=clang++-mp-3.8 QMAKE_CXX=clang++-mp-3.8 QMAKE_CC=clang-mp-3.8 QMAKE_OBJECTIVE_CXX=clang++-mp-3.8 QMAKE_OBJECTIVE_CC=clang-mp-3.8 QMAKE_LD=clang++-mp-3.8 -r CONFIG+=openmp

To build the plugins, use the following command-line (on OS X 10.9 and
later, remove `-stdlib=libstdc++`):

make CXX=clang++-mp-3.8 CXXFLAGS_ADD="-fopenmp" LDFLAGS_ADD="-fopenmp"
make CXX=clang++-mp-3.8 CXXFLAGS_ADD="-fopenmp" LDFLAGS_ADD="-fopenmp"

Or, if you have MangledOSMesa32 installed in `OSMESA_PATH` and LLVM installed in `LLVM_PATH` (MangledOSMesa32 and LLVM build script is available from [https://github.com/devernay/osmesa-install](github:devernay/osmesa-install) :

OSMESA_PATH=/opt/osmesa
LLVM_PATH=/opt/llvm
make CXX=clang++-mp-3.8 CXXFLAGS_ADD="-fopenmp" LDFLAGS_ADD="-fopenmp" CXXFLAGS_MESA="-DHAVE_OSMESA" LDFLAGS_MESA="-L${OSMESA_PATH}/lib -lMangledOSMesa32 `${LLVM_PATH}/bin/llvm-config --ldflags --libs engine mcjit mcdisassembler | tr '\n' ' '`" OSMESA_PATH="${OSMESA_PATH}"
OSMESA_PATH=/opt/osmesa
LLVM_PATH=/opt/llvm
make CXX=clang++-mp-3.8 CXXFLAGS_ADD="-fopenmp" LDFLAGS_ADD="-fopenmp" CXXFLAGS_MESA="-DHAVE_OSMESA" LDFLAGS_MESA="-L${OSMESA_PATH}/lib -lMangledOSMesa32 `${LLVM_PATH}/bin/llvm-config --ldflags --libs engine mcjit mcdisassembler | tr '\n' ' '`" OSMESA_PATH="${OSMESA_PATH}"

## Build on Xcode

Follow the instruction of build but
Follow the instruction of build but
add -spec macx-xcode to the qmake call command:

qmake -r -spec macx-xcode
qmake -r -spec macx-xcode

Then open the already provided Project-xcode.xcodeproj and compile the target "all"

### Compiling plugins with Xcode
Expand Down Expand Up @@ -318,7 +318,7 @@ On MacPorts, this would look like:

## Testing

(cd Tests && qmake -r CONFIG+=debug CONFIG+=coverage && make -j4 && ./Tests)
(cd Tests && qmake -r CONFIG+=debug CONFIG+=coverage && make -j4 && ./Tests)

## Generating Python bindings

Expand Down Expand Up @@ -349,16 +349,16 @@ tools/utils/runPostShiboken.sh

**Note**
Shiboken has a few glitches which needs fixing with some sed commands, run tools/utils/runPostShiboken.sh once shiboken is called

## OpenFX plugins

Instructions to build the [openfx-io](https://github.com/MrKepzie/openfx-io) and [openfx-misc](https://github.com/devernay/openfx-misc) sets of plugins can also be found in the [tools/packageOSX.sh](https://github.com/MrKepzie/Natron/blob/master/tools/packageOSX.sh) script if you are using MacPorts, or in the .travis.yml file in their respective github repositories if you are using homebrew ([openfx-misc/.travis.yml](https://github.com/devernay/openfx-misc/blob/master/.travis.yml), [openfx-io/.travis.yml](https://github.com/MrKepzie/openfx-io/blob/master/.travis.yml).


You can install [TuttleOFX](http://www.tuttleofx.org/) using homebrew:

brew tap homebrew/science homebrew/x11 homebrew/python cbenhagen/video
brew install tuttleofx
brew tap homebrew/science homebrew/x11 homebrew/python cbenhagen/video
brew install tuttleofx


Or have a look at the [instructions for building on MacPorts as well as precompiled universal binaries](http://devernay.free.fr/hacks/openfx/#OSXTuttleOFX).

0 comments on commit 3644052

Please sign in to comment.