fyi: - forceValidate is only on 6.3x
and depending on how you use it, it might not work.
Bug #27579- node.forceValidate() function seems to be broken
While it populates something, it's a default camera - not your specific camera.
It does work in the GUI via the script editor, but it's probably not going to
work in a script. The last time I brought this up, it was funny to see the
values from Ivan's random example matched mine - which were not the correct
values from either camera. If you get the same values for any camera you use,
add your voice to support...
Also: feature request for an arg or flag or option to turn off all GUI pop-up
messages as Feature #27580.
jrab
On Jun 27, 2012, at 3:19 AM, Nathan Rusch wrote:
> c = nuke.createNode('Camera2', 'file {/path/to/some/file.fbx} read_from_file
> True', inpanel=False)
> c.forceValidate()
> fbxNodes = c['fbx_node_name'].values()
>
> Note that if you create the node with inpanel=False (as shown above), the FBX
> node list will not be updated properly unless you call .forceValidate() on
> the node or use some other method to trigger a refresh. Alternatively, if you
> create the node without inpanel=False, the list will update on creation.
>
>
> -Nathan
>
> -----Original Message----- From: Vincent Langer
> Sent: Tuesday, June 26, 2012 7:24 AM
> To: [email protected]
> Subject: [Nuke-python] How to handle choise Values/ Camera from file
>
> Hi there,
>
> i am trying to do a little auto stereoCam import script from one fbx
> file that simple finds the left and the right camera and sets a basic
> 3dScene.
>
>
> in the camera properties under the file tab
> the value that i get from the choise variable ( ['fbx_node_name'] )is
> a string and looks like this:
>
> '{0} "Producer Perspective" "Producer Top" "Producer Bottom" "Producer
> Front" "Producer Back" "Producer Right" "Producer Left"
> StereoCamera_Left StereoCamera_Right'
>
> is there an easy way to convert the enumeration of cameras to a list?
>
>
> AND the second MORE important problem:
>
> when i use nuke.nodes.Camera2() to create the camera and set the
> variables i can not access the ['fbx_node_name'] value.
>
> and when i create camera with nuke.createNode("Camera2")
> and set
> cam['read_from_file'].setValue(True)
> cam['file'].setValue(filepath)
>
> A window pops up: "Are you sure you want to read the camera from the
> file and destroy the current camera data? OK / Cancel"
>
>
> would be awesome if someone could tell me how to update the camera
> values with nuke.nodes.Camera2() or make the
> nuke.createNode("Camera2") camera ignore the poping window.
>
> cheers,
> vincent
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> _______________________________________________
> 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