-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ OIIO_NAMESPACE_USING | |
#include "Gaffer/Context.h" | ||
#include "Gaffer/ScriptNode.h" | ||
#include "Gaffer/StringPlug.h" | ||
#include "Gaffer/Expression.h" | ||
|
||
#include "GafferImage/FormatPlug.h" | ||
#include "GafferImage/ImageAlgo.h" | ||
|
@@ -863,6 +864,10 @@ ImageWriter::ImageWriter( const std::string &name ) | |
outPlug()->setInput( inPlug() ); | ||
|
||
createFileFormatOptionsPlugs(); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
ExpressionPtr expression = new Expression( "__expression" ); | ||
addChild( expression ); | ||
//expression->setExpression( string( "parent[\"__colorSpace\"][\"outputSpace\"] = context.get(\"gaffer:colorspace\", \"linear\") " ), string( "python" ) ); | ||
This comment has been minimized.
Sorry, something went wrong.
johnhaddon
|
||
} | ||
|
||
ImageWriter::~ImageWriter() | ||
|
@@ -990,6 +995,16 @@ const GafferImage::ImagePlug *ImageWriter::outPlug() const | |
return getChild<ImagePlug>( g_firstPlugIndex+5 ); | ||
} | ||
|
||
Expression *ImageWriter::expr() | ||
{ | ||
return getChild<Expression>( g_firstPlugIndex+6 ); | ||
This comment has been minimized.
Sorry, something went wrong.
johnhaddon
|
||
} | ||
|
||
const Expression *ImageWriter::expr() const | ||
{ | ||
return getChild<Expression>( g_firstPlugIndex+6 ); | ||
} | ||
|
||
Gaffer::ValuePlug *ImageWriter::fileFormatSettingsPlug( const std::string &fileFormat ) | ||
{ | ||
return getChild<ValuePlug>( fileFormat ); | ||
|
@@ -1062,6 +1077,9 @@ void ImageWriter::execute() const | |
Context * c = const_cast<Context *>( Context::current() ); | ||
c->set( "gaffer:colorspace", defaultColorSpace()( currentFileFormat() ) ); | ||
|
||
Expression * expression = const_cast<Expression *>( expr() ); | ||
expression->setExpression( string( "parent[\"__colorSpace\"][\"outputSpace\"] = context.get(\"gaffer:colorspace\", \"\") " ), string( "python" ) ); | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
lucienfostier
Author
Owner
|
||
if( !inPlug()->getInput<ImagePlug>() ) | ||
{ | ||
throw IECore::Exception( "No input image." ); | ||
|
Note that
createFileFormatOptionsPlugs()
is going to add a lot of plugs! So even if we have "out" at index 5, "__expression" will not be at index 6.