| 2236 | } |
| 2237 | |
| 2238 | void |
| 2239 | Node::initializeDefaultKnobs(bool loadingSerialization) |
| 2240 | { |
| 2241 | //Readers and Writers don't have default knobs since these knobs are on the ReadNode/WriteNode itself |
| 2242 | #ifdef NATRON_ENABLE_IO_META_NODES |
| 2243 | NodePtr ioContainer = getIOContainer(); |
| 2244 | #endif |
| 2245 | |
| 2246 | //Add the "Node" page |
| 2247 | KnobPagePtr settingsPage = AppManager::createKnob<KnobPage>(_imp->effect.get(), tr(NATRON_PARAMETER_PAGE_NAME_EXTRA), 1, false); |
| 2248 | _imp->nodeSettingsPage = settingsPage; |
| 2249 | |
| 2250 | //Create the "Label" knob |
| 2251 | Backdrop* isBackdropNode = dynamic_cast<Backdrop*>( _imp->effect.get() ); |
| 2252 | QString labelKnobLabel = isBackdropNode ? tr("Name label") : tr("Label"); |
| 2253 | createLabelKnob( settingsPage, labelKnobLabel.toStdString() ); |
| 2254 | |
| 2255 | if (isBackdropNode) { |
| 2256 | //backdrops just have a label |
| 2257 | return; |
| 2258 | } |
| 2259 | |
| 2260 | |
| 2261 | ///find in all knobs a page param to set this param into |
| 2262 | const KnobsVec & knobs = _imp->effect->getKnobs(); |
| 2263 | |
| 2264 | findPluginFormatKnobs(knobs, loadingSerialization); |
| 2265 | findRightClickMenuKnob(knobs); |
| 2266 | |
| 2267 | KnobPagePtr mainPage; |
| 2268 | |
| 2269 | |
| 2270 | // Scan all inputs to find masks and get inputs labels |
| 2271 | //Pair hasMaskChannelSelector, isMask |
| 2272 | int inputsCount = getNInputs(); |
| 2273 | std::vector<std::pair<bool, bool> > hasMaskChannelSelector(inputsCount); |
| 2274 | std::vector<std::string> inputLabels(inputsCount); |
| 2275 | for (int i = 0; i < inputsCount; ++i) { |
| 2276 | inputLabels[i] = _imp->effect->getInputLabel(i); |
| 2277 | |
| 2278 | assert( i < (int)_imp->inputsComponents.size() ); |
| 2279 | bool isMask = _imp->effect->isInputMask(i); |
| 2280 | bool supportsOnlyAlpha = isInputOnlyAlpha(i); |
| 2281 | |
| 2282 | hasMaskChannelSelector[i].first = false; |
| 2283 | hasMaskChannelSelector[i].second = isMask; |
| 2284 | |
| 2285 | if ( (isMask || supportsOnlyAlpha) && |
| 2286 | !_imp->effect->isInputRotoBrush(i) ) { |
| 2287 | hasMaskChannelSelector[i].first = true; |
| 2288 | if (!mainPage) { |
| 2289 | mainPage = getOrCreateMainPage(); |
| 2290 | } |
| 2291 | } |
| 2292 | } |
| 2293 | |
| 2294 | bool requiresLayerShuffle = _imp->effect->getCreateChannelSelectorKnob(); |
| 2295 |
nothing calls this directly
no test coverage detected