I've been reading through this page on how to change the context of a Python script so that the poll is correct. I recently ran the AssetGen addon that broke because it reported that bpy.ops.uv.smart_project.poll() failed because its context is incorrect:
Apparently, the context for UV unwrapping is now only edit mode and not object mode as well (https://developer.blender.org/T83038). If I want to edit this addon to work properly, how can I set the context to edit mode before the smart_project operator is called?
Thanks!
bpy.ops.object.mode_set(mode = 'EDIT')
into line 363 which is currently blank andbpy.ops.object.mode_set(mode = 'OBJECT')
into line 365 which is also currently blank. Just be sure to have the indentation match up around line 364. (in the GA.py file) cant help you with the addon file location on linux though sorry. $\endgroup$bpy.ops.object.editmode_toggle()
and that seemed to do the job as well! So it's not throwing a runtime error anymore, but it seems that there's some other broken things with the addon sadly :) Thanks for the help! $\endgroup$