Jump to content

[PYTHON] Getting current frame over network using rpyc


Recommended Posts

Hello !

I'm trying to do some tests using rpyc to control Houdini over the network (currently only on the same computer)

I managed to get it to work (creating some nodes, getting the frame range, setting the frame)
But, strangely, I can't get the correct current frame number

It will return 1.0, but if I use hou.setFrame(XX) it will then return that value (whatever XX was) even after manually changing the frame in Houdini
I tried using hou.frame(), hou.expandString("$F")
They both had the same problem

My steps to get it to work were copying the rpyc folder at
C:\Program Files\Side Effects Software\Houdini 17.0.XXX\python27\lib\site-packages
C:\Program Files\Autodesk\Maya2017\Python\Lib\site-packages

In Houdini, open a Python Shell and write/execute

import hrpyc

In Maya, open a Python Shell and write/execute

import rpyc

connection = rpyc.classic.connect("localhost", 18811)
hou = connection.modules.hou

print hou.frame() # Returns 1.0
hou.setFrame(52) # Sets the frame to 52
print hou.frame() # Returns 52.0
print hou.expandString("$F") # Returns 52

But if you manually change the frame in Houdini and only execute the print hou.frame() line, the problem will be apparent

Even in another Houdini instance the problem is present.

import hrpyc
connection, hou = hrpyc.import_remote_module()

print hou.frame()

Is there something I did wrong, missed or anything ?

Thanks !

Edited by Alain2131
Link to comment
Share on other sites

Hey Alex, thanks for the answer !

I'll send an RFE as you proposed

But do you think this is because I'm using rpyc in Maya instead of hrpyc ?
I don't really know what I'm doing, I'm just poking around :)

Meanwhile, fcur does return the correct frame ! Noice ! Thanks for that =)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...