Is it possible to get objects by part of the name?
if have 2 objects ‘Slider1_Top’ and ‘Slider2_Top’
i need to make a dynamic script so for each object the same script (Not for each object antoher script)
i tried ‘scene.objects[“Slider”, num, “_Top”]’ (Num is an int)
But that doesnt work.
Sure it is possible. The build-in method with objects[<name>] is not a good search. There is just one criteria (the name) and it does not tell you if there is more than one object matching the search criteria.
Better implement an own search:
def findByNamePrefix(objects, prefix):
return [object for object in objects if object.name.startswith(prefix)]