Giter Site home page Giter Site logo

Getting a python error. about jremesh-tools HOT 12 OPEN

jayanam avatar jayanam commented on August 23, 2024
Getting a python error.

from jremesh-tools.

Comments (12)

bekmeh avatar bekmeh commented on August 23, 2024 5

I had the same error, and resolved it by enabling the plugin called "Import-Export: Wavefront OBJ format (legacy)"

from jremesh-tools.

jayanam avatar jayanam commented on August 23, 2024 3

from jremesh-tools.

natahnd avatar natahnd commented on August 23, 2024 3

@natahnd i ran your fix and got this error

image

The error you're reporting suggests that the changes haven't been applied in your Blender correctly. This likely requires a restart of Blender if you changed the python script whilst it was open. The reason I can tell its not updated is it's saying:

"calling operator bpy.ops.export_scene.obj error" whereas the new function name, if updated correctly is bpy.ops.wm.obj_export.

That said I would wait for the official update as indicated in the above comments :)

from jremesh-tools.

dfsadfsfsa avatar dfsadfsfsa commented on August 23, 2024 1

Ive just had the same error using Blender 4.0.
Wavefront OBJ Import/Export is built in to Blender as of v3.3 hence no option to install addon.

from jremesh-tools.

jakub-bak avatar jakub-bak commented on August 23, 2024

I had the same error, and resolved it by enabling the plugin called "Import-Export: Wavefront OBJ format (legacy)"

That resolves the issue indeed, worth mentioning in the DOCS as some users disabled that legacy importer for startup time savings.

from jremesh-tools.

ZackHaronOriginal avatar ZackHaronOriginal commented on August 23, 2024

I'm getting the same error has anyone found a solution to this?

from jremesh-tools.

Stefanizam avatar Stefanizam commented on August 23, 2024

Any solutions for blender 4.0 ?

from jremesh-tools.

natahnd avatar natahnd commented on August 23, 2024

For blender 3.3 and 4.0, the OBJ Import/Export is now built into the system, so the API calls bpy.ops.export_scene.obj and bpy.ops.import_scene.obj no longer exist. I dug into the blender API changes and found the new functions for OBJ Import/Export and implemented those but I'm not entirely sure it is the correct fix, as some of the arguments from the original functions aren't in the new functions.

However, for someone else to test and verify if they would like, these are the changes I made inside the failing file:

  • jremesh-tools-main\jrt_remesh_op.py

On line 73, I changed the OBJ export command from:

# Export original object
bpy.ops.export_scene.obj(filepath=orig,
                            use_selection=True,
                            use_mesh_modifiers=True,
                            use_edges=True,
                            use_smooth_groups=False,
                            use_smooth_groups_bitflags=False,
                            use_normals=True,
                            use_uvs=True)

to

# Export original object
bpy.ops.wm.obj_export(filepath=orig,
                            check_existing=False,
                            export_selected_objects=True,
                            apply_modifiers=True,
                            export_smooth_groups=False,
                            smooth_group_bitflags=False,
                            export_normals=True,
                            export_uv=True)

On line 96, I changed the OBJ Import command from:

# Import remeshed object
bpy.ops.import_scene.obj(filepath=output,
                             use_smooth_groups=False)
                             use_image_search=False)

to

# Import remeshed object
bpy.ops.wm.obj_import(filepath=output,
                             use_split_objects=False)

If someone else could verify if these are the correct changes then would be as appreciated as this is the first time using this plugin for me in Blender, so I'm not sure if the results are correct or not, and I haven't installed the older versions to verify.
Cheers

from jremesh-tools.

ddkro avatar ddkro commented on August 23, 2024

If someone else could verify if these are the correct changes then would be as appreciated as this is the first time using this plugin for me in Blender, so I'm not sure if the results are correct or not, and I haven't installed the older versions to verify. Cheers

4.0, it's not working

from jremesh-tools.

CiPH3R-NFS avatar CiPH3R-NFS commented on August 23, 2024

@natahnd i ran your fix and got this error

image

from jremesh-tools.

arrafi-musabbir avatar arrafi-musabbir commented on August 23, 2024

Turns out bpy.ops.import_scene.obj was removed at bpy>=4 which is the latest blender-api for python, hence the error. In bpy>4 you have to use bpy.ops.wm.obj_import(filepath='')

I just downgraded to bpy==3.60 and it worked for me:

pip install bpy=3.6.0

from jremesh-tools.

arrafi-musabbir avatar arrafi-musabbir commented on August 23, 2024

that would be great, thank you!

from jremesh-tools.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.