Many of us have been fighting this for years.
One of the quick& (very) dirty workarounds is to create a dummy node that can be executed (i.e. CurveTool), execute it to force Nuke to re-evaluate the stream, then delete it. Do this for every iteration/frame and you should get the correct values if I remember correctly. I don't think the dummy node has to be connected to the nodes you are working with but haven't done this in a while myself.

Afterwards don't forget to log a bug report to get this resolved finally. Maybe we could ask for a flag to set that forces Nuke to re-evaluate during a python loop, then set another flag to turn off that behaviour again if it means staying more efficient.

Cheers,
frank

On 27/02/14 06:35, Elias Ericsson Rydberg wrote:
Maybe you could force it by adding a writegeo downstream. I would imagine that 
would make nuke evaluate geometry positions upstream?

Maybe adding the positions as metadata in the stream could be a valid 
alternative.

Cheers,
Elias

26 feb 2014 kl. 12:56 skrev Carl Schröter <ad...@l-rac.de>:

Hi guys,

I've been experimenting with vertexSelection lately (in nuke7) and noticed 
something strange (at least it seems strange to me).

When I run the code below on selected vertices of an animated abc file, Nuke 
does not update the vertex-position values in the loop. However, if gives me 
the correct position when I execute it on single frames. To make it even 
stranger: when I connect a scene-node to the ReadGeo, the code outputs 2 points 
for the same selection on different positions in space.

##########
temp = nuke.nodes.CurveTool()
for frame in range(1100,1150):
    nuke.execute(temp, frame, frame)
    nuke.frame(frame)

    selectedVertexInfo = nukescripts.snap3d.selectedVertexInfos() #it's the 
same for selectedPoints()
    print nuke.frame()
    for point in selectedVertexInfo:
        print point.index, point.objnum, point.position, point.value
    print

nuke.delete(temp)
##########

To make my confusion complete: it sometimes (very rarely) just works as 
expected...

Is there something I am missing here? A way to force update the 3d-system?
Also is there a way to get the geo containing node from selected points (so I 
could temporarily disconnect the scene node downstream)?

Any help is greatly appreciated!
Cheers,
Carl
_______________________________________________
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

_______________________________________________
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