That seems to work!
By adding this method to my node's class:
int PointSample::knob_changed(Knob* k)
{
knob("tile_color")->set_value(0x00ff0000);
return 1;
}
the node is now green straight-away upon creation. The only downside
is the moment you touch any knob, it's going to pop right back to
green again! haha, a great prank to be sure, but probably not the
ideal solution.
I wonder though, would it be possible to implement it in the build function?
Currently it is:
static Iop* build(Node *node)
{
return (new NukeWrapper(new PointSample(node)));
}
But could we do something like this? This will break, because I'm not
sure how to correctly code it.
static Iop* build(Node *node)
{
new NukeWrapper b = (new PointSample(node));
b.knob("tile_color")->set_value(0x00ff0000);
return b;
}
On Mon, May 21, 2012 at 7:11 PM, Ivan Busquets <[email protected]> wrote:
> There's node_color() -- defined in Op.h --, but I think that one has been
> broken for some time.
>
> Depending on when you need your tile color to change, you should be able to
> change it like any other knob, with the exception that you'll need to call
> node_redraw() to force it to be redrawn with the new color in the DAG.
>
> knob("tile_color")->set_value(0x00ff0000); // green
> node_redraw();
>
> I'm not sure it's safe to do that anywhere other than within a
> knob_changed(), though. But you can give it a try.
>
>
>
> On Sun, May 20, 2012 at 10:39 PM, Jordan Olson <[email protected]> wrote:
>>
>> hey guys!
>> Despite searching the docs (even with an external Google) I can't
>> figure out how to set a node's tile_color in the nodegraph- it's easy
>> as with python, but how would you do this on a compiled node? I don't
>> even know what class to look at, Iop doesn't seem to have it.
>> cheers,
>> Jordan
>> _______________________________________________
>> Nuke-dev mailing list
>> [email protected], http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>
>
>
> _______________________________________________
> Nuke-dev mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev