OpenDroneMap / Obj2Tiles

Converts OBJ files to OGC 3D tiles by performing splitting, decimation and conversion
GNU Affero General Public License v3.0
196 stars 58 forks source link

Error not applying texture #44

Closed yhboo712 closed 1 year ago

yhboo712 commented 1 year ago

hi I am using this tool well. However, when I extract b3dm and tileset.json from obj and upload them to Unreal Cesium, the mtl is not applied, so they are visualized without textures. I don't know why. I attach the .obj I used and send it.

import os
import subprocess

# Set the path to the Obj2Tiles executable
obj2tiles_path = r"a"

# Set the input and output paths
input_folder = r"a"
output_folder = r"a"

# Set the options
lods = 1
divisions = 1
lat = 34.9088325995
lon = 128.6168433943
alt = 250
# zsplit = "Ture"
keeptextures  = "Ture"
#"--keeptextures",str(keeptextures)
#"--zsplit", str(lon)
# "--lat", str(lat), "--lon", str(lon)

# Find all OBJ files in the input folder
for filename in os.listdir(input_folder):
    if filename.endswith(".obj"):
        input_path = os.path.join(input_folder, filename)
        # Add a suffix to the output filename
        output_filename = os.path.splitext(filename)[0] + "output"
        output_path = os.path.join(output_folder, output_filename)
        # Run Obj2Tiles
        subprocess.run([obj2tiles_path, input_path, output_path, "--lods", str(lods), "--divisions", str(divisions),"--lat", str(lat), "--lon", str(lon),"--alt", str(alt),"--keeptextures"])

test.zip

jingyangking commented 2 months ago

Hello, sorry to bother you. May I ask why the original attribute information of the OBJ model is lost after being converted to tiles? How can I save this attribute information? Thank you