Problem summary
Creating ReadGeo2 nodes via Python with a file path doesn't load multipart alembic .abc files correctly.
Toggling "always load abc files as all-in-one" doesn't seem to make any difference.
Steps to reproduce
1) Download the attached snowman.abc file
2) Open Nuke
3) Run the below command in the script editor twice, toggling "always load abc files as all-in-one" between executions. With "always load abc files as all-in-one" inactive, then it loads nothing, and when active, it loads all of the snowman model. This is the expected behaviour.
node = nuke.nodes.ReadGeo2()node['file'].setValue("path/to/snowman.abc")
4) Run the below command in the script editor twice, toggling "always load abc files as all-in-one" between executions. With "always load abc files as all-in-one" inactive, then it loads the base sphere, and when active, it still only loads the base sphere.
nuke.nodes.ReadGeo2(file="path/to/snowman.abc")
Using the below command also had the same issue:
nuke.createNode( "ReadGeo2", "file path/to/snowman.abc" )
Workaround
It is possible to select all of the contained alembic data using the scene_view's setAllItems() knob parameter to 'true'.
As per this example snippet:
n = nuke.createNode("ReadGeo2", "file path/to/snowman.abc")n["scene_view"].setAllItems(n["scene_view"].getAllItems(), True)
If using terminal mode, then the above workaround will not work, so you need to for the 3D node to full load by executing a node, like a WriteGeo:
geo = nuke.nodes.ReadGeo2() geo['file'].setValue('path/to/snowman.abc') print(geo["scene_view"].getSelectedItems()) ### See nothing is loadedwriteGeo = nuke.nodes.WriteGeo() writeGeo['file'].setValue('null.null') writeGeo.setInput(0, geo) nuke.execute(writeGeo, 1, 1) ### Force the 3D scene to evaluate, even though no file is being creatednuke.delete(writeGeo) ### Cleanupgeo["scene_view"].setAllItems(geo["scene_view"].getAllItems(), True) print(geo["scene_view"].getSelectedItems()) ### Now all the objects are loaded
Reproduced by support
This problem has been reproduced on:
Nuke 10.5v1 - Windows 10 - CentOS 6.8
Nuke 10.0v5 - Windows 10
Nuke 10.0v1 - Windows 10
Nuke 9.0v9 - Windows 10 - CentOS 6.8
Nuke 9.0v4 - Windows 10
Expected behaviour
For all commands to produce the same results
Actual behaviour
They didn't