Skip to content

Commit

Permalink
feat: add Objhandel str
Browse files Browse the repository at this point in the history
  • Loading branch information
phillychi3 committed Mar 25, 2024
1 parent 6b27b4c commit 0e6c93c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion t3dlitematica/objbuilder/toobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def LitimaticaToObj(litematica: dict, TextureFolder: str, output: str = "./") ->
)
regonname = list(litematica["Regions"].keys())[0]
litematica = litematica["Regions"][regonname]["decode_BlockStates"]
Objhandel("test", litematica, size, TextureFolder, output)
return Objhandel(litematica["Metadata"]["Name"], litematica, size, TextureFolder, output)

class Objhandel:
def __init__(self, name:str, data:List[dict], size:tuple[int,int,int],TextureFolder:str,outputfolder:str,show_error_block:bool=False) -> None:
Expand All @@ -35,6 +35,9 @@ def __init__(self, name:str, data:List[dict], size:tuple[int,int,int],TextureFol
shutil.make_archive(os.path.join(self.outputfolder, self.name), "zip", self.tempfolder)
shutil.rmtree(self.tempfolder)

def __str__(self) -> str:
return str(os.path.join(self.outputfolder, self.name) + ".zip")

def main(self, data, size):
data = list(reversed(data))
x = size[0]
Expand Down

0 comments on commit 0e6c93c

Please sign in to comment.