FYI, there is now a <node>.format() method that returns the a format object.
Can't remember when it was introduced, but it's fairly recent (6.1v5?)
So you can do something like:
[python nuke.thisNode().format().name()]

...if you just want the name. Or...

[python nuke.thisNode().format().width()]

etc.


On Tue, Mar 22, 2011 at 9:36 AM, Michael Havart <[email protected]>wrote:

> this works on a label:
>
> [python {[format.name() for format in nuke.formats() if
> nuke.thisNode().width() == format.width() and nuke.thisNode().height() ==
> format.height()]}]
>
> don't know how to write that in tcl
>
>
>
> 2011/3/22 Ron Ganbar <[email protected]>
>
>> That's great, Michael.
>> But I'm trying to find something I can use in an expression - not a python
>> script. That would have been the simplest thing to solve Julian's problem.
>>
>>
>>
>> Ron Ganbar
>> email: [email protected]
>> tel: +44 (0)7968 007 309 [UK]
>>      +972 (0)54 255 9765 [Israel]
>> url: http://ronganbar.wordpress.com/
>>
>>
>>
>> On 22 March 2011 18:12, Michael Havart <[email protected]> wrote:
>>
>>> Hi Ron,
>>>
>>> just trying to match the width and height of the node with the width and
>>> height of one of the formats:
>>>
>>> def getFormat(node):
>>>     w,h = int(node.width()), int(node.height())
>>>
>>>     for format in nuke.formats():
>>>         if w == format.width() and h == format.height():
>>>             print node.name()+' has this format: '+format.name()
>>>
>>> getFormat(nuke.selectedNode())
>>>
>>> Michael
>>>
>>>
>>>
>>>
>>> 2011/3/22 Ron Ganbar <[email protected]>
>>>
>>>> Hmmm...
>>>> OK, anyone: is there a way to call up in an expression the current
>>>> format of a node? Not the height and width, but the whole format?
>>>>
>>>>
>>>>
>>>> Ron Ganbar
>>>> email: [email protected]
>>>> tel: +44 (0)7968 007 309 [UK]
>>>>      +972 (0)54 255 9765 [Israel]
>>>> url: http://ronganbar.wordpress.com/
>>>>
>>>>
>>>>
>>>> On 22 March 2011 17:25, Julian Van Mil <[email protected]>wrote:
>>>>
>>>>> maybe... I know absolutely nothing about python :(
>>>>>
>>>>> That of course, is another problem for me entirely.
>>>>>
>>>>> - jvm
>>>>>
>>>>>
>>>>> On 2011-03-22, at 11:13 , Ron Ganbar wrote:
>>>>>
>>>>> Python button and a callback for onCreate?
>>>>>
>>>>>
>>>>> Ron Ganbar
>>>>> email: [email protected]
>>>>> tel: +44 (0)7968 007 309 [UK]
>>>>>      +972 (0)54 255 9765 [Israel]
>>>>> url: http://ronganbar.wordpress.com/
>>>>>
>>>>>
>>>>>
>>>>> On 22 March 2011 17:02, Julian Van Mil <[email protected]>wrote:
>>>>>
>>>>>> thanks for this -  I'm doing something similar right now (just with
>>>>>> reformat nodes... and it works), but I'm trying to get the checkerboard 
>>>>>> to
>>>>>> get drawn initially at the proper res without having to filter it. Any
>>>>>> ideas?
>>>>>>
>>>>>> - jvm
>>>>>>
>>>>>>
>>>>>> On 2011-03-22, at 10:58 , Frank Fieser wrote:
>>>>>>
>>>>>> > This is how I like to do it within my tools...
>>>>>> >
>>>>>> >
>>>>>> > set cut_paste_input [stack 0]
>>>>>> > version 6.1 v2
>>>>>> > CheckerBoard2 {
>>>>>> > inputs 0
>>>>>> > name CheckerBoard1
>>>>>> > selected true
>>>>>> > xpos -625
>>>>>> > ypos -613
>>>>>> > }
>>>>>> > Crop {
>>>>>> > box {0 0 {Gather_Input_Data.myWidth i} {Gather_Input_Data.myHeight
>>>>>> i}}
>>>>>> > reformat true
>>>>>> > crop false
>>>>>> > name Crop_Reformat
>>>>>> > selected true
>>>>>> > xpos -625
>>>>>> > ypos -501
>>>>>> > }
>>>>>> > push $cut_paste_input
>>>>>> > Radial {
>>>>>> > area {512 389 1536 1167}
>>>>>> > name Replace_with_Your_Input
>>>>>> > selected true
>>>>>> > xpos -497
>>>>>> > ypos -569
>>>>>> > }
>>>>>> > NoOp {
>>>>>> > name Gather_Input_Data
>>>>>> > selected true
>>>>>> > xpos -497
>>>>>> > ypos -532
>>>>>> > addUserKnob {20 User}
>>>>>> > addUserKnob {7 myWidth}
>>>>>> > myWidth {{input.width i}}
>>>>>> > addUserKnob {7 myHeight}
>>>>>> > myHeight {{input.height i}}
>>>>>> > }
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On Tue, Mar 22, 2011 at 6:49 AM, Julian Van Mil
>>>>>> > <[email protected]> wrote:
>>>>>> >> I need to create a checkerboard inside a gizmo or group that
>>>>>> inherits the
>>>>>> >> format of Input1. Anyone know how to do this easily? I know I'm
>>>>>> missing
>>>>>> >> something simple here...
>>>>>> >> Thanks,
>>>>>> >> - jvm
>>>>>> >> _______________________________________________
>>>>>> >> Nuke-users mailing list
>>>>>> >> [email protected]
>>>>>> >>
>>>>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>>>>> >>
>>>>>> >>
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > --
>>>>>> > Frank Fieser
>>>>>> > http://www.frankfieser.com
>>>>>> > Compositor, Lighter, Motion Designer
>>>>>> > Los Angeles | 407.963.0710
>>>>>> > _______________________________________________
>>>>>> > Nuke-users mailing list
>>>>>> > [email protected]
>>>>>> > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>>>>>
>>>>>> _______________________________________________
>>>>>> Nuke-users mailing list
>>>>>> [email protected]
>>>>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Nuke-users mailing list
>>>>> [email protected]
>>>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Nuke-users mailing list
>>>> [email protected]
>>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>>>
>>>>
>>>
>>
>
> _______________________________________________
> Nuke-users mailing list
> [email protected]
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>
>
_______________________________________________
Nuke-users mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to