Ah - fabulous! Thanks for that tip - that will certainly help me out here...

Really should be available natively in Python, though....


Hugh

On 08/11/11 22:50, Adrian Baltowski wrote:
Hi

There is funny workaround for this problem:

n = nuke.createNode("EdgeBlur")
a = n['quality']
knob = (n.name() + '.' + a.name())
print nuke.tcl('knob', '-t', knob)

Above code returns the knob's ID (in this case 3) defined as enum in Knobs.h:


     enum {
       OBSOLETE_KNOB = 0, // ignored when read from scripts
       STRING_KNOB,    // char* pointer
       FILE_KNOB,    // char* pointer, has file chooser
       INT_KNOB,    // int
       ENUMERATION_KNOB, // popup list, sets int to index
       BITMASK_KNOB,    // int, one button for each bit
       BOOL_KNOB,    // checkbox
       DOUBLE_KNOB,    // double
       FLOAT_KNOB,    // float
       ARRAY_KNOB,    // 2Darray of floats for Convolve
       CHANNEL_MASK_KNOB, // ChannelSet
       CHANNEL_KNOB,    // 1-4 Channel numbers
       XY_KNOB,    // 2 numbers for x,y position, draws crosshair
       XYZ_KNOB,    // 3 numbers for x,y,z position - not proxy scaled
       WH_KNOB,    // 1 or 2 numbers for width and height
       BBOX_KNOB,    // 4 numbers for x,y,r,t of a rectangle
       SIZE_KNOB,    // obsolete, same as FLOAT_KNOB
       FORMAT_KNOB,    // Store formats into the info_
       COLOR_KNOB,    // r,g,b
       ACOLOR_KNOB,    // r,g,b,a
       TAB_KNOB,    // start a new tab
       CUSTOM_KNOB,    // you called constructor yourself
       PYSCRIPT_KNOB, // Button that runs a python script
       TEXT_EDITOR_KNOB, // same as MULTILINE_STRING_KNOB
       TRANSFORM2D_KNOB, // A 4x4 transformation matrix with a 2-d affine xform
       SPACER_KNOB,
       TEXT_KNOB,    // helpful text caption
       HELP_KNOB,    // [?] button with helpful text
       MULTILINE_STRING_KNOB, // multi-line text editor
       AXIS_KNOB,    // 3D 6-DOF transformation
       UV_KNOB,    // 2 numbers
       BOX3_KNOB,    // 2 3D points describing a 3D volume
       SCRIPT_KNOB,    // Button that runs a tcl script
       LOOKUPCURVES_KNOB, // A set of lookup curves
       TOOLTIP_KNOB,    // Obsolete set-tooltip call!
       PULLDOWN_KNOB, // A pulldown menu to run TCL scripts
       EYEDROPPER_KNOB, // Eyedropper for color sampling and color averaging 
from viewer
       RANGE_KNOB,    // A slider with multiple non-overlapping values
       HISTOGRAM_KNOB, // GUI interface for Histogram function
       KEYER_KNOB,    // GUI interface to a trapezoid function
       COLORCHIP_KNOB, // For picking a user-interface color
       LINK_KNOB,        // For soft linking a knob to another knob
       SCALE_KNOB,    // One or two numbers
       MULTILINE_EVAL_STRING_KNOB, // Same as MULTILINE_STRING_KNOB
       ONEVIEW_KNOB,
       MULTIVIEW_KNOB,
       VIEWVIEW_KNOB,
       PYPULLDOWN_KNOB, // A pulldown menu to run Python scripts
       GPUENGINE_KNOB,
       MULTIARRAY_KNOB,
       VIEWPAIR_KNOB,
       LIST_KNOB,
       PYTHON_KNOB,
       METADATA_KNOB,
       PIXELASPECT_KNOB,
       CP_KNOB,        // rappresent a roto curve control points
       TOOLBAR_KNOB,
       TABGROUP_KNOB,
       PLUGIN_PYTHON_KNOB,      // A user-created knob, with user-provided 
python bindings.
       EXOGROUP_KNOB,
       MENU_KNOB,      // A knob which provides a button that opens a menu.
       PASSWORD_KNOB, // string_knob with password field
       TOOLBOX_KNOB,
       TABLE_KNOB,
       GEOSELECT_KNOB,
       INPUTONLY_CHANNEL_MASK_KNOB, // same as ChannelSet, but input only
       INPUTONLY_CHANNEL_KNOB,    // same as ChannelKnob, but inputs only
       CONTROL_POINT_COLLECTION_KNOB,
       CASCADING_ENUMERATION_KNOB, // same as ENUMERATION_KNOB but allows 
cascading menus
       DYNAMIC_BITMASK_KNOB,
       META_KEY_FRAME_KNOB,
       POSITIONVECTOR_KNOB,
       CACHED_FILE_KNOB, // same as file knob but allows localisation
       TRANSFORM_JACK_KNOB,
       RIPPLE_KNOB,
       LAST_KNOB
     };



Best
Adrian







W dniu 2011-11-07 18:07:30 użytkownik Hugh Macdonald<[email protected]> 
 napisał:
Cheers Josh,

  My hacky solution to this, as I know I'll only be doing this on     gizmos, 
is to call makeGroup() on it, and then call     
writeKnobs(nuke.WRITE_USER_KNOB_DEFS) on it

, and     parse the output, which includes the integer for the knob type...


  Hugh

  On 07/11/11 12:36, Josh Imbruglia wrote:

Hi Hugh,

It looks to me that they've done away wit the Int and Double knob
subclasses in 6.3. I believe the only way to know would be to query
the flags for the knob but i don't see a way to do that. If you test
the type of the values of both of the knobs they both return floats so
that's no indication either. So no I don't think there is currently a
way to decipher between an int and float knob in Nuke at the present
time.

Josh

On Sat, Nov 5, 2011 at 7:55 PM, Hugh Macdonald
<[email protected]>  wrote:


Hi,
I'm trying to interrogate a node to find out more details of what its knobs
are... However, I'm currently finding that, for a number of different knob
types, I'm just getting Array_Knob as the class...
For example, try the following:
n = nuke.createNode("EdgeBlur")
print n['quality'].Class() # Should be Int_Knob, actually gives Array_Knob
print n['edge_mult'].Class() # Should be Double_Knob, actually gives
Array_Knob

Is this a bug? And does anyone know how I can get at the actual type of
these knobs...?
Cheers
Hugh Macdonald
nvizible&ndash;VISUAL EFFECTS

[email protected]
+44(0) 20 3167 3860
+44(0) 7773 764 708

www.nvizible.com

_______________________________________________
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

_______________________________________________
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