Author Topic: Problems with a flag option  (Read 3413 times)

dgoodbourn

  • Jr. Member
  • **
  • Posts: 5
Problems with a flag option
« on: February 22, 2012, 04:54:10 PM »
While testing out Qube with Nuke I want to be able to set the 'interactive' flag to True as a default but I'm really struggling with this one! I can set it to true in the nuke_cmdline.py by using the Default=True option, and in the GUI it's ticked but when it comes to render with it, it's not applying the selection. Do I have to apply it somewhere else too? The whole command I'm using is:

cmdjob.add_option( '-i', 'flag', 'with -x or -t use interactive, not render, license', label='interactive', default=True )

Cheers,
Dave.

jburk

  • Administrator
  • *****
  • Posts: 493
Re: Problems with a flag option
« Reply #1 on: March 02, 2012, 07:59:40 PM »
I believe this is a "gotcha" which is a bit of twisted logic (apologies in advance); the default behavior in the GUI is not to include values in the submitted job if they don't deviate from the default value in the submission UI.

You'll also want to pass the 'alwaysUse' argument, and set it to True

Code: [Select]
cmdjob.add_option( '-i', 'flag', 'with -x or -t use interactive, not render, license', label='interactive', default=True, alwaysUse=True )
alwaysUse (bool) - always use arg if True; if False, only if non-default value [default: False]




dgoodbourn

  • Jr. Member
  • **
  • Posts: 5
Re: Problems with a flag option
« Reply #2 on: March 05, 2012, 11:14:03 AM »
Ah perfect, thanks for the help!