Firstly, I’m sorry if this is the wrong place to post. I don’t know where to ask questions like this now that the specific Python API forum has been set to archive.
I am trying to update my Blender addon to take advantage of the new UV packing in Blender 3.6. I am having numerous problems with the new bpy.ops.uv.pack_islands()
operator. I’m hoping someone can give me a steer.
PROBLEM 1 – If you call the operator with the old arguments (as many existing scripts will), Blender will hang and then crash. This doesn’t seem like correct behavior. For example, merely executing this in the Blender terminal will cause Blender to crash for me:
bpy.ops.uv.pack_islands(rotate=True, margin=0.1)
That doesn’t seem right, but I thought I could work around it. Enter….
PROBLEM 2 – Calling this operator, even with the correct arguments, is no longer blocking. As such, I now have the issue where my script calls bpy.ops.uv.pack_islands
, and then proceeds to plough into a bunch of context incorrect errors for the code that comes after it as bpy.ops.uv.pack_islands
is still trying to complete.
Previously, I have called bpy.ops.uv.pack_islands
from inside another operator. However, my script is actually a big Macro, so I had the bright idea to make bpy.ops.uv.pack_islands
an operator in the Macro in its own right. That should have allowed it to finish without before executing the next operator in the Macro (at least, that’s how it works with every other operator).
op = MACRO.define(UV_OT_pack_islands)
op.properties.udim_source= sbp.uvp_pack_to
etc.
etc.
However, that led to…
PROBLEM 3 – Merely adding bpy.ops.uv.pack_islands
to a Macro causes a context incorrect error when trying to run that Macro. It seems that just its mere presence as one of the Marco operators means that the Macro no longer runs at all.
Really hoping someone can point me in the right direction. Appreciate any help.