Peter, thanks! forceValidate was what I was looking for. 

Jake 

----- Original Message -----

| From: "Peter Crossley" <[email protected]>
| To: "Nuke Python discussion" <[email protected]>
| Sent: Friday, July 24, 2015 7:00:33 AM
| Subject: Re: [Nuke-python] Waiting on dynamic knob creation

| Hi Jake,

| This is because of how format-specific knobs are created.

| For our read nodes (both geometry and image), the nuke plugin
| (ReadGeo2 in this case) creates a reader plugin (abcReader in this
| case) once it knows what type of file it will be reading.

| The read_on_each_frame knob belongs to the reader, rather than
| ReadGeo2. At the point you're trying to set the knob value, the
| reader hasn't yet been created, so the knob doesn't exist yet.

| To fix this, you just need to add

| copyRG.forceValidate()

| before

| copyRG['read_on_each_frame'].setValue(False)

| Hope that helps,

| Peter.

| On 23/07/2015 21:07, Jake Richards wrote:

| | Hello:
| 
| | I am trying to link the file knob of a ReadGeo2 node to another
| | ReadGeo2 node and then set some of the dynamically created knobs
| | but
| | the issue I'm running into is that the python script is executing
| | before the knobs appear.
| 
| | Example:
| 

| | readSrc = nuke.nodes.ReadGeo2(file="/var/tmp/hat.abc")
| 

| | copyRG = nuke.nodes.ReadGeo2()
| 
| | copyRG['file'].setValue("[value %s.file]" % readSrc.fullName())
| 
| | copyRG['read_on_each_frame'].setValue(False)
| 

| | NameError: knob read_on_each_frame does not exist
| 

| | The issue is that the read_on_each_frame checkbox doesn't exist
| | until
| | the file name is filled out. Is there a function I can use to tell
| | nuke to wait for the knob to exist before I set it's value?
| 
| | Also, this appears to be a problem since the file knob is an
| | expression, if I set the value to a specific file, there is no
| | error.
| 

| | Thank you!
| 
| | Jake
| 

| | --
| 

| | --
| 
| | --------------------------------------------
| 
| | [email protected] 203-992-6319
| 
| | LTD Blue Sky Studios
| 
| | --------------------------------------------
| 

| | _______________________________________________
| 
| | Nuke-python mailing list [email protected] ,
| | http://forums.thefoundry.co.uk/
| | http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
| 
| _______________________________________________
| Nuke-python mailing list
| [email protected], http://forums.thefoundry.co.uk/
| http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to