bool ValuePlug::settable() const { if( getFlags( ReadOnly ) ) { return false; } if( getInput<Plug>() ) { return false; } if( const Process *process = Process::current() ) { return process->type() == ComputeProcess::staticType && process->plug() == this; } else { if( direction() != Plug::In ) { return false; } for( PlugIterator it( this ); !it.done(); ++it ) { ValuePlug *valuePlug = IECore::runTimeCast<ValuePlug>( it->get() ); if( !valuePlug || !valuePlug->settable() ) { return false; } } return true; } }
bool CompoundPlug::settable() const { ChildContainer::const_iterator it, eIt; for( it=children().begin(), eIt=children().end(); it!=eIt; ++it ) { ValuePlug *valuePlug = IECore::runTimeCast<ValuePlug>( it->get() ); if( !valuePlug || !valuePlug->settable() ) { return false; } } return true; }