Stellaxis / omniscient-cinema4d

A plugin to easily import tracking datas and LiDAR scans recorded with the Omniscient iOS app, into Cinema 4D.
Apache License 2.0
0 stars 0 forks source link

TypeError: unhashable type: 'c4d.BaseObject' raised when importing .omni file #1

Closed EnderElement closed 4 months ago

EnderElement commented 4 months ago

This error occurs when attempting to import a .omni file using the importer or dragging it into the scene. Tested in Cinema 4D versions R26.107 and R2023.1.3 with identical results.

INFO:OmniscientImporter:Selected .omni file: C:\Users\Mark\Downloads\IMG_181218028_10May\IMG_181218028.omni INFO:OmniscientImporter:Parsed .omni data. ERROR:OmniscientImporter:An error occurred while processing the .omni file: Traceback (most recent call last): File "C:\Program Files\Maxon Cinema 4D R26\plugins\OmniscientImporter\lib\OmniscientImporter.py", line 202, in import_omni_file process_import(doc, obj_path, "Scan_Omni") File "C:\Program Files\Maxon Cinema 4D R26\plugins\OmniscientImporter\lib\OmniscientImporter.py", line 50, in process_import objects_before_import = set(doc.GetObjects()) TypeError: unhashable type: 'c4d.BaseObject'

However, the importer is able to successfully create a material with the background footage, create a C4D background object, and apply the material to it.

Files exported in the Omniscient app version 1.15.1 on the iPad pro 3rd gen (16.4.1) with the C4D option selected only. image

Stellaxis commented 4 months ago

Hi @EnderElement, thank you for flagging this issue!

After investigating, based on this release note, Maxon updated the Python version used by Cinema 4D from 3.9 to 3.10.8, which seems to be the cause of the issue. This change occurred in Cinema 4D 2023.2.0, coincidentally the oldest version we tested the plugin with, which is why we didn't experience the issue you're facing.

I just tried a fix below; please let me know if it works:

OmniscientImporter.zip

EnderElement commented 4 months ago

Ah that change would make sense. The fix for both my C4D versions worked incredibly well. Thank you for your time!

Stellaxis commented 4 months ago

Thanks @EnderElement for confirming that it fixes the issue! Enjoy the app :)