threedle / TextDeformer

MIT License
106 stars 11 forks source link

Error using max_planck.obj #1

Closed wangmiaowei closed 1 year ago

wangmiaowei commented 1 year ago

I do not know whether you meet this problem when replacing shape with max_planck.obj in the YAML file.

企业微信截图_0005e43d-9d6c-4188-8c0b-bb14e511406e
wangmiaowei commented 1 year ago

Well, I now this reason. Your mesh does not provide the material file. But when I use my mesh with mtl file, then another error happens:

企业微信截图_d01d1512-076d-43c2-af6c-256c3954972c
ChocolateBiscuit commented 1 year ago

I do not run into this issue when running with max_planck.obj. A material file is not necessary to run our code. The error is saying that the mesh has no texture coordinates -- I am not sure how this is possible since this line of code computes a trivial parameterization for any mesh which does not have texture coordinates. Can you share your config file and command that you are running?

For the second error, this could be a variety of issues -- for example, the Neural Jacobian Fields code does not work for meshes that have more than one connected component. I can take a look if you share your mesh file.

wangmiaowei commented 1 year ago

Thanks for your help. For the first question, I modified that code line(version) to be adapted to my machine. There is a bug here and looks good now. For the second question, I upload my test mesh(.zip) here. From your current expression, it seems a converting tool to your requirement is necessary if want to have a broad application. musk_mesh.zip

ChocolateBiscuit commented 1 year ago

I took a look at your mesh, first there seems to be a box surrounding the face. image Aside from that, the mesh consists of nearly 2000 connected components. While our code can be extended to multiple connected components (you may parameterize each mesh with Jacobians and also learn a global translation for each shape to position them), it was not written to handle this case, where the thousands of components are intended to be one single object. One suggestion is to try to merge the components and re-mesh in blender.

ethanhe42 commented 1 year ago

Any idea how to convert the object?

my conversion script doesn't work:

import bpy

# Load the .obj file
bpy.ops.import_scene.obj(filepath="input.obj")
bpy.ops.object.select_all(action='SELECT')

# Get the active object
obj = bpy.context.selected_objects[0]

# Merge components
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.remove_doubles()
bpy.ops.object.mode_set(mode='OBJECT')

# Re-mesh
bpy.ops.object.modifier_add(type='REMESH')
bpy.context.object.modifiers["Remesh"].octree_depth = 6
bpy.ops.object.modifier_apply(modifier="Remesh")

# Export the new .obj file
bpy.ops.export_scene.obj(filepath="output.obj", use_selection=True)