0
$\begingroup$

Recently Facebook released the Spark AR Toolkit for Blender. Using this add-on you can easily optimize and export Blender models for use in Facebook's Spark AR (used for creating Instagram filters). When using the Toolkit (V1.1.0) I get the following error message while pressing the "Export Mesh" button:

Python: Traceback (most recent call last):
  File "/Users/kaiyawilson-smith/Library/Application Support/Blender/2.91/scripts/addons/Spark AR Toolkit/spark_operators_export.py", line 44, in execute
    self._export_mesh()
  File "/Users/kaiyawilson-smith/Library/Application Support/Blender/2.91/scripts/addons/Spark AR Toolkit/spark_operators_export.py", line 80, in _export_mesh
    export_force_sampling=False
  File "/Applications/Blender.app/Contents/Resources/2.91/scripts/modules/bpy/ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
TypeError: Converting py args to operator properties:  expected a string enum, not bool

location: <unknown location>:-1

Does anybody know how to fix this?

$\endgroup$
5
  • $\begingroup$ This looks like a bug in the add-on, best report this to the developers. Unfortunately your question contains no context information of what you've done or what you're trying to achieve, so we can't really help you e.g. with a workaround. $\endgroup$ Commented Dec 6, 2020 at 10:53
  • $\begingroup$ Although there isn't much context, the question is perfectly clear to me. When exporting the object using Spark AR Toolkit he gets an error. I got the same. And fixed it! I'd add the answer here, but this this question is locked. I've detailed it here in the official Spark AR forum: sparkar.facebook.com/forum/question/?id=393056415466926 $\endgroup$ Commented Dec 8, 2020 at 23:05
  • $\begingroup$ I've edited the question and gave some more context. Hope it will get accepted now. $\endgroup$ Commented Dec 8, 2020 at 23:18
  • $\begingroup$ @LeonZandman I've reopened the question. Please post your solution as an answer. $\endgroup$ Commented Dec 9, 2020 at 13:40
  • $\begingroup$ @RobertGutzkow Thanks! $\endgroup$ Commented Dec 9, 2020 at 14:05

1 Answer 1

2
$\begingroup$

I also encountered this bug using the Blender 2.91. After some spelunking the the Toolkit's code and the Blender Python API I found a solution. Apparently something changed in the Blender export scene glTF API. When the Toolkit tries to export to glTF it passes the boolean value TRUE to the export_materials argument of the export function. However, it seems the export_materials argument no longer accepts a boolean value, but instead requires an enum value type. I tested it with the EXPORT enum value and that seemed to work fine.

I've already reported this to the Facebook Spark AR team and I expect an updated version of the Toolkit to be released in the near future. But if you really want to fix this now, you can do so by editing a Toolkit source file.

First close all running instances of Blender. Then locate the file spark_operators_export.py. It's location is mentioned in the error message that Blender displays. In your case it's /Users/kaiyawilson-smith/Library/Application Support/Blender/2.91/scripts/addons/Spark AR Toolkit/spark_operators_export.py. Edit that file using a plain text editor like Notepad.

Change line 66 from

export_materials=True,

to

export_materials='EXPORT',

Restart Blender and exporting your mesh should work again.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .