This is some code I have in a bake expressions script that fixes names so
they are usable.
knobName = "%s.%s" % (nodeName, animCurves[i].knobAndFieldName())
# Need to rebuild the knob name so that it will work in
# the nuke animation call. knobName right now most
# likely would read something like Grade1.blackpoint.r:left.
# If this were the right eye in stereo it would just
# read as Grade1.blackpoint.r which obviously would not
# work. So rename the knob name to something like
# Grade1.blackpoint.left/right.r
knobName = re.sub('%s.%s' % (nodeName, knob.name()), '%s.%s.%s' % (nodeName,
knob.name(), v), knobName)
# In situations were :left or :main is added after the knob
# name.
knobName = re.sub(':.*', '', knobName)
# Do not replace the %s text string in nuke.animation with
# value. "value" should work and it does except when working
# in stereo on views it does NOT! instead just pass the full
# knobName and it will work in stereo and non-stereo Nuke
# scripts.
nuke.animation(knobName, 'generate', [str(start), str(end), str(increment),
'y', '%s' % (knobName)])
On Wed, Mar 30, 2011 at 12:56 AM, Howard Jones <[email protected]>wrote:
> Dear All.
>
> Does anybody know why it is possible to end up with more curves per view
> than there are views?
>
> That is create a stereo project
>
> split off a knob to left right,
> you get 2 curves, knobs etc
>
> knob.le
> knob
>
> split it again and you get
> knob.le
> knob.re
> knob.*
>
> the last one is an extra knob beyond the amount of views you have.
>
> I can understand from a code pov why when you split knobs in the first
> place you get
> knob.le
> knob
> and not
> knob.le
> knob.re
>
> but I cant understand the need for the extra view.
>
> Is this a bug or clever behaviour.
>
> It means btw if you want to know how many views are in a project you have
> to add 1 to the result.
> ie len(nuke.views()) is potentially 1 short unless its safe to ignore the
> extra one.
>
> Howard
>
>
> _______________________________________________
> Nuke-python mailing list
> [email protected]
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python