I haven't tried it, but I see you are producing Tech Preview builds of 18.0 that use Python 3. As best I can tell, Pixar's tractor.api modules are not Python-3-friendly even with the 2.4 release. I assume that the TOP tractor-scheduler node which uses those to create the tractor job doesn't work in these builds? You haven't done anything magical like provide modified versions of Pixar's modules…
We're also taking a very early look a writing a Tractor job from Blender (which is Python 3), so Pixar's lack of Python 3-compatible authoring modules is a bit of a pain.
Tractor and Python 3
3183 5 4- davidoberst
- Member
- 27 posts
- Joined: March 2020
- Offline
- chrisgreb
- Member
- 603 posts
- Joined: Sept. 2016
- Offline
- davidoberst
- Member
- 27 posts
- Joined: March 2020
- Offline
What's the status of Tractor and Houdini 19/Python 3? While Pixar hasn't done a full Python 3 Tractor release yet, they do have their "tractor" Python API package converted, in Renderman 24. We don't have RMan24, but they also provided a beta of the package in their forum, and we've been using that successfully with Nuke 13, for instance, and put it on PYTHONPATH for our Houdini 19 setups. We can do PDG/TOP submissions from Windows to our (linux) Tractor farm, but when the main PDG cooking task runs on the farm, it throws the error below, in pdgmq.py.
It looks like TractorSpooler.spool_tractor_task() has a "drain()" subfunction which creates a NamedTemporaryFile and tries to write the TCL text of a tractor job to it. In Python3, the temp files get opened "w+b" by default, and the write() method wants "bytes", while the TCL job text is a "str". The temp file should probably be opened with in explicit "w" mode so it will accept the TCL "str"?
Does a basic spooling problem like this mean Tractor is not currently supported by Houdini 19?
It looks like TractorSpooler.spool_tractor_task() has a "drain()" subfunction which creates a NamedTemporaryFile and tries to write the TCL text of a tractor job to it. In Python3, the temp files get opened "w+b" by default, and the write() method wants "bytes", while the TCL job text is a "str". The temp file should probably be opened with in explicit "w" mode so it will accept the TCL "str"?
Does a basic spooling problem like this mean Tractor is not currently supported by Houdini 19?
Exception in thread Thread-1: Traceback (most recent call last): File "/opt/houdini/hfs19.0/python/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/opt/houdini/hfs19.0/houdini/python3.7libs/hou.py", line 99522, in __threadRun self.__run() File "/opt/houdini/hfs19.0/python/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/opt/houdini/hfs19.0/houdini/python3.7libs/pdgjob/pdgmq.py", line 211, in drain tempf.write(self._tractortaskqueue.popleft()) File "/opt/houdini/hfs19.0/python/lib/python3.7/tempfile.py", line 481, in func_wrapper return func(*args, **kwargs) TypeError: a bytes-like object is required, not 'str'
- daweisun
- Member
- 1 posts
- Joined: Sept. 2021
- Offline
- davidoberst
- Member
- 27 posts
- Joined: March 2020
- Offline
Actually, you can write "str" to the tempfile if you open it with mode='w' or 'w+a', but converting the Tractor TCL 'str' text to bytes for the write() call would be good enough in this case. With the fix, the 'cook' task on the farm successfully spawns all the dynamic frame tasks to Tractor and the job succeeds? That would be great - I was reluctantly going to look into monkey-patching around this bug. It looks like 19.0.491 is there as a daily now - any rough idea when the next production build will be put together from 19.0.491 or higher?
- rvinluan
- Staff
- 1255 posts
- Joined: July 2005
- Offline
-
- Quick Links