theFroh / imagepacker

Takes a Wavefront OBJ with textures and attempts to squash them into a single texture file.
MIT License
51 stars 9 forks source link

Error #10

Open Tom9470 opened 4 years ago

Tom9470 commented 4 years ago

i keep on getting this error: Traceback (most recent call last): File "objuvpacker.py", line 326, in main() File "objuvpacker.py", line 256, in main output_image, uv_changes = pack_images(list(set(dmaps)), extents=textents) # remove duplicates File "C:\Users*\OneDrive\Documents\earth-reverse-engineering-utils-master\earth-reverse-engineering-utils-master\imagepacker\imagepacker.py", line 239, in pack_images image, changes = crop_by_extents(image, extents[filename], tile, crop) File "C:\Users*\OneDrive\Documents\earth-reverse-engineering-utils-master\earth-reverse-engineering-utils-master\imagepacker\imagepacker.py", line 169, in crop_by_extents coords = [math.floor(extent.min_xw), math.floor(extent.min_yh), TypeError: unsupported operand type(s) for *: 'NoneType' and 'int' after i use this command: python objuvpacker.py C:\Users*****\OneDrive\Documents\earth-reverse-engineering-utils-master\earth-reverse-engineering-utils-master\downloaded_files\obj\3060417360436156121+3060417360436156123+3060417360436156130+3060417360436156131+3060417360436156301+3060417360436156311-20-874\model.obj

pragna-s commented 2 months ago

Hi, Did you find a solution to this?

theFroh commented 2 months ago

Is your error also TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'?

It looks like it's returning None for one of the extents. Can you uncomment (remove the #) on this line and give it a run: https://github.com/theFroh/imagepacker/blob/823300faccb6e279a955608e39e48b7473c7bb77/objuvpacker.py#L220

This should print all of the extents it picked in the file. If you copy that and throw it here I can see if there's something obvious.

Alternatively if you can share the object you're trying to do this with, I can see if I can replicate it with that.