Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export to .ascii not working. #96

Open
Konohamaru04 opened this issue Oct 11, 2022 · 1 comment
Open

Export to .ascii not working. #96

Konohamaru04 opened this issue Oct 11, 2022 · 1 comment

Comments

@Konohamaru04
Copy link

When I try to export a model to .ascii it throws following error

Python: Traceback (most recent call last): File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\XNALaraMesh\xps_tools.py", line 312, in execute export_xnalara_model.getOutputFilename(xpsSettings) File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\XNALaraMesh\export_xnalara_model.py", line 68, in getOutputFilename xpsExport() File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\XNALaraMesh\timing.py", line 31, in wrap ret = f(*args) File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\XNALaraMesh\export_xnalara_model.py", line 114, in xpsExport xpsMeshes = exportMeshes(selectedArmature, selectedMeshes) File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\XNALaraMesh\export_xnalara_model.py", line 175, in exportMeshes meshName = makeNamesFromMesh(mesh) File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\XNALaraMesh\export_xnalara_model.py", line 208, in makeNamesFromMesh renderType = xps_material.makeRenderType(meshFullName) File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\XNALaraMesh\xps_material.py", line 521, in makeRenderType if math.isnan(renderGroupFloat): TypeError: must be real number, not str

Maybe I'm using some invalid settings please help me out here.

Thanks !

@ldo
Copy link

ldo commented Oct 11, 2022

The problem seems to be that the getFloat routine in ascii_ops does not always return a float:

def getFloat(value):
    """Read value and returns a float. If error return NaN."""
    if value:
        try:
            return float(value)
        except ValueError:
            return float('NaN')
    return value

That initial “if value:” check skips the conversion for values that Python interprets as False — for example None or the empty string — and returns them unconverted.

Could it be that the mesh name begins with an underscore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants