Nathan (and anyone else who is interested),

Attached is a simple script which demonstrates the update problem. (Note: I did not copy and paste the nodes as text because the views are not copied along with the nodes.)

Use either the views buttons at the top or the views hotkeys (; and ') to switch between the views and you will see that the "ret" _expression_ value updates correctly for the switch (open the switch node in the Properties Bin) - but the view does not.

I am sending this to support, along with an explanation of the problem...

Rich

On Nov 25, 2013, at 08:32 AM, Richard Bobo <richb...@mac.com> wrote:

Nathan,

Agreed. I will try to take some time today to send a bug report.

Rich

Sent from my iPod

On Nov 25, 2013, at 1:01 AM, Nathan Rusch <nathan_ru...@hotmail.com> wrote:

That definitely sounds like an issue worth reporting.
 
-Nathan

 
Sent: Friday, November 22, 2013 7:48 PM
Subject: [Nuke-python] Re: Python _expression_ in Switch node not updating...
 
OK, I think I found a way to make sure that the “ret” value gets used… I added another line to explicitly set the “which” knob value to “ret":

if 'SE_Preferred' in nuke.thisView():
    ret = 0
    nuke.thisKnode.knob(‘which’).setValue(ret)
elif 'Sport' in nuke.thisView():
    ret = 1
    nuke.thisKnode.knob(‘which’).setValue(ret)
elif 'Limited_Tech' in nuke.thisView():
    ret = 2
    nuke.thisKnode.knob(‘which’).setValue(ret)

In any case, just using the “ret” variable did not work very well at all. Setting the knob explicitly with thisNode.knob worked while switching views in Nuke. And rendering on the farm…? Well, that worked too! ...Except for one frame, which was still wrong. Go figure...

So, on Monday, I think I will add one more setValue command to each section and see if hitting it with a hammer twice makes it work 100% of the time for rendering… Maybe I need a bigger hammer…   (8^\

Happy Weekend,
Rich



 
On Nov 22, 2013, at 3:32 PM, Richard Bobo <richb...@mac.com> wrote:

Hi,
 
I'm having a problem with getting an _expression_-driven Switch node to reliably update. And, I'm wondering if this a known problem or if I need to do something different with my _expression_...?
 
-- In my Switch node, I have an _expression_ on the "which" knob like this:
 
if 'SE_Preferred' in nuke.thisView():
 
    ret = 0
elif 'Sport' in nuke.thisView():
    ret = 1
elif 'Limited_Tech' in nuke.thisView():
    ret = 2
 
(Yes, I have all of the _expression_ option buttons turned on for multi-line, Python mode and using the "ret" variable...)
 
So, based on my selected view, the switch should change the knob - and it does... sort of. For example, if I use the views hotkeys to go through all the views, one by one, it switches, but it is always one view change behind. The updating seems to lag - like maybe the Python is being evaluated, but the switch is not updating until the next time around. And, when I render my script on the farm, the switch does not seem to be evaluating correctly at all.
 
Is there some way to force an update on the switch or is this just a bug...?
 
Thanks for any help,
Rich
 

Rich Bobo
Senior VFX Compositor
Armstrong-White
http://armstrong-white.com/
 
Mobile:  (248) 840-2665
Web:  http://richbobo.com/

"The world stands aside to let anyone pass who knows where he is going."
- David Starr Jordan
 
 





 



_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Attachment: Expressions_Update_Bug.nk
Description: Binary data

_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to