My understanding is that attach() is called exactly once for a given node in
the GUI, when that node creates its first Op instance. Depending on the
structure of the DAG, that node may subsequently create and destroy many Op
instances at different times depending on whether you’re dealing with
multiple views, time splitting/sampling, etc. Therefore, relying on the
constructor alone would not be sufficient for scheduling one-time node-level
operations. However, I think checking `if (this == firstOp())` in your
constructor would be a sufficient guard for the "once-per-node" behavior.
-Nathan
From: Johannes Saam
Sent: Thursday, January 22, 2015 12:21 PM
To: Nuke plug-in development discussion
Subject: [Nuke-dev] Order of attach() and test_input()
Hey! i just found out that test_input gets called before attach?! that
sounds strange to me as i would assume we attach the node to the DAG and
then test its inputs. Due to const non const ness i am habing a hard time
dealing with this.
My Op initializes plugins and the entire system in attach which had worked
like a charm so far. Now i realize that the first time test_input is called
is before that?! I can just use a flag and ignore that test_input call the
problem is then though that the next time test_input is called is only when
i pull on the node!? i could move my initialization code to the constructor
but then i am confused to what the benefit for attach is? Can someone
clarify?
THanks!
Jo
_______________________________________________
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