Comments (7)
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.
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.
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.
@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.
@PRAKHAR-bit
Hi, see Qingcsai/3DVirtualTryOn#1 (comment)
from mesh.
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.
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)
- psbody.mesh.errors.SerializationError: Failed to open PLY file. HOT 1
- Failed to build psbody-mesh
- warning: ‘PyObject* aabbtree_normals_selfintersects(PyObject*, PyObject*)’ used but never defined
- tests error
- mesh/src/aabb_normals.cpp doesn't compile with python 3.10 (or 3.9) but does work with python 3.8 HOT 2
- pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"
- error: command '/usr/bin/gcc' failed with exit code 1&make: *** [Makefile:7: all] Error 1 HOT 5
- ModuleNotFoundError: No module named 'psbody.mesh.serialization.loadobj'
- warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] return Uncertain<bool>(a.inf() | b.inf(), a.sup() | b.sup()); ^~~~~~~~~~~~~~~~~
- error: command '/usr/bin/gcc' failed with exit code 1 HOT 1
- Not able to run "make all" and install "psbody-mesh" HOT 9
- can't import plyutils HOT 1
- latest pip deprecates install-option HOT 2
- mesh.compute_aabb_tree.intersection_indices() gives 'spatialsearch' has no attribute 'aabbtree_intersections_indices' error
- this file cannot be executed as a standalone python module ;python -m psbody.mesh.meshviewer arguments HOT 1
- make all failed mesh/src/AABB_n_tree.h:6:10: fatal error: vector: No such file or directory HOT 1
- installation issue
- build psbody-mesh ocurrs error Unknown endianness HOT 1
- psbody repository HOT 1
- no such option: --install-option make: *** [Makefile:7:all] 错误 2 HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mesh.