PFHoe XML importer

PFHoe is a low cost 3D motion tracking software released by “The Pixel Farmers”, creators of PFTrack - the professional tracking software based on Icarus. PFHoe comes with a Blender exporter of its own, but changes in recent versions of the Blender Python API have caused their exporter to cease functioning. Initially I as posting bug reports and advice in their support forums, but it seemed to me that, without an active BPy developer maintaining it, their exporter could never hope to keep pace with Blender’s development. Fortunately they also provide a simple XML exporter with AFAIK a fairly stable format. That being the case I decided the only sensible thing to do was to move the burden of Blender support to the Blender community :eyebrowlift2:

So, here is my version 0.5b PFHoe XML importer script!

This script uses the very cool ElementTree module to handle XML data, which means that you need to have that module installed to use the script, which implies that you need a full Python install for it to be installed in. Actually you should be able to dump the contents of the ElementTree module into you “.blender/scripts/bpymodules” directory to get it working, but I haven’t tested that yet. My hope is that future versions of Blender will come with this module included, so you wont have to worry about it :rolleyes:

Speaking of inclusion, once I test this script a little more and give it a good reviewin’ I wouldn’t mind if it were included with Blender too :wink:

Anyway if anyone wants to test it, report bugs, request features, etc. please do. I have a limited number of PFHoe tracks laying around, and they all have the same setting. That is a free move 720x640 4:3 track with fixed focal length. If you have a track with different settings I would like to hear how the script works for you, or better yet see your XML export files :cool:

Wow!
does it work with PFtrack as well? :smiley:

I don’t know, get me some PFTrack example footage and XML export files and I’ll see what I can do!

Question:

How do you use this to open an XML file in Blender?

Sorry for bumping into an old thread, but this script is really important as importing the blender script that PFhoe generates into blender 2.48 gives you an error. Thanks for writing it Kitsu. I’m trying it out with some 720x480 videos and I’m feeling the camera movement a bit too jerky. I’ll run some other tests and tell you how things go.
I also noticed you already uploaded a newer version:
http://kitsu.petesdomain.com/files/blender/scripts/PFHoe_import/import_PFHoe-06b.py

@DK_blend: to use it, when you export your tracking info from PFhoe, instead of selecting “blender python script” as the preset, select “XML”. Before launching blender, copy Kitsu’s script into your blender’s “scripts” folder. Launch blender, go to File-Import, and you should have a “PFhoe.xml format” import option. Select it and look for your exported xml file. Camera and tracking points should be loaded.

Regards,
Alvaro

Kitsu: I’m not having problems importing pfhoe xmls into blender 2.48a with version 06b of your script in Linux, however, in windows, I’m getting the following error:

Shortname = 'C:\blender\install\WIN32-~1\blender.exe'
Compiled with Python version 2.5.
Checking for installed Python... got it!
Created by:  PFHoe-Pro 2.1r1-80128
Handedness:  left
Up direction:  y
Traceback (most recent call last):
  File "C:\blender\install\win32-mingw\.blender\scripts\import_PFHoe-06b.py", li
ne 198, in main
    setCamera(root, data)
  File "C:\blender\install\win32-mingw\.blender\scripts\import_PFHoe-06b.py", li
ne 102, in setCamera
    source = Image.Load(find(camdata, "backgroundClip"))
IOError: couldn't load image

Any ideas? perhaps a Python missing feature that I already have in Linux but I’m missing in Windows? :?

Kitsu, now I’m also having problems with latest blender in Linu. I’m getting the following error in the console:

Created by:  PFHoe-Pro 2.1r1-80128
Handedness:  left
Up direction:  y
Traceback (most recent call last):
  File "/home/afecelis/.blender/scripts/import_PFHoe-06b.py", line 198, in main
    setCamera(root, data)
  File "/home/afecelis/.blender/scripts/import_PFHoe-06b.py", line 102, in setCamera
    source = Image.Load(find(camdata, "backgroundClip"))
IOError: couldn't load image

I’d be more than glad if you found out some time to look into it :wink:

regards,
Alvaro

Hi! kitsu :
Recently I try to use pfhoe with blender 2.5,pfhoe can export py script for blender 2.49,
But when I try to load 2.49 file into 2.5,it crash.
So I thinking of looking for a xml import script ,and I found this post.
But the download link is not working anymore,can you post again the script?
Thanks!

Hi,

I’m wanting to buy PFHoe soon, but also really want to use it with Blender 2.5. The link for this plugin seems to be broken, so I’ve started working on my own, but I’m stuck on some of the coordinate systems in the XML file vs. on blender.

So I figured I should just post and ask if anyone who has the file could maybe post it here, as the site the link was on seems to be down now…

Thanks!

I’m working on an import script here by the way - I’m stuck trying to convert PFHoe’s rollPitchYaw into Blender’s Eulers. So if anyone happens to know what I’m doing wrong, let me know :slight_smile: