不參與貼圖的修改
This commit is contained in:
1 parent
fc9e18ec62
commit
05438bb2da
2 files changed
+29
-8
No files matched your search
+26
-8
@@ -112,7 +112,7 @@ def cal_reconstruction_region(psid, pid):
|
||||
fix_region()
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 重建区域计算完成')
|
||||
|
||||
def step1(pid, experience=False, makeloop=True,task_distributed_id=""):
|
||||
def step1(pid, experience=False, makeloop=True,task_distributed_id="",isNoColorTexture=""):
|
||||
libs_db.start_task({"task_type": "make", "task_key": pid})
|
||||
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 开始处理{pid}建模任务')
|
||||
@@ -166,6 +166,21 @@ def step1(pid, experience=False, makeloop=True,task_distributed_id=""):
|
||||
shutil.rmtree(os.path.join(config.sharedir, pid), ignore_errors=True)
|
||||
shutil.copytree(os.path.join(config.workdir, pid), os.path.join(config.sharedir, pid))
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} step1任务完成,移动到共享目录')
|
||||
|
||||
|
||||
#指定photo2某些图片不参与贴图
|
||||
#是否不参与贴图,true 不参与贴图
|
||||
if isNoColorTexture == "NoColorTexture":
|
||||
arrNoTextureColorPics = config.noTextureColorPics
|
||||
if arrNoTextureColorPics is not None and len(arrNoTextureColorPics) > 0:
|
||||
for camcerIndex in arrNoTextureColorPics:
|
||||
#拼装坐标文件名称
|
||||
filename = os.path.join(config.sharedir, pid,"photo2",str(camcerIndex)+"_8.xmp")
|
||||
#判断文件是否存在
|
||||
if os.path.exists(filename):
|
||||
#存在就设置不参与贴图
|
||||
libs.set_photo_join_type(config.workdir, pid, 'photo2', camcerIndex, mesh='0', texture='0')
|
||||
|
||||
|
||||
# TODO: 更新本地step1任务状态,加入step2任务队列
|
||||
if task_distributed_id == "":#不是分布式任务的时候就自动往下个步骤走,是分布式任务的时候就就执行当前任务
|
||||
@@ -184,7 +199,7 @@ def step1(pid, experience=False, makeloop=True,task_distributed_id=""):
|
||||
return
|
||||
|
||||
|
||||
def main(pid, experience=False, makeloop=True):
|
||||
def main(pid, experience=False, makeloop=True,task_distributed_id="",isNoColorTexture=""):
|
||||
if pid == '0':
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 开始进入本地任务值守模式...')
|
||||
while True:
|
||||
@@ -199,26 +214,29 @@ def main(pid, experience=False, makeloop=True):
|
||||
continue
|
||||
else:
|
||||
experience = True
|
||||
step1(pid, experience, makeloop)
|
||||
step1(pid, experience, makeloop,task_distributed_id,isNoColorTexture)
|
||||
else:
|
||||
step1(pid, experience, makeloop)
|
||||
step1(pid, experience, makeloop,task_distributed_id,isNoColorTexture)
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == '__main__':
|
||||
# 取云端redis任务,完成第一步的数据预处理后,将数据放入共享存储目录,将第二步任务塞入本地mysql队列
|
||||
# 默认循环值守,可传参数运行单一任务,以方便调试
|
||||
pid = '0'
|
||||
isNoColorTexture = ""
|
||||
if len(sys.argv) == 2:
|
||||
pids = sys.argv[1].split(',')
|
||||
for pid in pids:
|
||||
main(pid, experience=False, makeloop=False)
|
||||
main(pid, experience=False, makeloop=False,task_distributed_id="",isNoColorTexture=isNoColorTexture)
|
||||
exit()
|
||||
if len(sys.argv) == 3:
|
||||
experience = False
|
||||
if sys.argv[2] == '1':
|
||||
print('演示测试...')
|
||||
experience = True
|
||||
elif sys.argv[2] == 'NoColorTexture':
|
||||
isNoColorTexture = "NoColorTexture"
|
||||
pids = sys.argv[1].split(',')
|
||||
for pid in pids:
|
||||
main(pid, experience=experience, makeloop=False)
|
||||
main(pid, experience=experience, makeloop=False,task_distributed_id="",isNoColorTexture=isNoColorTexture)
|
||||
exit()
|
||||
main(pid, experience=False, makeloop=True)
|
||||
main(pid, experience=False, makeloop=True,task_distributed_id="",isNoColorTexture=isNoColorTexture)
|
||||
Reference in new issue
Block a user