Good morning!
I am a student trying to develop a Blender add-on for automating an optimization workflow. My knowledge about Python and programming in general is limited.
My question is about the select_pattern() function (https://docs.blender.org/api/current/bpy.ops.object.html).
I am currently working on an UI Panel where I would like the user to be able to enter a name in a dialog box and this name is then put through the select_pattern function. As of now, this works, but only if the user inputs the exact name of the object. I know that with * and " ", filters can be applied to the select_pattern function and this works perfectly in my experience.
So right now, if the user would like to search for the Object “TestCube”, it would only work if the user inputs that exact name.
If I would manually use the select_pattern function, I could for example say:
bpy.ops.object.select_pattern(pattern=“* test *”)
However, this would be hard-coded. I would love for the variable of the user input to be used in this function, best would be if the filters could still be applied. Is this possible?
Here is a screenshot of my code:
This is how the UI panel looks:
Thank you in advance!