Ok, now that I'm back at the studio and trying to actually make this thing work:

camera.forceValidate() seems to load the file, but not really. I get the 
fbx_take_name and fbx_node_name lists from the file, but if I set them, nothing 
happens. The lens is incorrect, matrix and translations not set, etc.  Even 
after doing a camera.forceValidate() after each operation.

Using the same commands in the GUI works fine.

Any other ideas?

jrab


On Apr 21, 2012, at 10:28 AM, John RA Benson wrote:

> Fantastic! Yes, there's a lot of actions I need to do after that, but none 
> would work unless the camera loaded. Pretty useful function to get the hash 
> updated too.
> 
> I really need to update my docs link to the 6.3x versions...
> 
> Many many thanks!!!
> JRAB
> 
> On Apr 20, 2012, at 7:24 PM, Ivan Busquets wrote:
> 
>> Hi John,
>> 
>> Try:
>> 
>> camera = nuke.createNode('Camera2', 'read_from_file true file %s' % fbxfile)
>> followed by:
>> camera.forceValidate()
>> 
>> You'll probably need to manually set the fbx_node_name knob to the actual 
>> camera you want as well.
>> 
>> Hope that helps.
>> 
>> On Fri, Apr 20, 2012 at 10:12 AM, John RA Benson 
>> <[email protected]> wrote:
>> Hey there -
>> 
>> I'm trying to load an fbx file in a terminal session - trying to script an 
>> automatic process. I'm stumped at setting up my camera.
>> 
>> > nuke -t
>> 
>> fbxfile = '/path/to/fbxfile.fbx'
>> camera = nuke.createNode('Camera2')
>> camera['read_from_file'].setValue(True)
>> camera['file'].setValue(fbxfile)
>> 
>> doesn't load it, neither does
>> 
>> camera = nuke.createNode('Camera2', 'read_from_file true file %s' % fbxfile)
>> 
>> The file knob is set, but it's not loaded so I can't really do much after 
>> that. Any ideas?
>> Both of those work from the GUI, but the idea is to run this in a script.
>> 
>> Thanks
>> JRAB
>> _______________________________________________
>> 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