Example #1
0
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;
	}
}
Example #2
0
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;
}