MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / knobChanged

Method knobChanged

Engine/WriteNode.cpp:1155–1255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1153}
1154
1155bool
1156WriteNode::knobChanged(KnobI* k,
1157 ValueChangedReasonEnum reason,
1158 ViewSpec view,
1159 double time,
1160 bool originatedFromMainThread)
1161{
1162 assert(k);
1163 if (!k) {
1164 return false;
1165 }
1166 bool ret = true;
1167 NodePtr writer = _imp->embeddedPlugin.lock();
1168
1169 if ( ( k == _imp->outputFileKnob.lock().get() ) && (reason != eValueChangedReasonTimeChanged) ) {
1170 if (_imp->creatingWriteNode) {
1171 if (writer) {
1172 writer->getEffectInstance()->knobChanged(k, reason, view, time, originatedFromMainThread);
1173 }
1174
1175 return false;
1176 }
1177
1178 NodePtr hasMaster = getNode()->getMasterNode();
1179 if (hasMaster) {
1180 unslaveAllKnobs();
1181 }
1182 try {
1183 _imp->refreshPluginSelectorKnob();
1184 } catch (const std::exception& e) {
1185 setPersistentMessage( eMessageTypeError, e.what() );
1186 }
1187
1188 KnobOutputFilePtr fileKnob = _imp->outputFileKnob.lock();
1189 assert(fileKnob);
1190 std::string filename = fileKnob->getValue();
1191
1192 try {
1193 _imp->createWriteNode( false, filename, NodeSerializationPtr() );
1194 } catch (const std::exception& e) {
1195 setPersistentMessage( eMessageTypeError, e.what() );
1196 }
1197 if (hasMaster) {
1198 slaveAllKnobs(hasMaster->getEffectInstance().get(), false);
1199 }
1200 } else if ( k == _imp->pluginSelectorKnob.lock().get() ) {
1201 KnobStringPtr pluginIDKnob = _imp->pluginIDStringKnob.lock();
1202 std::string entry = _imp->pluginSelectorKnob.lock()->getActiveEntry().id;
1203 if ( entry == pluginIDKnob->getValue() ) {
1204 return false;
1205 }
1206
1207 if (entry == "Default") {
1208 entry.clear();
1209 }
1210
1211 pluginIDKnob->setValue(entry);
1212

Callers

nothing calls this directly

Calls 15

getEffectInstanceMethod · 0.80
getMasterNodeMethod · 0.80
createWriteNodeMethod · 0.80
getActiveEntryMethod · 0.80
replaceInputMethod · 0.80
getNameMethod · 0.80
getNodeFunction · 0.70
lockMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected