Dropdown list does not refresh when search operator changes its property.
Here is simple example script, use search operator and see how dropdown list updated only on mouseover.
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
Ideally this would work without any explicit update or redraw calls, however - this issue can be resolved by tagging the area for redraw.
After the assignment call
Note that normally it's best to use
context.region.tag_redraw() (which would redraw only the panel), however it's not working in this case because this region isn't active when the pop-up executes.
You could store the region before executing the operator, but this is probably more hassle than it's worth.
Neither storing the region to redraw or using context.area is enough in general case, it is necessary to iterate through all open windows and areas, otherwise tag_redraw() will not work as expected (may cause a redraw in one window but nothing happens if what needs to be updated is in the other window, or update only in one window but not in the other).
This is the solution that worked for me. Just call the function with the space type and the region type which need to be updated.
def tag_redraw(context, space_type="PROPERTIES", region_type="WINDOW"): for window in context.window_manager.windows: for area in window.screen.areas: if area.spaces.type == space_type: for region in area.regions: if region.type == region_type: region.tag_redraw()
I find it surprising that there is no standard function in the API for this.