Skip to content

Commit

Permalink
doc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed Jul 4, 2017
1 parent 52b3f54 commit 092377b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 9 deletions.
46 changes: 42 additions & 4 deletions Engine/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4313,6 +4313,20 @@ Node::refreshPreviewsAfterProjectLoad()
#define kOCIOParamInputSpaceChoice "ocioInputSpaceIndex"
#define kOCIOParamOutputSpaceChoice "ocioOutputSpaceIndex"

#define kOCIODisplayPluginIdentifier "fr.inria.openfx.OCIODisplay"
#define kOCIODisplayParamDisplay "display"
#define kOCIODisplayParamDisplayChoice "displayIndex"
#define kOCIODisplayParamView "view"
#define kOCIODisplayParamViewChoice "viewIndex"

#define kOCIOCDLTransformPluginIdentifier "fr.inria.openfx.OCIOCDLTransform"
#define kOCIOCDLTransformParamCCCID "cccId"
#define kOCIOCDLTransformParamCCCIDChoice "cccIdIndex"

#define kOCIOFileTransformPluginIdentifier "fr.inria.openfx.OCIOFileTransform"
#define kOCIOFileTransformParamCCCID "cccId"
#define kOCIOFileTransformParamCCCIDChoice "cccIdIndex"

// genHTML: true for live HTML output for the internal web-server, false for markdown output
QString
Node::makeDocumentation(bool genHTML) const
Expand Down Expand Up @@ -4408,10 +4422,20 @@ Node::makeDocumentation(bool genHTML) const
QString knobLabel = NATRON_NAMESPACE::convertFromPlainTextToMarkdown( QString::fromUtf8( (*it)->getLabel().c_str() ), genHTML, true);
QString knobHint = NATRON_NAMESPACE::convertFromPlainTextToMarkdown( QString::fromUtf8( (*it)->getHintToolTip().c_str() ), genHTML, true);

// totally ignore the documentation for these parameters (which are always secret in Natron)
if ( knobScriptName.startsWith( QString::fromUtf8("NatronOfxParam") ) ||
knobScriptName == QString::fromUtf8("exportAsPyPlug") ||
knobScriptName == QString::fromUtf8(kOCIOParamInputSpace) ||
knobScriptName == QString::fromUtf8(kOCIOParamOutputSpace) ) {
knobScriptName == QString::fromUtf8(kOCIOParamOutputSpace) ||
( ( pluginID == QString::fromUtf8(kOCIODisplayPluginIdentifier) ) &&
( knobScriptName == QString::fromUtf8(kOCIODisplayParamDisplay) ) ) ||
( ( pluginID == QString::fromUtf8(kOCIODisplayPluginIdentifier) ) &&
( knobScriptName == QString::fromUtf8(kOCIODisplayParamView) ) ) ||
( ( pluginID == QString::fromUtf8(kOCIOCDLTransformPluginIdentifier) ) &&
( knobScriptName == QString::fromUtf8(kOCIOCDLTransformParamCCCID) ) ) ||
( ( pluginID == QString::fromUtf8(kOCIOFileTransformPluginIdentifier) ) &&
( knobScriptName == QString::fromUtf8(kOCIOFileTransformParamCCCID) ) ) ||
false ) {
continue;
}

