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

Refine obj import to blender, color attribute not found #30

Open
thomaswan opened this issue Jul 11, 2024 · 6 comments
Open

Refine obj import to blender, color attribute not found #30

thomaswan opened this issue Jul 11, 2024 · 6 comments

Comments

@thomaswan
Copy link

Import it3000-mc256.obj to blender, color attribute can be used as material base color. However, import refine__name__.obj file to blender, color attribute is not found.

@altava-sgp
Copy link

Usually blender can't get vertex color from obj file. ( In my case blender 3.6.2 )
You can export as ply with vertex color from original obj file by tool like MeshLab.
There is also issue about this. #14 (comment)

@bananaman1983
Copy link

bananaman1983 commented Jul 29, 2024

it's a clipping problem after the training. simple clamping like the code below may circumvent the problem where values spike above 1.0f

def optim_clr(case, img_path, mesh_dir, save_dir, device):
    ...             
    np_colors= to_numpy(color_model.colors)         
    np.clip(np_colors, 0.0, 1.0, out=np_colors) #clamp    
    tensor_colors = torch.tensor(np_colors ,dtype=torch.float32,device=device)
    
    save_obj(vert, face, f'{save_dir}/refine_{case}.obj', tensor_colors.detach())  
    ...

@altava-sgp
Copy link

@bananaman1983 Could you guess about this issue too ? #26

@bananaman1983
Copy link

bananaman1983 commented Jul 29, 2024

dunno TBH. would like to take a look into it though. I've been noticing it too. it's weird. with normals flipped in the wrong axes and stuff

@miaowu99
Copy link

@bananaman1983 Excellent! you also solved the issue of noise in the colors of my exported mesh.
by:

  texture_color = torch.clamp(color_model.colors.detach(), min=0, max=1)
  save_obj(vert, face, f'{save_dir}/refine_{case}.obj', texture_color)

@altava-sgp
Copy link

altava-sgp commented Jul 31, 2024

@bananaman1983 @miaowu99 Great Job !
You solved this issue ! #4 👍

before

image

after

image

@pengHTYX You can check it too !

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

No branches or pull requests

4 participants