I have a script that uses
a list to check against,
it grabs the last 2 pieces of a material name with “hitID = int(hitMat[-2:])”
like Sensor_01
it would turn into
01,
this works great, until I get to 10,
can some one help me change the system so that it does not break if I get to 10?
I would just use lables like A B C D etc, but the script is set to do math using the label…
is there a easy way to do item = item -“Sensor_”
hitMat = hitPoly.material_name
# check the material name if it contains a string value
if ‘Sensor_’ in hitMat:
# get the suffix of the material name
hitID = int(hitMat[-2:])
# get the material’s pair from the pairs list
pair = pairs[hitID-1]