优化
This commit is contained in:
1 parent
3197efd6a3
commit
46dacc2f7c
7 files changed
+62
-13
No files matched your search
+27
-3
@@ -1,5 +1,6 @@
|
||||
import os, sys, time, shutil, subprocess, shlex
|
||||
import platform
|
||||
import pyautogui as ag
|
||||
if platform.system() == 'Windows':
|
||||
sys.path.append('e:\\libs\\')
|
||||
#sys.path.append('libs')
|
||||
@@ -23,7 +24,7 @@ def get_rcver():
|
||||
def make3d(pid):
|
||||
if get_rcver() == 1: # old version
|
||||
#修改重建区域的大小
|
||||
common.change_rcbox_s(pid,"0.999")
|
||||
common.change_rcbox_s(pid,"1")
|
||||
#获取影棚id
|
||||
# psid = libs.getPSid(pid)
|
||||
# if int(psid) == 80:
|
||||
@@ -34,6 +35,26 @@ def make3d(pid):
|
||||
#判断是否存在photo3
|
||||
if os.path.exists(os.path.join(config.workdir, pid, 'photo3')):
|
||||
add_photo3 = ' -addFolder "' + os.path.join(config.workdir, pid, 'photo3') + '" -align -align '
|
||||
#存在photo3 的情况下,photo2 不参与贴图
|
||||
#遍历获取photo2 目录下的所有文件
|
||||
directory = os.path.join(config.workdir, pid, 'photo2')
|
||||
for root, dirs, files in os.walk(directory):
|
||||
for file in files:
|
||||
#判断file 是否以 _8.xmp 结尾
|
||||
if file.endswith("_8.xmp") == False:
|
||||
continue
|
||||
#修改文件内容不参与贴图
|
||||
libs.set_photo_join_type(config.workdir, pid, 'photo2', file.split("_")[0], mesh='0', texture='0')
|
||||
else:
|
||||
#设置photo2参与贴图,因为有的时候贴图会黑
|
||||
directory = os.path.join(config.workdir, pid, 'photo2')
|
||||
for root, dirs, files in os.walk(directory):
|
||||
for file in files:
|
||||
#判断file 是否以 _8.xmp 结尾
|
||||
if file.endswith("_8.xmp") == False:
|
||||
continue
|
||||
#修改文件内容不参与贴图
|
||||
libs.set_photo_join_type(config.workdir, pid, 'photo2', file.split("_")[0], mesh='0', texture='1')
|
||||
|
||||
if get_rcver() == 1: # old version
|
||||
|
||||
@@ -97,14 +118,17 @@ def make3d(pid):
|
||||
print(cmd)
|
||||
cmd = shlex.split(cmd)
|
||||
res = subprocess.run(cmd)
|
||||
|
||||
#保存在导出
|
||||
# common.saveScreenImg(pid)
|
||||
# time.sleep(1)
|
||||
# ag.hotkey('alt', 'f4')
|
||||
time.sleep(3)
|
||||
#修改rcproj文件
|
||||
flag = common.changeRcprojFile(pid)
|
||||
if flag == False:
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} rcproj文件不存在')
|
||||
return
|
||||
#保存在导出
|
||||
|
||||
|
||||
#创建指定文件夹
|
||||
if not os.path.exists(os.path.join(config.workdir, pid, "output")):
|
||||
|
||||
Reference in new issue
Block a user