both splitView and unsplitView seem to work as expected for me (osx Nuke 7.0v2).

On 1/8/13 10:07 PM, Ben Dickson wrote:
Am I doing something silly, or is unsplitView(view=...) buggy?

I want to "explode" a node with split parameters into a "left" and a "right node"

So I tried:

knob = nuke.selectedNode()['size']
knob.unsplitView("left")

..which drops the right-eye value as expected. However:

knob.unsplitView("right")

..does nothing. Also tried using an integer for the view,

knob.unsplitView(0)
knob.unsplitView(1)
knob.unsplitView(2)

..but none of these seem to do anything sensible.


The workarounds I've found didn't really work:

1. Manually copy the parameters over, handling all the cases like a single value, expressions, animated, 2D-pos/RGB knob with differing values etc. Possible, but a lot of work

2. Use toScript to serialise the values for each eye, then restore with fromScript.. However if I specify an OutputContext() with the view set, I only get one frame of values:

ctx = nuke.OutputContext()
ctx.setView(view_idx + 1)

# Serialise knob in correct view
scriptval = knob.toScript(context = ctx)

# Unsplit and shove serialised value into new node's knob
newnodes[view][kname].unsplitView()
newnodes[view][kname].fromScript(scriptval)

I could parse the knob.toScript() and remove the other eye with string-processing, but.. that's awful.

_______________________________________________
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