Beispiel #1
0
void ColorSpillNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
{
	InputSocket *inputSocketImage = this->getInputSocket(0);
	InputSocket *inputSocketFac = this->getInputSocket(1);
	OutputSocket *outputSocketImage = this->getOutputSocket(0);

	bNode *editorsnode = getbNode();

	
	ColorSpillOperation *operation;
	if (editorsnode->custom2 == 0) {
		// Simple color spill
		operation = new ColorSpillOperation();
	}
	else {
		// Average color spill
		operation = new ColorSpillAverageOperation();
	}
	operation->setSettings((NodeColorspill *)editorsnode->storage);
	operation->setSpillChannel(editorsnode->custom1 - 1); // Channel for spilling
	

	inputSocketImage->relinkConnections(operation->getInputSocket(0), 0, graph);
	inputSocketFac->relinkConnections(operation->getInputSocket(1), 1, graph);
	
	outputSocketImage->relinkConnections(operation->getOutputSocket());
	graph->addOperation(operation);
}
void ColorSpillNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
{
	bNode *editorsnode = getbNode();
	
	NodeInput *inputSocketImage = this->getInputSocket(0);
	NodeInput *inputSocketFac = this->getInputSocket(1);
	NodeOutput *outputSocketImage = this->getOutputSocket(0);
	
	ColorSpillOperation *operation;
	if (editorsnode->custom2 == 0) {
		// Simple color spill
		operation = new ColorSpillOperation();
	}
	else {
		// Average color spill
		operation = new ColorSpillAverageOperation();
	}
	operation->setSettings((NodeColorspill *)editorsnode->storage);
	operation->setSpillChannel(editorsnode->custom1 - 1); // Channel for spilling
	converter.addOperation(operation);
	
	converter.mapInputSocket(inputSocketImage, operation->getInputSocket(0));
	converter.mapInputSocket(inputSocketFac, operation->getInputSocket(1));
	converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket());
}
void ColorSpillNode::convertToOperations(NodeConverter &converter,
                                         const CompositorContext & /*context*/) const
{
  bNode *editorsnode = getbNode();

  NodeInput *inputSocketImage = this->getInputSocket(0);
  NodeInput *inputSocketFac = this->getInputSocket(1);
  NodeOutput *outputSocketImage = this->getOutputSocket(0);

  ColorSpillOperation *operation;
  operation = new ColorSpillOperation();
  operation->setSettings((NodeColorspill *)editorsnode->storage);
  operation->setSpillChannel(editorsnode->custom1 - 1);  // Channel for spilling
  operation->setSpillMethod(editorsnode->custom2);       // Channel method
  converter.addOperation(operation);

  converter.mapInputSocket(inputSocketImage, operation->getInputSocket(0));
  converter.mapInputSocket(inputSocketFac, operation->getInputSocket(1));
  converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket());
}