niftools / blender_niftools_addon

The Blender Niftools Addon is a Blender add-on to enable import and export of NetImmese File Formats including .nif, .kf, .egm.
http://www.niftools.org
Other
386 stars 104 forks source link

blender_nif_plugin-2.6.0.dev4 fails to load in 2.79b #416

Closed clort81 closed 3 years ago

clort81 commented 3 years ago

Blender Version: 2.79b (nothing newer works on my opengl 3.1 machine) Blender Nif Plugin: 2.6.0.dev4.b2-80 Pyffi: 2.2.4.dev3 Python 3.5.3

1) I Copied the io_scene_nif directory tree to /usr/share/blender/scripts/addons 2) I start blender and in User Preferences, Import/Export, click button for Import-Export: NetImmerse/Gamebryo nif format

This fails with following error in console:

Traceback (most recent call last):
  File "/usr/share/blender/scripts/modules/addon_utils.py", line 331, in enable
    mod = __import__(module_name)
  File "/usr/share/blender/scripts/addons/io_scene_nif/__init__.py", line 114, in <module>
    operators.register()
  File "/usr/share/blender/scripts/addons/io_scene_nif/operators/__init__.py", line 42, in register
    from . import object, geometry, nif_import_op, nif_export_op, kf_import_op, egm_import_op  # kf_export_op
  File "/usr/share/blender/scripts/addons/io_scene_nif/operators/nif_import_op.py", line 58
    scale_correction_import: bpy.props.FloatProperty(
                           ^
SyntaxError: invalid syntax

I'm not seeing what's wrong with the syntax: Here's the relevant context from nif_import_op.py

class NifImportOperator(Operator, ImportHelper, NifOperatorCommon):
    """Operator for loading a nif file."""

    # Name of function for calling the nif export operators.
    bl_idname = "import_scene.nif"

    # How the nif import operators is labelled in the user interface.
    bl_label = "Import NIF"

    # Number of nif units per blender unit.
    scale_correction_import: bpy.props.FloatProperty(
        name="Scale Correction Import",
        description="Changes size of mesh to fit onto Blender's default grid.",
        default=1.0,
        min=0.01, max=100.0, precision=3)

Comparing to current git master, i see this function was moved to common_op.py.

I haven't found a similar issue so I felt it appropriate to create one.

Since I am stuck on blender 2.79b, I'd appreciate any suggestions for a solution.

Thanks for the tool and your work.

neomonkeus commented 3 years ago

I Copied the io_scene_nif directory tree to /usr/share/blender/scripts/addons I start blender and in User Preferences, Import/Export, click button for Import-Export: NetImmerse/Gamebryo nif format

Don't do this, the source code is not the same as the built version.

Just use the zip file as included in the releases sections. The 2.6.0.dev4.b2-80 is not compatible with 2.79 as from the post-fix of the zip the b2-80 part refers to Blender 2.80. You need to use the 2.6.0.dev4.b2-79 on as it is last compatible release - blender_nif_plugin-2.6.0.dev4.b2-79-2020-05-07-c7680edd.zip

Note: Seeing as you are potentially stuck with 2.79, here is a branch https://github.com/niftools/blender_niftools_addon/tree/blender_2.7_support, but it will be dropped in short succession once we finish re-work of the material system to fully adopt the 2.8 node system. The branches however have diverged significantly enough that we have called it a day on back-porting fixes.

clort81 commented 3 years ago

Works! Thanks!