Expand Down Expand Up @@ -4465,7 +4489,19 @@ Node::makeDocumentation(bool genHTML) const
// ignored (eg. OCIO colorspace knobs).
if ( isChoice &&
(genHTML || ( knobScriptName != QString::fromUtf8(kOCIOParamInputSpaceChoice) &&
knobScriptName != QString::fromUtf8(kOCIOParamOutputSpaceChoice) ) ) ) {
knobScriptName != QString::fromUtf8(kOCIOParamOutputSpaceChoice) &&
!( ( pluginID == QString::fromUtf8(kOCIODisplayPluginIdentifier) ) &&
( knobScriptName == QString::fromUtf8(kOCIODisplayParamDisplayChoice) ) ) &&
!( ( pluginID == QString::fromUtf8(kOCIODisplayPluginIdentifier) ) &&
( knobScriptName == QString::fromUtf8(kOCIODisplayParamViewChoice) ) ) &&
!( ( pluginID == QString::fromUtf8(kOCIOCDLTransformPluginIdentifier) ) &&
( knobScriptName == QString::fromUtf8(kOCIOCDLTransformParamCCCIDChoice) ) ) &&
!( ( pluginID == QString::fromUtf8(kOCIOFileTransformPluginIdentifier) ) &&
( knobScriptName == QString::fromUtf8(kOCIOFileTransformParamCCCIDChoice) ) ) &&
!( ( pluginID == QString::fromUtf8(PLUGINID_NATRON_PRECOMP) ) &&
( knobScriptName == QString::fromUtf8("writeNode") ) ) &&
!( ( pluginID == QString::fromUtf8(PLUGINID_NATRON_ONEVIEW) ) &&
( knobScriptName == QString::fromUtf8("view") ) ) ) ) ) {
int index = isChoice->getDefaultValue(i);
std::vector<std::string> entries = isChoice->getEntries_mt_safe();
if ( (index >= 0) && ( index < (int)entries.size() ) ) {
Expand All @@ -4484,7 +4520,8 @@ Node::makeDocumentation(bool genHTML) const
if ( !knobHint.isEmpty() ) {
knobHint.append( QString::fromUtf8("<br />") );
}
knobHint.append( tr("Possible values:") + QString::fromUtf8("<br />") );
// "Possible values:" clutters the documentation.
//knobHint.append( tr("Possible values:") + QString::fromUtf8("<br />") );
} else {
// we do a hack for multiline elements, because the markdown->rst conversion by pandoc doesn't use the line block syntax.
// what we do here is put a supplementary dot at the beginning of each line, which is then converted to a pipe '|' in the
Expand All @@ -4495,7 +4532,8 @@ Node::makeDocumentation(bool genHTML) const
}
knobHint.append( QString::fromUtf8("\\\n") );
}
knobHint.append( QString::fromUtf8(". ") + tr("Possible values:") + QString::fromUtf8("\\\n") );
// "Possible values:" clutters the documentation.
//knobHint.append( QString::fromUtf8(". ") + tr("Possible values:") + QString::fromUtf8("\\\n") );
}
first = false;
}
Expand Down
14 changes: 9 additions & 5 deletions Engine/RotoContextPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ CLANG_DIAG_ON(uninitialized)

#define kRotoBrushSourceColor "sourceType"
#define kRotoBrushSourceColorLabel "Source"
#define kRotoBrushSourceColorHint "Source color used for painting the stroke when the Reveal/Clone tools are used:\n" \
"- foreground: the painted result at this point in the hierarchy\n" \
"- background: the original image unpainted connected to bg\n" \
"- backgroundN: the original image unpainted connected to bgN\n"
#define kRotoBrushSourceColorHint "Source color used for painting the stroke when the Reveal/Clone tools are used."
#define kRotoBrushSourceColorOptionForegroundHint "The painted result at this point in the hierarchy."
#define kRotoBrushSourceColorOptionBackgroundHint "The original image unpainted connected to bg."
#define kRotoBrushSourceColorOptionBackgroundNHint "The original image unpainted connected to bg%1."

#define kRotoBrushSizeParam "brushSize"
#define kRotoBrushSizeParamLabel "Brush Size"
Expand Down Expand Up @@ -1528,14 +1528,18 @@ struct RotoContextPrivate
sourceType->setDefaultValue(1);
{
std::vector<std::string> choices;
std::vector<std::string> choicesHelp;
choices.push_back("foreground");
choicesHelp.push_back(tr(kRotoBrushSourceColorOptionForegroundHint).toStdString());
choices.push_back("background");
choicesHelp.push_back(tr(kRotoBrushSourceColorOptionBackgroundHint).toStdString());
for (int i = 1; i < 10; ++i) {
std::stringstream ss;
ss << "background " << i + 1;
choices.push_back( ss.str() );
choicesHelp.push_back(tr(kRotoBrushSourceColorOptionBackgroundNHint).arg(i).toStdString());
}
sourceType->populateChoices(choices);
sourceType->populateChoices(choices, choicesHelp);
}
sourceType->setDefaultAllDimensionsEnabled(false);
clonePage->addKnob(sourceType);
Expand Down

0 comments on commit 092377b

Please sign in to comment.