Skip to content

Instantly share code, notes, and snippets.

@AlexKucera
Created March 27, 2017 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexKucera/53f905f1b103add897d0879df1d77f5c to your computer and use it in GitHub Desktop.
Save AlexKucera/53f905f1b103add897d0879df1d77f5c to your computer and use it in GitHub Desktop.
import os
import subprocess
def modo_start():
modo_cl = "/Volumes/ProjectsRaid/x_Pipeline/x_AppPlugins/modo/modo_10.2v1.app/Contents/MacOS/modo_cl"
modo_proc = subprocess.Popen(modo_cl,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
shell=False)
print(modo_proc.stdout.readline())
print(modo_proc)
return modo_proc
def modo_cad_convert(modo_process=None, items=None):
modo_proc = modo_process
for item in items:
itemname = os.path.splitext(os.path.basename(item))[0]
output = os.path.dirname(item)
cad_output = output + os.sep + itemname + ".lxo"
modo_proc.stdin.write('!scene.open {}\n'.format(item))
print(modo_proc.stdout.readline())
modo_proc = modo_start()
items = ["/Volumes/ProjectsRaid/WorkingProjects/mccroreydigital/mcd-2017_001-ljsmith_batch_processor/work/ljsmith_batch_processor/PaulUploads/ProjectAssets/TestModels/LJ-5360-34.step",
"/Volumes/ProjectsRaid/WorkingProjects/mccroreydigital/mcd-2017_001-ljsmith_batch_processor/work/ljsmith_batch_processor/PaulUploads/ProjectAssets/TestModels/LJT-2015.STEP"]
modo_cad_convert(modo_process=modo_proc, items=items)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment