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

Could you add a feature to keep vertices? #88

Closed
j20232 opened this issue Jul 3, 2020 · 3 comments
Closed

Could you add a feature to keep vertices? #88

j20232 opened this issue Jul 3, 2020 · 3 comments

Comments

@j20232
Copy link

j20232 commented Jul 3, 2020

About

Current implementation may have a bug not to keep vertex indices when we load .obj meshes at Blender 2.83.0.

The bug is caused by not setting split_mode="OFF" which is attributes of bpy.ops.import_scene.obj.
Reference: https://docs.blender.org/api/current/bpy.ops.import_scene.html#bpy.ops.import_scene.obj

In naive implementation, I can fix the bug as follows.

def importFuncFromTypeNumber(_typeNumber):
    # OBJ
    if (_typeNumber == 0):
        return bpy.ops.import_scene.obj, {"split_mode": "OFF"}
    # STL
    elif (_typeNumber == 1):
        return bpy.ops.import_mesh.stl, {}
    # PLY
    elif (_typeNumber == 2):
        return bpy.ops.import_mesh.ply, {}
    return None
importFunc, kwargs = importFuncFromTypeNumber(
            int(_obj.mesh_sequence_settings.fileFormat))
importFunc(filepath=file, **kwargs)

Could you fix the bug?

@neverhood311
Copy link
Owner

Which version of Stop Motion OBJ are you using?

@j20232
Copy link
Author

j20232 commented Jul 6, 2020

Thank you for your reply.
The version is 2.0.2.

@neverhood311
Copy link
Owner

I don't really consider that a bug, more of a feature request. In version 2.0.2 and earlier, I don't use any non-default import settings (as you've seen in the code).

However, all of that is changing in version 2.1. You'll be able to specify most of the built-in import settings for each file format as you're importing a mesh sequence. Version 2.1 is in the Beta phase so all of the new functionality is in place, I'm just working on finding and fixing bugs now. If you'd like to try out the Beta, feel free to grab it from the releases page. And please report any bugs you find. (and take a look at the project wiki; the way you import a mesh sequence has changed.)

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

No branches or pull requests

2 participants