johnzero7 / XNALaraMesh

Blender addon Import/Export XPS Models, Poses
525 stars 94 forks source link

What is xpsSettings and xpsSettingsAux from import_xnalara_model.py #83

Closed shkodykoshka closed 3 years ago

shkodykoshka commented 3 years ago

Function definition getInputFilename() has argument, xpsSettingsAux. What is this argument (not string, context, or class from init.py), and where is it declared? I am trying to make importer for .ascii files with bpy.ops.import_mesh.ascii, and for that to work I need xpsSettings to have its required content for xpsImport() to work.

ldo commented 3 years ago

It seems to be used to overwrite the global xpsSettings.

shkodykoshka commented 3 years ago

I couldn't find where getInputFilename() gets called, but xpsSettingsAux still gets its value. xpsSettings does get value in a single if statement which the script wouldn't normally go into.

I am trying to give xpsSettings its correct values, but it's reading my file incorrectly, I am just calling getInputFilename with my file name as the argument. I previously gave xpsSettings value in the same function that determined what format the file is in, but that also gave wrong results

ldo commented 3 years ago

To invoke an importer, you only need to specify at least the filepath argument, and you can default the rest:

importer_op(filepath = infile)

(For a more elaborate example of invoking Blender importers, see my import_to_blender script.)