Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
sttng authored Oct 13, 2020
1 parent 2fe3cce commit c317b68
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
10 changes: 6 additions & 4 deletions LegoToR.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Usage: ./LegoToR.py /Users/username/Documents/LEGO\ Creations/Models/mylxffile.lxf -v -np
#
# Updates:
# 0.5.3.5 Preliminary Linux support
# 0.5.3 improved brick-seams generation. Implement nocsv switch (-nc) to ignore using csv colors and use LDD build-in colors instead
# 0.5.2.1 corrected Windows path handling bugs
# 0.5.2 improved Windows and Python 3 compatibility
Expand Down Expand Up @@ -48,7 +49,7 @@
import random
import posixpath

__version__ = '0.5.3'
__version__ = '0.5.3.5'
compression = zipfile.ZIP_DEFLATED
PRMANPATH = '/Applications/Pixar/RenderManProServer-23.4/'
PRMANDIR = os.path.basename(os.path.normpath(PRMANPATH))
Expand Down Expand Up @@ -1063,14 +1064,14 @@ def Export(self, filename):
print('--- %s seconds ---' % (time.time() - start_time))

def FindRmtree():
if os.name =='posix':
if platform.system() == 'Darwin':
rmtree = os.getenv('RMANTREE')
if rmtree is not None:
return str(rmtree)
else:
print('RMANTREE environment variable not set correctly. Set with: \n\nexport RMANTREE={0}\nexport PATH="$PATH:$RMANTREE/bin"\n'.format(PRMANPATH))
exit()
else:
elif platform.system() == 'Windows':
rmtree = os.getenv('RMANTREE')
if rmtree is not None:
rmtree = os.path.normpath(rmtree)
Expand All @@ -1080,7 +1081,8 @@ def FindRmtree():
else:
print('RMANTREE environment variable not set correctly. Set with: setx RMANTREE "C:\Program Files\Pixar\{0}\" /M'.format(PRMANDIR))
exit()

elif platform.system() == 'Linux':
print('Linux RMANTREE envvar settings here. Still need to be defined.')

def generate_rib_header(infile, srate, pixelvar, width, height, fov, fstop, searcharchive, searchtexture, integrator, integratorParams, useplane, usenormal, uselogoonstuds, usecsvcolors):
cwd = os.getcwd()
Expand Down
6 changes: 3 additions & 3 deletions LegoToRHD.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python

#
# LegoToRHD Version 0.5.3 - Copyright (c) 2020 by m2m
# based on pyldd2obj Version 0.4.8 - Copyright (c) 2019 by jonnysp
# LegoToRHD Version 0.5.3.5 on 0.4.8 - Copyright (c) 2019 by jonnysp
# LegoToRHD parses LXF files and command line parameters to create USDA compliant files.
#
# Usage: ./LegoToRHD.py /Users/username/Documents/LEGO\ Creations/Models/mylxffile.lxf -np
#
# Updates:
# 0.5.3.5 Preliminary Linux support
# 0.5.3 improved brick-seams generation. Implement nocsv switch (-nc) to ignore using csv colors and use LDD build-in colors instead
# 0.5.2.1 corrected Windows path handling bugs
# 0.5.2 improved Windows and Python 3 compatibility
Expand Down Expand Up @@ -42,7 +42,7 @@
import ParseCommandLine as cl
import random

__version__ = "0.5.3"
__version__ = "0.5.3.5"

compression = zipfile.ZIP_STORED #uncompressed archive for USDZ, otherwise would use ZIP_DEFLATED, the usual zip compression

Expand Down
18 changes: 14 additions & 4 deletions pylddlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# based on pyldd2obj version 0.4.8 - Copyright (c) 2019 by jonnysp
#
# Updates:
# 0.4.9.6 preliminary Linux support
# 0.4.9.5 corrected bug in incorrecting Bounding / GeometryBounding parsing of primitive xml file.
# 0.4.9.4 improved lif.db checking for crucial files (because of the infamous botched 4.3.12 LDD Windows update).
# 0.4.9.3 improved Windows and Python 3 compatibility
Expand All @@ -14,6 +15,7 @@
#

import os
import platform
import sys
import math
import struct
Expand Down Expand Up @@ -811,10 +813,14 @@ def Export(self,filename):


def FindDBFolder():
if os.name =='posix':
if platform.system() == 'Darwin':
return str(os.path.join(str(os.getenv('USERPROFILE') or os.getenv('HOME')),'Library','Application Support','LEGO Company','LEGO Digital Designer','db'))
else:
elif platform.system() == 'Windows':
return str(os.path.join(str(os.getenv('USERPROFILE') or os.getenv('HOME')),'AppData','Roaming','LEGO Company','LEGO Digital Designer','db'))
elif platform.system() == 'Linux':
return str(os.path.join(str(os.getenv('USERPROFILE') or os.getenv('HOME')),'.wine','drive_c','users',os.getenv('USER'),'Application Data','LEGO Company','LEGO Digital Designer','db'))
else:
print('Your OS {0} is not supported yet.'.format(platform.system()))

def setDBFolderVars(dbfolderlocation):
global PRIMITIVEPATH
Expand All @@ -827,10 +833,14 @@ def setDBFolderVars(dbfolderlocation):
MATERIALNAMESPATH = dbfolderlocation + '/MaterialNames/'

def FindDatabase():
if os.name =='posix':
if platform.system() == 'Darwin':
return str(os.path.join(str(os.getenv('USERPROFILE') or os.getenv('HOME')),'Library','Application Support','LEGO Company','LEGO Digital Designer','db.lif'))
else:
elif platform.system() == 'Windows':
return str(os.path.join(str(os.getenv('USERPROFILE') or os.getenv('HOME')),'AppData','Roaming','LEGO Company','LEGO Digital Designer','db.lif'))
elif platform.system() == 'Linux':
return str(os.path.join(str(os.getenv('USERPROFILE') or os.getenv('HOME')),'.wine','drive_c','users',os.getenv('USER'),'Application Data','LEGO Company','LEGO Digital Designer','db.lif'))
else:
print('Your OS {0} is not supported yet.'.format(platform.system()))

def progress(count, total, status='', suffix = ''):
bar_len = 40
Expand Down

0 comments on commit c317b68

Please sign in to comment.