You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I create a plant model in LPy, I am able to view it in the integrated PlantGL viewer with the relevant textures loaded on the plant organs correctly. However, when exporting to ply through the viewer, the textures do not save. It would be super if this could be fixed so that they do.
I have also tried to programmatically save an .obj, but textures cause the built in functions below to fail.
I have investigated further and am able to manually save points and faces to an .obj, but I have found that the texture coordinates are missing and just set to None for each shape. I was hoping you may be able to enlighten me as to how I can save my plant model with its textures as either ply or obj. I have tried recalculating texture vertices, but this currently maps the textures wrongly and I am sure that the real values are somehow lost at some point since it is mapped correctly in the PlantGL viewer from LPy.
Minimal code to illustrate issue below:
def tessellate_geometry(geometry):
"""Convert parametric shapes into a TriangleSet."""
tesselator = Tesselator()
tesselator.process(geometry)
return tesselator.triangulation
...
for shape in scene:
geometry = shape.geometry
if isinstance(geometry, Translated):
tesselated_geom = tessellate_geometry(geometry.geometry)
# tesselated_geom.texCoordList is None
The text was updated successfully, but these errors were encountered:
Upon further digging, saving as an .obj using lscene.save only fails if the special primitive ~l is used to make a leaf shape with a texture assigned to it somewhere in the production rules.
When I create a plant model in LPy, I am able to view it in the integrated PlantGL viewer with the relevant textures loaded on the plant organs correctly. However, when exporting to ply through the viewer, the textures do not save. It would be super if this could be fixed so that they do.
I have also tried to programmatically save an .obj, but textures cause the built in functions below to fail.
lstring = lsys.derive()
lscene = lsys.sceneInterpretation(lstring)
lscene.save(f"mesh.obj")
I have investigated further and am able to manually save points and faces to an .obj, but I have found that the texture coordinates are missing and just set to None for each shape. I was hoping you may be able to enlighten me as to how I can save my plant model with its textures as either ply or obj. I have tried recalculating texture vertices, but this currently maps the textures wrongly and I am sure that the real values are somehow lost at some point since it is mapped correctly in the PlantGL viewer from LPy.
Minimal code to illustrate issue below:
def tessellate_geometry(geometry):
"""Convert parametric shapes into a TriangleSet."""
tesselator = Tesselator()
tesselator.process(geometry)
return tesselator.triangulation
...
for shape in scene:
geometry = shape.geometry
if isinstance(geometry, Translated):
tesselated_geom = tessellate_geometry(geometry.geometry)
# tesselated_geom.texCoordList is None
The text was updated successfully, but these errors were encountered: