Skip to content

Commit

Permalink
Merge branch 'workshop' into RB-2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKepzie committed Feb 2, 2016
2 parents 5c85045 + a2e1000 commit 2ac54e9
Show file tree
Hide file tree
Showing 19 changed files with 1,192 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Engine/OfxEffectInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ OfxEffectInstance::getFramesNeeded(double time, int view)

if ( (stat != kOfxStatOK) && (stat != kOfxStatReplyDefault) ) {
throw std::runtime_error("getFrameViewsNeeded action failed");
} else if (stat == kOfxStatOK) {
} else {
for (OFX::Host::ImageEffect::ViewsRangeMap::iterator it = inputRanges.begin(); it != inputRanges.end(); ++it) {
OfxClipInstance* clip = dynamic_cast<OfxClipInstance*>(it->first);
assert(clip);
Expand Down
18 changes: 14 additions & 4 deletions Gui/CurveGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,13 @@ CurveGui::drawCurve(int curveIndex,
glCheckError();
if (hasDrawnExpr) {
glBegin(GL_LINE_STRIP);
bool prevVisible = true;
for (int i = 0; i < (int)exprVertices.size(); i += 2) {
if (exprVertices[i] < btmLeft.x() || exprVertices[i] > topRight.x() ||
exprVertices[i+1] < btmLeft.y() || exprVertices[i+1] > topRight.y()) {
bool vertexVisible = exprVertices[i] >= btmLeft.x() && exprVertices[i] <= topRight.x() &&
exprVertices[i+1] >= btmLeft.y() && exprVertices[i+1] <= topRight.y();
bool previousWasVisible = prevVisible;
prevVisible = vertexVisible;
if (!previousWasVisible && !vertexVisible) {
continue;
}
glVertex2f(exprVertices[i],exprVertices[i + 1]);
Expand All @@ -343,13 +347,19 @@ CurveGui::drawCurve(int curveIndex,
glEnable(GL_LINE_STIPPLE);
}
glBegin(GL_LINE_STRIP);

bool prevVisible = true;
for (int i = 0; i < (int)vertices.size(); i += 2) {
if (vertices[i] < btmLeft.x() || vertices[i] > topRight.x() ||
vertices[i+1] < btmLeft.y() || vertices[i+1] > topRight.y()) {
bool vertexVisible = vertices[i] >= btmLeft.x() && vertices[i] <= topRight.x() &&
vertices[i+1] >= btmLeft.y() && vertices[i+1] <= topRight.y();
bool previousWasVisible = prevVisible;
prevVisible = vertexVisible;
if (!previousWasVisible && !vertexVisible) {
continue;
}
glVertex2f(vertices[i],vertices[i + 1]);
}

glEnd();
if (hasDrawnExpr) {
glDisable(GL_LINE_STIPPLE);
Expand Down
13 changes: 12 additions & 1 deletion Gui/DopeSheetView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
CLANG_DIAG_OFF(deprecated-declarations)
GCC_DIAG_OFF(deprecated-declarations)

#define NATRON_DOPESHEET_MIN_RANGE_FIT 10

NATRON_NAMESPACE_ENTER;

namespace {
Expand Down Expand Up @@ -2681,6 +2683,15 @@ void DopeSheetView::centerOnSelection()
if (range.first == range.second) {
return;
}

double actualRange = (range.second - range.first);
if (actualRange < NATRON_DOPESHEET_MIN_RANGE_FIT) {
double diffRange = NATRON_DOPESHEET_MIN_RANGE_FIT - actualRange;
diffRange /= 2;
range.first -= diffRange;
range.second += diffRange;
}


_imp->zoomContext.fill(range.first, range.second,
_imp->zoomContext.bottom(), _imp->zoomContext.top());
Expand Down Expand Up @@ -3463,7 +3474,7 @@ DopeSheetView::wheelEvent(QWheelEvent *e)
}
else if (par > par_max) {
par = par_max;
scaleFactor = par / _imp->zoomContext.factor();
scaleFactor = 1;
}


Expand Down
5 changes: 2 additions & 3 deletions tools/MacOSX/ports/graphics/openimageio/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PortGroup qt4 1.0
epoch 1

fetch.type git
github.setup OpenImageIO oiio 1.6.9 tags/Release-
github.setup OpenImageIO oiio 1.5.23 tags/Release-
#github.version ${version}-dist
#github.tarball_from downloads

Expand Down Expand Up @@ -79,8 +79,7 @@ if {${configure.build_arch} eq "ppc"} {
patch.pre_args -p1
patchfiles \
oiio-x86intrin.patch \
oiio-sha1.patch
oiio-1.5.22-exrthreads.patch

cmake.out_of_source yes

Expand Down
169 changes: 169 additions & 0 deletions tools/MacOSX/ports/graphics/openimageio/Portfile~1.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem 1.0
PortGroup github 1.0
PortGroup cmake 1.0
PortGroup conflicts_build 1.0
PortGroup qt4 1.0
# gcc-4.8 cannot compile universal
# The internal yaml-cpp is not compiled with multiple archs in universal mode
#PortGroup muniversal 1.0

epoch 1

fetch.type git
github.setup OpenImageIO oiio 1.5.23 tags/Release-
#github.version ${version}-dist
#github.tarball_from downloads

name openimageio
#version 1.4.5.91
#revision 2
categories graphics
platforms darwin
license BSD
maintainers openmaintainer
description OpenImageIO is a library for reading and writing images
long_description ${description}
homepage http://sites.google.com/site/openimageio/


#master_sites debian:o/openimageio/
#worksrcdir ${name}-${version}~dfsg0.orig
#distfiles ${name}_${version}~dfsg0.orig${extract.suffix}
#checksums rmd160 94c6e2274be01e82cfe8bc4bf11677593d33f299 \
# sha256 4cf3b373e56694ce9e3896a356b68a2ed92978e76be653a5b5e45b17937faae8

depends_lib port:boost port:jpeg port:tiff port:libpng port:openexr port:glew port:ilmbase port:libraw port:giflib

# can't compile openimageio when another version is installed, because the include path is wrong
conflicts_build ${name}

depends_build port:txt2man
depends_skip_archcheck txt2man
# port:opencolorio

# we need gcc atomics (clang >= 3.5 maybe?, gcc >= 4.8 works)
# tested with openimageio 1.4.6rc1:
# macports-clang-3.3 and later work
# gcc-4.2 doesn't work
# llvm-gcc-4.2 works
# macports-clang < 3.3 untested
#compiler.fallback-append macports-gcc-4.8 macports-gcc-4.9 macports-clang-3.3 macports-clang-3.4 macports-clang-3.5
compiler.blacklist apple-gcc-4.0 apple-gcc-4.2 gcc-3.3 gcc-4.0 gcc-4.2 macports-gcc-4.0 macports-gcc-4.2

# The PowerPC build requires GCC >= 4.8, which doesn't recognize the -arch flag, and requires libatomic
if {${configure.build_arch} eq "ppc"} {
compiler.blacklist-append macports-gcc-4.3 macports-gcc-4.4 macports-gcc-4.5 macports-gcc-4.6 macports-gcc-4.7 macports-clang-3.3 macports-clang-3.4 macports-clang-3.5
# the following removes the flag "-arch ppc" put by cmake-1.0 portgroup in the pre-configure phase
pre-configure {
configure.args-delete -DCMAKE_OSX_ARCHITECTURES="${configure.build_arch}"
}
# -latomic is necessary on ppc for __atomic_fetch_add_8 and __atomic_exchange_8
configure.args-append -DCMAKE_SHARED_LINKER_FLAGS=-latomic -DCMAKE_EXE_LINKER_FLAGS=-latomic
}

#post-extract {
# system "touch ${worksrcpath}/LICENSE ${workpath}/${worksrcdir}/LICENSE"
#}

# Those are Debian patches, which require -p1
#patch.pre_args -p1
#patchfiles \
# build_in_sources.patch
# 0001-Fix_docs_generation.patch \
# 0002-Fix_IlmBase_issue.patch \
# 0003-Fix_multiarch_paths.patch \
# 0004-Fix_FTBFS_on_atomic_operations.patch \
patch.pre_args -p1
patchfiles \
oiio-1.5.22-exrthreads.patch

cmake.out_of_source yes

configure.args-append \
-DOIIO_BUILD_TESTS:BOOL=FALSE \
-DBOOST_ROOT=${prefix} \
-DUSE_QT:BOOL=FALSE \
-DUSE_TBB:BOOL=FALSE \
-DUSE_PYTHON:BOOL=FALSE \
-DUSE_PYTHON3:BOOL=FALSE \
-DUSE_FIELD3D:BOOL=FALSE \
-DUSE_FFMPEG:BOOL=FALSE \
-DUSE_OPENJPEG:BOOL=FALSE \
-DUSE_OCIO:BOOL=FALSE \
-DUSE_OPENCV:BOOL=FALSE \
-DUSE_OPENSSL:BOOL=FALSE \
-DUSE_FREETYPE:BOOL=FALSE \
-DUSE_GIF:BOOL=TRUE \
-DUSE_PTEX:BOOL=FALSE \
-DUSE_LIBRAW:BOOL=TRUE \
-DSTOP_ON_WARNING:BOOL=FALSE

default_variants +opencolorio +openjpeg +qt4 +freetype

variant opencolorio description {Add OpenColorIO support.} {
depends_lib-append port:opencolorio
configure.args-delete -DUSE_OCIO:BOOL=FALSE
configure.args-append -DUSE_OCIO:BOOL=TRUE
}

variant ffmpeg description {Add FFmpeg support.} {
depends_lib-append port:ffmpeg
configure.args-delete -DUSE_FFMPEG:BOOL=FALSE
configure.args-append -DUSE_FFMPEG:BOOL=TRUE
}

variant openjpeg description {Add OpenJPEG support.} {
depends_lib-append port:openjpeg15
configure.args-delete -DUSE_OPENJPEG:BOOL=FALSE
configure.args-append -DUSE_OPENJPEG:BOOL=TRUE -DOPENJPEG_INCLUDE_DIR=${prefix}/include/openjpeg-1.5
}

variant python26 conflicts python27 description {Add Python 2.6 bindings.} {
depends_lib-append port:python26
configure.args-delete -DUSE_PYTHON:BOOL=FALSE
configure.args-append -DUSE_PYTHON:BOOL=TRUE \
-DPYTHON_VERSION=2.6 \
-DPYTHON_EXECUTABLE=${prefix}/bin/python2.6 \
-DPYTHON_LIBRARY=${prefix}/lib/libpython2.6.dylib \
-DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.6/Headers \
-DPYTHON_PACKAGES_PATH=${frameworks_dir}/Python.framework/Versions/2.6/lib/python2.6/site-packages
}

variant python27 conflicts python26 description {Add Python 2.7 bindings.} {
depends_lib-append port:python27
configure.args-delete -DUSE_PYTHON:BOOL=FALSE
configure.args-append -DUSE_PYTHON:BOOL=TRUE \
-DPYTHON_VERSION=2.7 \
-DPYTHON_EXECUTABLE=${prefix}/bin/python2.7 \
-DPYTHON_LIBRARY=${prefix}/lib/libpython2.7.dylib \
-DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.7/Headers \
-DPYTHON_PACKAGES_PATH=${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
}

variant qt4 description {Build the Qt-based image viewer.} {
configure.args-delete -DUSE_QT:BOOL=FALSE
configure.args-append -DUSE_QT:BOOL=TRUE
depends_lib-append port:qt4-mac
}

variant field3d description {Use Field3D.} {
configure.args-delete -DUSE_FIELD3D:BOOL=FALSE
configure.args-append -DUSE_FIELD3D:BOOL=TRUE
depends_lib-append port:field3d
}

variant freetype description {Use FreeType.} {
configure.args-delete -DUSE_FREETYPE:BOOL=FALSE
configure.args-append -DUSE_FREETYPE:BOOL=TRUE -DFREETYPE_INCLUDE_PATH=${prefix}/include/freetype2
depends_lib-append port:freetype
}

variant natron require field3d description {Compile a version to be included in Natron} {
}
#configure.args --enable-bsdtar=shared --enable-bsdcpio=shared \
# --without-lzmadec --without-lzma
#use_autoreconf yes
Loading

0 comments on commit 2ac54e9

Please sign in to comment.