import pymel.core as pm
def is_within_tolerance(value, tolerance=0.001):
return -tolerance <= value <= tolerance
def is_scale_within_tolerance(value, tolerance=0.001):
return 1 - tolerance <= value <= 1 + tolerance
def find_non_zero_transform_objects():
all_objects = pm.ls()
con_objects = [obj for obj in all_objects if obj.name().endswith('_con')]
non_zero_transform_objects = []
for obj in con_objects:
translation = pm.xform(obj, query=True, translation=True, worldSpace=False)
rotation = pm.xform(obj, query=True, rotation=True, worldSpace=False)
scale = pm.xform(obj, query=True, scale=True, worldSpace=False)
if (any(not is_within_tolerance(val) for val in translation + rotation) or
any(not is_scale_within_tolerance(val) for val in scale)):
non_zero_transform_objects.append(obj)
return non_zero_transform_objects
non_zero_transform_objects = find_non_zero_transform_objects()
print("Objects with non-zero transforms:", non_zero_transform_objects)