revert own commits 47907, 47908 after some discussion this is really bad and needs some different solution.
This commit is contained in:
@@ -77,11 +77,6 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
|
|||||||
case CMP_SCALE_ABSOLUTE: {
|
case CMP_SCALE_ABSOLUTE: {
|
||||||
ScaleAbsoluteOperation *operation = new ScaleAbsoluteOperation(); // TODO: what is the use of this one.... perhaps some issues when the ui was updated....
|
ScaleAbsoluteOperation *operation = new ScaleAbsoluteOperation(); // TODO: what is the use of this one.... perhaps some issues when the ui was updated....
|
||||||
|
|
||||||
#ifdef USE_SCENE_COMPO_SCALE
|
|
||||||
const RenderData *data = &context->getScene()->r;
|
|
||||||
operation->setRenderPercentage(data->size / 100.0f);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
|
inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
|
||||||
inputXSocket->relinkConnections(operation->getInputSocket(1), 1, graph);
|
inputXSocket->relinkConnections(operation->getInputSocket(1), 1, graph);
|
||||||
inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
|
inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
|
||||||
|
@@ -136,13 +136,8 @@ void ScaleAbsoluteOperation::executePixel(float *color, float x, float y, PixelS
|
|||||||
this->inputXOperation->read(scaleX, x, y, sampler, inputBuffers);
|
this->inputXOperation->read(scaleX, x, y, sampler, inputBuffers);
|
||||||
this->inputYOperation->read(scaleY, x, y, sampler, inputBuffers);
|
this->inputYOperation->read(scaleY, x, y, sampler, inputBuffers);
|
||||||
|
|
||||||
#ifdef USE_SCENE_COMPO_SCALE
|
|
||||||
const float scx = scaleX[0] * this->render_perc; // target absolute scale * render_percentage
|
|
||||||
const float scy = scaleY[0] * this->render_perc; // target absolute scale * render_percentage
|
|
||||||
#else
|
|
||||||
const float scx = scaleX[0]; // target absolute scale
|
const float scx = scaleX[0]; // target absolute scale
|
||||||
const float scy = scaleY[0]; // target absolute scale
|
const float scy = scaleY[0]; // target absolute scale
|
||||||
#endif
|
|
||||||
|
|
||||||
const float width = this->getWidth();
|
const float width = this->getWidth();
|
||||||
const float height = this->getHeight();
|
const float height = this->getHeight();
|
||||||
|
@@ -48,11 +48,6 @@ class ScaleAbsoluteOperation : public NodeOperation {
|
|||||||
float centerX;
|
float centerX;
|
||||||
float centerY;
|
float centerY;
|
||||||
|
|
||||||
#ifdef USE_SCENE_COMPO_SCALE
|
|
||||||
/* scene->r.size / 100.0f */ /* added after 2.63, this may be done differently/better */
|
|
||||||
float render_perc;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScaleAbsoluteOperation();
|
ScaleAbsoluteOperation();
|
||||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
||||||
@@ -60,10 +55,6 @@ public:
|
|||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|
||||||
#ifdef USE_SCENE_COMPO_SCALE
|
|
||||||
void setRenderPercentage(float render_perc) { this->render_perc = render_perc; }
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ScaleFixedSizeOperation : public NodeOperation {
|
class ScaleFixedSizeOperation : public NodeOperation {
|
||||||
|
@@ -37,9 +37,6 @@
|
|||||||
/* XXX, temp feature - campbell */
|
/* XXX, temp feature - campbell */
|
||||||
#define DURIAN_CAMERA_SWITCH
|
#define DURIAN_CAMERA_SWITCH
|
||||||
|
|
||||||
/* XXX - We cant agree on this and it might get deprecated - campbell */
|
|
||||||
#define USE_SCENE_COMPO_SCALE
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@@ -49,12 +49,11 @@ static bNodeSocketTemplate cmp_node_scale_out[]= {
|
|||||||
/* node->custom1 stores if input values are absolute or relative scale */
|
/* node->custom1 stores if input values are absolute or relative scale */
|
||||||
static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
|
static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
|
||||||
{
|
{
|
||||||
RenderData *rd = data;
|
|
||||||
|
|
||||||
if (out[0]->hasoutput==0)
|
if (out[0]->hasoutput==0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (in[0]->data) {
|
if (in[0]->data) {
|
||||||
|
RenderData *rd = data;
|
||||||
CompBuf *stackbuf, *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
|
CompBuf *stackbuf, *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
|
||||||
ImBuf *ibuf;
|
ImBuf *ibuf;
|
||||||
int newx, newy;
|
int newx, newy;
|
||||||
@@ -115,13 +114,9 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b
|
|||||||
int a, x, y;
|
int a, x, y;
|
||||||
float *fp;
|
float *fp;
|
||||||
|
|
||||||
#ifdef USE_SCENE_COMPO_SCALE
|
|
||||||
x = MAX2((int)in[1]->vec[0], 1) * (rd->size / 100.0f);
|
|
||||||
y = MAX2((int)in[2]->vec[0], 1) * (rd->size / 100.0f);
|
|
||||||
#else
|
|
||||||
x = MAX2((int)in[1]->vec[0], 1);
|
x = MAX2((int)in[1]->vec[0], 1);
|
||||||
y = MAX2((int)in[2]->vec[0], 1);
|
y = MAX2((int)in[2]->vec[0], 1);
|
||||||
#endif
|
|
||||||
stackbuf = alloc_compbuf(x, y, CB_RGBA, 1);
|
stackbuf = alloc_compbuf(x, y, CB_RGBA, 1);
|
||||||
fp = stackbuf->rect;
|
fp = stackbuf->rect;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user