@@ -124,16 +124,6 @@ void MixNode::convertToOperations(ExecutionSystem *graph, CompositorContext *con
|
||||
convertProg->setUseValueAlphaMultiply(useAlphaPremultiply);
|
||||
convertProg->setUseClamp(useClamp);
|
||||
|
||||
if (color1Socket->isConnected()) {
|
||||
convertProg->setResolutionInputSocketIndex(1);
|
||||
}
|
||||
else {
|
||||
if (color2Socket->isConnected())
|
||||
convertProg->setResolutionInputSocketIndex(2);
|
||||
else
|
||||
convertProg->setResolutionInputSocketIndex(0);
|
||||
}
|
||||
|
||||
valueSocket->relinkConnections(convertProg->getInputSocket(0), 0, graph);
|
||||
color1Socket->relinkConnections(convertProg->getInputSocket(1), 1, graph);
|
||||
color2Socket->relinkConnections(convertProg->getInputSocket(2), 2, graph);
|
||||
|
||||
@@ -63,6 +63,30 @@ void MixBaseOperation::executePixel(float output[4], float x, float y, PixelSamp
|
||||
output[3] = inputColor1[3];
|
||||
}
|
||||
|
||||
void MixBaseOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
|
||||
{
|
||||
InputSocket *socket;
|
||||
unsigned int tempPreferredResolution[2] = {0, 0};
|
||||
unsigned int tempResolution[2];
|
||||
|
||||
socket = this->getInputSocket(1);
|
||||
socket->determineResolution(tempResolution, tempPreferredResolution);
|
||||
if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
|
||||
this->setResolutionInputSocketIndex(1);
|
||||
}
|
||||
else {
|
||||
socket = this->getInputSocket(2);
|
||||
socket->determineResolution(tempResolution, tempPreferredResolution);
|
||||
if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
|
||||
this->setResolutionInputSocketIndex(2);
|
||||
}
|
||||
else {
|
||||
this->setResolutionInputSocketIndex(0);
|
||||
}
|
||||
}
|
||||
NodeOperation::determineResolution(resolution, preferredResolution);
|
||||
}
|
||||
|
||||
void MixBaseOperation::deinitExecution()
|
||||
{
|
||||
this->m_inputValueOperation = NULL;
|
||||
|
||||
@@ -70,6 +70,9 @@ public:
|
||||
* Deinitialize the execution
|
||||
*/
|
||||
void deinitExecution();
|
||||
|
||||
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
|
||||
|
||||
|
||||
void setUseValueAlphaMultiply(const bool value) { this->m_valueAlphaMultiply = value; }
|
||||
bool useValueAlphaMultiply() { return this->m_valueAlphaMultiply; }
|
||||
|
||||
Reference in New Issue
Block a user