UV Export: Allow larger sizes to be exported #104946

Open
Jesse Yurkovich wants to merge 2 commits from deadpin/blender-addons:uvexport-large into blender-v4.0-release

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

Bug blender/blender#110524 is two
issues combined. The first issue is addressed elsewhere[1].

The second issue is addressed here, where the Size property has a lower
limit than what they'd like to use.

For SVG and EPS documents it's simple to just permit a larger size. PNG,
however, depends on GPU support for creating and manipulating the image
which in turn places an ultimate limit on what's possible[2]. Since
there's no way to query this information from python beforehand, make
the existing exception that would be received a bit more friendly by
using an operator Report and canceling the operation.


[1] blender/blender#113566
[2]

Traceback (most recent call last):
  File "C:\Users\jesse\source\blender-git\build-full\bin\RelWithDebInfo\4.0\scripts\addons\io_mesh_uv_layout\__init__.py", line 176, in execute
    export(filepath, tile, polygon_data, different_colors,
  File "C:\Users\jesse\source\blender-git\build-full\bin\RelWithDebInfo\4.0\scripts\addons\io_mesh_uv_layout\export_uv_png.py", line 19, in export
    offscreen = gpu.types.GPUOffScreen(width, height)
RuntimeError: gpu.offscreen.new(...) failed with 'GPUTexture: Texture allocation failed.'
Bug https://projects.blender.org/blender/blender/issues/110524 is two issues combined. The first issue is addressed elsewhere[1]. The second issue is addressed here, where the Size property has a lower limit than what they'd like to use. For SVG and EPS documents it's simple to just permit a larger size. PNG, however, depends on GPU support for creating and manipulating the image which in turn places an ultimate limit on what's possible[2]. Since there's no way to query this information from python beforehand, make the existing exception that would be received a bit more friendly by using an operator Report and canceling the operation. ---- [1] https://projects.blender.org/blender/blender/pulls/113566 [2] ``` Traceback (most recent call last): File "C:\Users\jesse\source\blender-git\build-full\bin\RelWithDebInfo\4.0\scripts\addons\io_mesh_uv_layout\__init__.py", line 176, in execute export(filepath, tile, polygon_data, different_colors, File "C:\Users\jesse\source\blender-git\build-full\bin\RelWithDebInfo\4.0\scripts\addons\io_mesh_uv_layout\export_uv_png.py", line 19, in export offscreen = gpu.types.GPUOffScreen(width, height) RuntimeError: gpu.offscreen.new(...) failed with 'GPUTexture: Texture allocation failed.' ```
Jesse Yurkovich added 2 commits 2023-10-12 07:12:41 +02:00

Tagging here the authors of the addon listed @ideasman42 and @broken. (Maybe they will be interested in reviewing this change).

At a quick glance, I found the block with finally a little strange since the use of return within the except block seems to have the potential to interrupt the execution of the code in the finally block.

Tagging here the authors of the addon listed @ideasman42 and @broken. (Maybe they will be interested in reviewing this change). At a quick glance, I found the block with `finally` a little strange since the use of `return` within the `except` block seems to have the potential to interrupt the execution of the code in the `finally` block.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u uvexport-large:deadpin-uvexport-large
git checkout deadpin-uvexport-large
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#104946
No description provided.