1
$\begingroup$

enter image description here

Hi I tried to install an addon from a zip file and i have this error but this is the same file. I checked, there is only 1 bl_info. There are 2 other .py files in the script, import_3ds.py and export_3ds.py, and neither of them have bl_info. If i delete the __init__.py file there is no error but the plugin isn't loaded at all.

The __init__.py :

# ##### BEGIN GPL LICENSE BLOCK #####
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####

# <pep8-80 compliant>

bl_info = {
    "name": "Autodesk 3DS format",
    "author": "Bob Holcomb, Campbell Barton, Andreas Atteneder",
    "version": (2, 0, 0),
    "blender": (2, 80, 0),
    "location": "File > Import",
    "description": "Import 3DS, meshes, uvs, materials, textures, "
                   "cameras & lamps",
    "warning": "Images must be in file folder",
    "doc_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
               "Scripts/Import-Export/Autodesk_3DS",
    "category": "Import-Export",
}

if "bpy" in locals():
    import importlib
    if "import_3ds" in locals():
        importlib.reload(import_3ds)
    if "export_3ds" in locals():
        importlib.reload(export_3ds)


import bpy
from bpy.props import (
        BoolProperty,
        EnumProperty,
        FloatProperty,
        StringProperty,
        )
from bpy_extras.io_utils import (
        ImportHelper,
        ExportHelper,
        orientation_helper,
        axis_conversion,
        )


@orientation_helper(axis_forward='Y', axis_up='Z')
class Import3DS(bpy.types.Operator, ImportHelper):
    """Import from 3DS file format (.3ds)"""
    bl_idname = "import_scene.autodesk_3ds"
    bl_label = 'Import 3DS'
    bl_options = {'UNDO'}

    filename_ext = ".3ds"
    filter_glob: StringProperty(default="*.3ds", options={'HIDDEN'})

    constrain_size: FloatProperty(
            name="Size Constraint",
            description="Scale the model by 10 until it reaches the "
                        "size constraint (0 to disable)",
            min=0.0, max=1000.0,
            soft_min=0.0, soft_max=1000.0,
            default=10.0,
            )
    use_image_search: BoolProperty(
            name="Image Search",
            description="Search subdirectories for any associated images "
                        "(Warning, may be slow)",
            default=True,
            )
    use_apply_transform: BoolProperty(
            name="Apply Transform",
            description="Workaround for object transformations "
                        "importing incorrectly",
            default=True,
            )

    def execute(self, context):
        from . import import_3ds

        keywords = self.as_keywords(ignore=("axis_forward",
                                            "axis_up",
                                            "filter_glob",
                                            ))

        global_matrix = axis_conversion(from_forward=self.axis_forward,
                                        from_up=self.axis_up,
                                        ).to_4x4()
        keywords["global_matrix"] = global_matrix

        return import_3ds.load(self, context, **keywords)


@orientation_helper(axis_forward='Y', axis_up='Z')
class Export3DS(bpy.types.Operator, ExportHelper):
    """Export to 3DS file format (.3ds)"""
    bl_idname = "export_scene.autodesk_3ds"
    bl_label = 'Export 3DS'

    filename_ext = ".3ds"
    filter_glob: StringProperty(
            default="*.3ds",
            options={'HIDDEN'},
            )

    use_selection: BoolProperty(
            name="Selection Only",
            description="Export selected objects only",
            default=False,
            )

    def execute(self, context):
        from . import export_3ds

        keywords = self.as_keywords(ignore=("axis_forward",
                                            "axis_up",
                                            "filter_glob",
                                            "check_existing",
                                            ))
        global_matrix = axis_conversion(to_forward=self.axis_forward,
                                        to_up=self.axis_up,
                                        ).to_4x4()
        keywords["global_matrix"] = global_matrix

        return export_3ds.save(self, context, **keywords)


# Add to a menu
def menu_func_export(self, context):
    self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)")


def menu_func_import(self, context):
    self.layout.operator(Import3DS.bl_idname, text="3D Studio (.3ds)")


def register():
    bpy.utils.register_class(Import3DS)
#     TODO: Restore export
#     bpy.utils.register_class(Export3DS)

    bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
    bpy.types.TOPBAR_MT_file_export.append(menu_func_export)


def unregister():
    bpy.utils.unregister_class(Import3DS)
#    TODO: Restore export
#     bpy.utils.unregister_class(Export3DS)

    bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
    bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)

# NOTES:
# why add 1 extra vertex? and remove it when done? -
#  "Answer - eekadoodle - would need to re-order UV's without this since face
#  order isnt always what we give blender, BMesh will solve :D"
#
# disabled scaling to size, this requires exposing bb (easy) and understanding
# how it works (needs some time)

if __name__ == "__main__":
    register()

Please help me!

$\endgroup$
5
  • 2
    $\begingroup$ Appears you have folders named appdata and AppData in your user folder. $\endgroup$
    – batFINGER
    Jun 16, 2021 at 18:02
  • $\begingroup$ I don't. The 2 names lead to the same folder $\endgroup$
    – Scover
    Jun 17, 2021 at 10:34
  • $\begingroup$ Is it (or it is) possible one is a symbolic link (shortcut) to the other? Could you please type bpy.utils.script_paths('addons') into blender's python console and report back the result? See python docs, an __init__.py file in a modules base folder "defines" the module, hence would not remove it. $\endgroup$
    – batFINGER
    Jun 17, 2021 at 10:54
  • $\begingroup$ It gives ['D:\\Programmes\\Blender\\2.90\\scripts\\addons', 'C:\\Users\\Scover\\AppData\\Roaming\\Blender Foundation\\Blender\\2.90\\scripts\\addons', 'C:\\Users\\Scover\\appdata\\Roaming\\Blender Foundation\\Blender\\2.90\\scripts\\addons'] $\endgroup$
    – Scover
    Jun 22, 2021 at 15:03
  • $\begingroup$ THere is the issue, blender is treating as two separate paths. Not a link? I no longer use MS windoze since XP. My limited understanding with latter versions of MS windows can set folder / file names as case sensitive or insensitive on a per folder basis. Have you perhaps added the lowercase version of the path (up to scripts) to User Prefs > File Paths > Scripts. docs.blender.org/manual/en/latest/editors/preferences/… $\endgroup$
    – batFINGER
    Jun 22, 2021 at 15:39

1 Answer 1

1
$\begingroup$

I had the same path in User Prefs > File Paths > Scripts Removing the path fixed the problem

$\endgroup$
1
  • $\begingroup$ As re my last comment under question. In as much as it is the "same path" on case insensitive windows, compounding the issue is the difference in case. eg can you confirm that had your chosen the path from filebrowse, or pasted in such that they match as a string, the same issue persists. Perhaps something for the devs to look at re testing for any two paths having equivalent target folder. , $\endgroup$
    – batFINGER
    Jul 31, 2021 at 11:46

You must log in to answer this question.

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