UV Export: Allow larger sizes to be exported #104946
@ -75,7 +75,7 @@ class ExportUVLayout(bpy.types.Operator):
|
|||||||
size: IntVectorProperty(
|
size: IntVectorProperty(
|
||||||
size=2,
|
size=2,
|
||||||
default=(1024, 1024),
|
default=(1024, 1024),
|
||||||
min=8, max=32768,
|
min=8, max=65536,
|
||||||
description="Dimensions of the exported file",
|
description="Dimensions of the exported file",
|
||||||
)
|
)
|
||||||
opacity: FloatProperty(
|
opacity: FloatProperty(
|
||||||
@ -136,8 +136,12 @@ class ExportUVLayout(bpy.types.Operator):
|
|||||||
obj_eval.to_mesh_clear()
|
obj_eval.to_mesh_clear()
|
||||||
|
|
||||||
export = self.get_exporter()
|
export = self.get_exporter()
|
||||||
|
try:
|
||||||
export(filepath, polygon_data, different_colors, self.size[0], self.size[1], self.opacity)
|
export(filepath, polygon_data, different_colors, self.size[0], self.size[1], self.opacity)
|
||||||
|
except ValueError as ex:
|
||||||
|
self.report({'ERROR'}, str(ex))
|
||||||
|
return {'CANCELLED'}
|
||||||
|
finally:
|
||||||
if is_editmode:
|
if is_editmode:
|
||||||
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
|
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
|
||||||
|
|
||||||
|
@ -16,8 +16,11 @@ except ImportError:
|
|||||||
|
|
||||||
|
|
||||||
def export(filepath, face_data, colors, width, height, opacity):
|
def export(filepath, face_data, colors, width, height, opacity):
|
||||||
|
try:
|
||||||
offscreen = gpu.types.GPUOffScreen(width, height)
|
offscreen = gpu.types.GPUOffScreen(width, height)
|
||||||
offscreen.bind()
|
offscreen.bind()
|
||||||
|
except RuntimeError:
|
||||||
|
raise ValueError("Texture allocation failed. Try using a smaller size for export.")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fb = gpu.state.active_framebuffer_get()
|
fb = gpu.state.active_framebuffer_get()
|
||||||
|
Loading…
Reference in New Issue
Block a user