2 つのリストをループして結合しようとしています。しかし、ループ コードの構造化に問題があります。
これは Softimage (アニメーション 3D プログラム) のコードですが、意味があるといいのですが。
これは私が持っているものです:
import os
import glob
app = Application
storeSelect=[]
mypath = app.ActiveProject.ActiveScene.filename.value
folder=[]
storeAll=[]
listObj=[]
path=[]
storeSelecte=[]
folderAll=[]
#Seleccion
app.SelectObj("*.geometry_cache_grp*")
mySelection = app.Selection
# GETS PATHS FOr each Character Folder
userPath=Application.XSIInputBox ("Direccion de Cache", "Cache")+ "/"
os.chdir(userPath)
#/loops
for lis in mySelection:
storeSelect.append(lis)
members = app.SelectMembers(lis)
app.SelectObj("*.geometry_cache_grp*")
mySelection = app.Selection
for files in sorted(glob.glob("*.scn_c*")):
folder=files
for lise in members:
print lise,folder
しかし、次のように結果を 2 回取得しています。
# DI_CACHE.lengua Anim_2p.scn_c_DI_rig
# DI_CACHE.vidrios Anim_2p.scn_c_DI_rig
# DI_CACHE.dientes_abajo Anim_2p.scn_c_DI_rig
# DI_CACHE.lengua Anim_2p.scn_c_TOTO_GALLO_rig
# DI_CACHE.vidrios Anim_2p.scn_c_TOTO_GALLO_rig
# DI_CACHE.dientes_abajo Anim_2p.scn_c_TOTO_GALLO_rig
# TOTO_GALLO_cache.lengua Anim_2p.scn_c_DI_rig
# TOTO_GALLO_cache.dientes_01 Anim_2p.scn_c_DI_rig
# TOTO_GALLO_cache.plumas_guantes Anim_2p.scn_c_DI_rig
# TOTO_GALLO_cache.lengua Anim_2p.scn_c_TOTO_GALLO_rig
# TOTO_GALLO_cache.dientes_01 Anim_2p.scn_c_TOTO_GALLO_rig
# TOTO_GALLO_cache.plumas_guantes Anim_2p.scn_c_TOTO_GALLO_rig
私のループを修正する方法を知っている人はいますか? 結果は次のようになります。
# DI_CACHE.lengua Anim_2p.scn_c_DI_rig
# DI_CACHE.vidrios Anim_2p.scn_c_DI_rig
# DI_CACHE.dientes_abajo Anim_2p.scn_c_DI_rig
# TOTO_GALLO_cache.lengua Anim_2p.scn_c_TOTO_GALLO_rig
# TOTO_GALLO_cache.dientes_01 Anim_2p.scn_c_TOTO_GALLO_rig
# TOTO_GALLO_cache.plumas_guantes Anim_2p.scn_c_TOTO_GALLO_rig