for m in bpy.data.meshes:m.validate(1)
can someone explain what it does
and where I can find more doc on this ?
is it possible to list only bad object
and give what is wrong may be!
thanks
happy bl
for m in bpy.data.meshes:m.validate(1)
can someone explain what it does
and where I can find more doc on this ?
is it possible to list only bad object
and give what is wrong may be!
thanks
happy bl
validate(verbose=False)
validate geometry, return True when the mesh has had invalid geometry corrected/removed
[TABLE=“class: docutils field-list”]
[TR=“class: field-odd field”]
[TH=“class: field-name”]Parameters:[/TH]
verbose (boolean, (optional)) – Verbose, Output information about the errors found
[/TR]
[TR=“class: field-even field”]
[TH=“class: field-name”]Returns:[/TH]
Result
[/TR]
[TR=“class: field-odd field”]
[TH=“class: field-name”]Return type:[/TH]
boolean
[/TR]
[/TABLE]
ok but got so many ob I cannot find the bad one alone
is there a way not to fill up the console ?
I tried with 0 or 1 and still filling up the console!
thanks
you should validate every mesh after you created before continuing.
verbose=False is the default, so no, you can’t make it print less to the console, but why do you care at all?
You can clear the entire system console if necessary. Or add important stuff to the py console maybe.
this is for bug report
I don’t really care about good ob cause they are ok
I have to test this one which is supposed to work for only bad ob
for m in bpy.data.meshes:
if m.validate(1):
print(m.name)
just tested it and still console filled up
how can I know which ob are bad only?
thanks
that’s what validate() is for ?!
ok which ob are bad ?
the list is so long and get only this
so does it means that all ob are bad ?
thanks
ok did a test with this
import bpy
cn1=0
for m in bpy.data.meshes:
if m.validate(1):
print ('m = ',m)
cn1+=1
print ()
print (‘count =’,cn1)
so it should calculate the number of bad items I guess
did test and it always filled up the console
but bad items = 0!
which is very strange
thanks
it would tell you about bad meshes, as it fixes them (and reports what it did), you may want to use verbose=True
so this will correct the bad things too !
did not know that !
so If file had bad things now it does not have it anymore!
the flag is set = 1
but not certain what it does
is it to only show what it does or not ?
thanks
I found older file backup
and ran script
and I find that there was 2 ob with problems I guess
but name is cube.012 and cube.013
but this is the mesh name not ob name
is there a way from this to get the ob name
so I can find which one in the outliner
import bpy
cn1=0
cn2=0
bad1=[]
for m in bpy.data.meshes:
if m.validate(1):
print ('Bad mesh $$$$$$$$$$$$$$$ m = ',m)
print ('mesh name =',m.name)
bad1.append(m.name)
cn1+=1
else:
cn2+=1
print ()
print ('Bad mesh count =',cn1)
print ('good mesh count =',cn2)
print ()
if len(bad1)> 0:
print ()
print ('Bad mesh list')
print ()
for i in range (0,len(bad1)):
print ('i =',i, bad1[i])
thanks
also is there other test that can be done to check If something is wrong with a mesh ?
thanks