If you create a ReadGeo2 and set its 'file' knob all in one shot, you won’t get 
the dialog popping up; the node will just set itself up to load the first 
available node in the cache. However, you can then inspect the `scene_view` 
knob to get the list of available geometry nodes.

n = nuke.createNode('ReadGeo2', 'file {/path/to/cache_file.abc}')

Cameras are easier, since the `fbx_node_name` knob will only be populated with 
the camera nodes from the file.


-Nathan



From: Johannes Hezer 
Sent: Monday, October 07, 2013 9:27 AM
To: nuke-python@support.thefoundry.co.uk 
Subject: Re: [Nuke-python] How to set up an alembic ReadGeo node?

Hi everyone,

I have a geo and three cameras in one alembic file.
Any have a plan of action to get this imported via python without seeing the 
dialog.

Cheers
Johannes

On 07/22/2013 12:04 PM, Peter Crossley wrote:

  Hi Paul,

  The alembic reader has the concept of imported and selected nodes. For 
example, if an abc file has 10 nodes in total, you could choose to import only 
5 of those, and these would be the only nodes that appear in your Scenegraph 
tab.

  In your case, only the first item is being imported. To remedy this, you need 
to look at the python bindings for the node's scene_view knob (which controls 
the import/selection from the abc file). You need to do the following:

  readGeo = nuke.createNode('ReadGeo2', 'file {alembicFile.abc}') 
  sceneView = readGeo['scene_view']                                             
     

  allItems = sceneView.getAllItems()            # get a list of all nodes 
stored in the abc file
  sceneView.setImportedItems(allItems)    # import all items into the ReadGeo 
node
  sceneView.setSelectedItems(allItems)      # set everything to selected (i.e. 
visible)

  Hope that helps!

  Cheers,

  Peter.

  On 17/07/2013 01:48, nukepython.cali...@neverbox.com wrote:

    My first attempt to create a ReadGeo node looked like this:

    n = nuke.createNode('ReadGeo2')

    n['file'].setValue('alembicFile.abc')



    However, when I set the file knob, I would get a popup dialog that would 
ask the user if they wanted to "Create all-in-one node" or "Create parents as 
separate nodes".



    Wishing to avoid this pop-up dialog, I then tried:



    nuke.createNode('ReadGeo2', 'file {alembicFile.abc}')



    This would, indeed avoid the dialog... but it seems the dialog is 
essential, as the ReadGeo node would not show all the nodes contained in my 
alembic file (it would only show one of four objects in a hierarchical 
structure).



    So... does anyone know what exactly this popup dialog is doing, or how to 
recreate it's effects without requiring user interaction?


    Thanks,
    - Paul

     

_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python


   

_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python



-- 
STUDIO RAKETE GmbH
Johannes Hezer, Compositing TD
Schomburgstr. 120
D - 22767 Hamburg

j.he...@studiorakete.de
Tel:+49 (0)40 - 380 375 69 - 0
Fax:+49 (0)40 - 380 375 69 - 99

------------------------------------------------------
Pflichtangaben laut Handelsgesetzbuch und GmbH-Gesetz:

STUDIO RAKETE GmbH
Schomburgstr. 120 D - 22767 Hamburg

www.studiorakete.de / i...@studiorakete.de

Geschaeftsfuehrer: Jana Bohl / Hans-Martin Rickers

Die Gesellschaft ist eingetragen im Handelregister des
Amtsgerichts Hamburg unter der Nummer HR B 95660
USt.-ID Nr.: DE 245787817


____ ESET 8886 (20131007) ____
The message was checked by ESET Mail Security. 


--------------------------------------------------------------------------------
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to