Coder Social home page Coder Social logo

Comments (7)

jcpassy avatar jcpassy commented on August 21, 2024

Hi @Qingcsai, I would need a bit more details to find out what is happening. Could you please try to reproduce your issue with some files from the data folder, post the full code, and explain what is not working?

Thanks!

from mesh.

Qingcsai avatar Qingcsai commented on August 21, 2024

Hi @jcpassy I have solved this question. I just want to add some texture to .obj files, so I tried to write the ft, vt, f by myself.

But now I think I considered this problem over complicated before when I find two functions in Mesh(), which is .set_texture_image() and .write_obj().

This two functions totally solved my question, and here's the method for helping others who might want to add some texture images to their .obj files:

import os
from os.path import join
from psbody.mesh import Mesh

path = 'PATH_TO_YOUR_OBJ_FILE'
your_mesh = Mesh(filename = join(path, 'your_mesh.obj'))
your_mesh.set_texture_image(join(path, 'sample_texture.jpg'))
your_mesh.write_obj('PATH_TO_SAVE_IT/your_mesh.obj')

Thanks for your great work!
I will close this issue.

from mesh.

jcpassy avatar jcpassy commented on August 21, 2024

Thanks @Qingcsai , glad you got it to work. If you are interested, I think it would be great to add your little example to the documentation. If you issue a PR, I would gladly review it and add your contribution to the next release.
Cheers!

from mesh.

PRAKHAR-bit avatar PRAKHAR-bit commented on August 21, 2024

@Qingcsai
How do you do it. I did but still did not get any texture. and in the mesh repo the .mtl file is constant for all SMPL wont it affect the result
What I did in the code of MultiGarmentNet is that I saved the new_garment as an obj and tried to view it but no benifit. Fitting is their but no texture

from mesh.

Qingcsai avatar Qingcsai commented on August 21, 2024

@PRAKHAR-bit
Hi, see Qingcsai/3DVirtualTryOn#1 (comment)

from mesh.

Qingcsai avatar Qingcsai commented on August 21, 2024

Thanks @Qingcsai , glad you got it to work. If you are interested, I think it would be great to add your little example to the documentation. If you issue a PR, I would gladly review it and add your contribution to the next release.
Cheers!

Hi, in fact I laterly realized

your_mesh.set_texture_image(join(path, 'sample_texture.jpg'))
your_mesh.write_obj('PATH_TO_SAVE_IT/your_mesh.obj')

only save the constant .mtl files for all the .obj, for texture I still need to edit the vt *** and f *** stuffs by myself, so I am afraid it's not enough to add texture to .obj files by the above code, which is the reason why I din't issue a PR.
Anyway, thanks again for your great work!

from mesh.

haiderasad avatar haiderasad commented on August 21, 2024

hi @Qingcsai any idea on how to add vt and refined f values into an obj with no vt? also any script that automatically generates obj files with vt values

from mesh.

Related Issues (20)

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.