UV Export: Allow larger sizes to be exported #104946
@ -136,10 +136,14 @@ class ExportUVLayout(bpy.types.Operator):
|
|||||||
obj_eval.to_mesh_clear()
|
obj_eval.to_mesh_clear()
|
||||||
|
|
||||||
export = self.get_exporter()
|
export = self.get_exporter()
|
||||||
export(filepath, polygon_data, different_colors, self.size[0], self.size[1], self.opacity)
|
try:
|
||||||
|
export(filepath, polygon_data, different_colors, self.size[0], self.size[1], self.opacity)
|
||||||
if is_editmode:
|
except ValueError as ex:
|
||||||
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
|
self.report({'ERROR'}, str(ex))
|
||||||
|
return {'CANCELLED'}
|
||||||
|
finally:
|
||||||
|
if is_editmode:
|
||||||
|
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
|
||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
@ -16,8 +16,11 @@ except ImportError:
|
|||||||
|
|
||||||
|
|
||||||
def export(filepath, face_data, colors, width, height, opacity):
|
def export(filepath, face_data, colors, width, height, opacity):
|
||||||
offscreen = gpu.types.GPUOffScreen(width, height)
|
try:
|
||||||
offscreen.bind()
|
offscreen = gpu.types.GPUOffScreen(width, height)
|
||||||
|
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