Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GafferArnold: exposed abortOnError, and maxSubdivision options #2290

Merged
merged 1 commit into from Oct 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 39 additions & 6 deletions python/GafferArnoldUI/ArnoldOptionsUI.py
Expand Up @@ -96,6 +96,12 @@ def __rayDepthSummary( plug ) :
info.append( "Threshold %s" % GafferUI.NumericWidget.valueToString( plug["autoTransparencyThreshold"]["value"].getValue() ) )
return ", ".join( info )

def __subdivisionSummary( plug ) :
info = []
if plug["maxSubdivisions"]["enabled"].getValue():
info.append( "Max Subdivisions %d" % plug["maxSubdivisions"]["value"].getValue() )
return ", ".join( info )

def __texturingSummary( plug ) :

info = []
Expand Down Expand Up @@ -136,9 +142,11 @@ def __searchPathsSummary( plug ) :

return ", ".join( info )

def __errorColorsSummary( plug ) :
def __errorHandlingSummary( plug ) :

info = []
if plug["abortOnError"]["enabled"].getValue() :
info.append( "Abort on Error " + ( "On" if plug['abortOnError']["value"].getValue() else "Off" ) )
for suffix in ( "Texture", "Pixel", "Shader" ) :
if plug["errorColorBad"+suffix]["enabled"].getValue() :
info.append( suffix )
Expand Down Expand Up @@ -187,10 +195,11 @@ def __licensingSummary( plug ) :
"layout:section:Rendering:summary", __renderingSummary,
"layout:section:Sampling:summary", __samplingSummary,
"layout:section:Ray Depth:summary", __rayDepthSummary,
"layout:section:Subdivision:summary", __subdivisionSummary,
"layout:section:Texturing:summary", __texturingSummary,
"layout:section:Features:summary", __featuresSummary,
"layout:section:Search Paths:summary", __searchPathsSummary,
"layout:section:Error Colors:summary", __errorColorsSummary,
"layout:section:Error Handling:summary", __errorHandlingSummary,
"layout:section:Logging:summary", __loggingSummary,
"layout:section:Licensing:summary", __licensingSummary,

Expand Down Expand Up @@ -493,6 +502,19 @@ def __licensingSummary( plug ) :
"label", "Opacity Threshold",
],

# Subdivision

"options.maxSubdivisions" : [

"description",
"""
A global override for the maximum polymesh.subdiv_iterations.
""",

"layout:section", "Subdivision",
"label", "Max Subdivisions",
],

# Texturing

"options.textureMaxMemoryMB" : [
Expand Down Expand Up @@ -702,7 +724,18 @@ def __licensingSummary( plug ) :

],

# Error Colors
# Error Handling

"options.abortOnError" : [

"description",
"""
Aborts the render if an error is encountered.
""",

"layout:section", "Error Handling"

],

"options.errorColorBadTexture" : [

Expand All @@ -712,7 +745,7 @@ def __licensingSummary( plug ) :
made to use a bad or non-existent texture.
""",

"layout:section", "Error Colors",
"layout:section", "Error Handling",
"label", "Bad Texture",

],
Expand All @@ -725,7 +758,7 @@ def __licensingSummary( plug ) :
a NaN is encountered.
""",

"layout:section", "Error Colors",
"layout:section", "Error Handling",
"label", "Bad Pixel",

],
Expand All @@ -738,7 +771,7 @@ def __licensingSummary( plug ) :
in a shader.
""",

"layout:section", "Error Colors",
"layout:section", "Error Handling",
"label", "Bad Shader",

],
Expand Down
7 changes: 6 additions & 1 deletion src/GafferArnold/ArnoldOptions.cpp
Expand Up @@ -76,6 +76,10 @@ ArnoldOptions::ArnoldOptions( const std::string &name )
options->addOptionalMember( "ai:auto_transparency_depth", new IECore::IntData( 10 ), "autoTransparencyDepth", Gaffer::Plug::Default, false );
options->addOptionalMember( "ai:auto_transparency_threshold", new IECore::FloatData( 0.99 ), "autoTransparencyThreshold", Gaffer::Plug::Default, false );

// Subdivision

options->addOptionalMember( "ai:max_subdivisions", new IECore::IntData(999), "maxSubdivisions", Gaffer::Plug::Default, false );

// Texturing parameters

options->addOptionalMember( "ai:texture_max_memory_MB", new IECore::FloatData( 2048 ), "textureMaxMemoryMB", Gaffer::Plug::Default, false );
Expand All @@ -101,8 +105,9 @@ ArnoldOptions::ArnoldOptions( const std::string &name )
options->addOptionalMember( "ai:procedural_searchpath", new IECore::StringData( "" ), "proceduralSearchPath", Gaffer::Plug::Default, false );
options->addOptionalMember( "ai:shader_searchpath", new IECore::StringData( "" ), "shaderSearchPath", Gaffer::Plug::Default, false );

// Error colours
// Error handling

options->addOptionalMember( "ai:abort_on_error", new IECore::BoolData( true ), "abortOnError", Gaffer::Plug::Default, false);
options->addOptionalMember( "ai:error_color_bad_texture", new IECore::Color3fData( Color3f( 1, 0, 0 ) ), "errorColorBadTexture", Gaffer::Plug::Default, false );
options->addOptionalMember( "ai:error_color_bad_pixel", new IECore::Color3fData( Color3f( 0, 0, 1 ) ), "errorColorBadPixel", Gaffer::Plug::Default, false );
options->addOptionalMember( "ai:error_color_bad_shader", new IECore::Color3fData( Color3f( 1, 0, 1 ) ), "errorColorBadShader", Gaffer::Plug::Default, false );
Expand Down