Last active
March 27, 2017 09:24
-
-
Save AlexKucera/66c0ad40f78c71801ba9a1fd77a068ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
def modo_cad_convert(modo_process=None, items=None): | |
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) | |
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()) | |
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(items=items) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment