Start a new topic

automatic UV faces which have different textures

Hello, i have hundreds of models, many of the faces have no uv coordinate , (it is a very thin line in uv layout)

one building assigned with different textures. which not allowed in CDB format and throw errors. so need to fix mannually.


the problem uv faces ID list are provided like this,in a .txt file,super long...

p1

p2

p3

p3440

.....


I trying to using scripts to auto-uv, ended only like this


with open('lst_name.txt','r') as f:

   lst = f.read().splitlines()

def selectID(x):

   paramBlock = mgGetParamBlock('Select from ID')

   mgParamSet(ParamBlock,'Add to Select List',MG_TRUE)

   mgParamSet(ParamBlock,'ID',x)

   mgExecute('Select from ID',paramBlock)

for id in lst:

    selectID(id)

 

  But the problem is ,when i select all the non UV faces out, i try to  use Surface Project,it applied only current texture,

by right, i want all  other textures to be kept, such as bricks, windows,etc. now all became bricks.


in API of ' creator script tools' ,only 'Spherical Project' supported. so how can we use 'Surface Project'?


i also tried 

mgSetAttList(rec,fltVU,1 fltVV.1)

which will set all the vertexs same 1,1 value.


i also tried :

mgSetAttList(rec,fltTMSphericalProject)

it crashed my creator18.


creator File is in attachment. I know Openflt API is not for Beginner like me,and I should not expect ppl spoon feeding me everytime,

 but any hint or a word related will be nice! cos i dig the forum for days still not solve it.

Or just simply confirm this cannot be done by script.

Thanks in advance!


Yingbo



rar
(179 KB)
Login to post a comment