Search list and build list from list.....

Ok

List

polyProp = object.getPropertyNames()

list=[not what I need, something else,FaceIndex_01,FaceIndex_02,FaceIndex_03 etc]

I need to search for a string in this list “FaceIndex” and build another list that is the pieces of the list containing the script…

that was a mouth-full…


list2 = []
for item in list:
    if 'FaceIndex' in item:
        list2.append(item)

Thank you kind sir :slight_smile:

I need some help with syntax, I keep breaking it and I am not sure why, though I think I may be indenting wrong,
here is what I need to add to the script without breaking it
how do I format a section as code so it does not kill my spacing?(in blender artists editor):slight_smile:

polyProps = []
polyProps = object.getPropertyNames()

list2 = []
for item in polyProps:
if ‘FaceIndex’ in item:
list2.append(item)

here is the script
http://www.pasteall.org/40237/python

You just have to indent it


polyProps = []
polyProps = object.getPropertyNames()

list2 = []
for item in polyProps:
    if 'FaceIndex' in item:
        list2.append(item)

Thank you for your help :slight_smile:

Ok, I got it working :slight_smile:

Next I need a list that is
value of each property on the list polyProperties

I need to check against that as well for anything that does not equal “empty”