I have the following in an Operator but it causes an "Error: EXCEPTION_ACCESS_VIOLATION" with no further details. I think (more of a guess) that the template_preview is trying to lookup/find in the region and that is returning null. Other than adding debug code to the .c code is there a way to find out?
class BigPreview(Operator):
bl_idname = "myaddon.big_preview"
bl_label = "Big Preview"
def execute(self, context):
print("Running big preview")
return {'FINISHED'}
def invoke(self, context, event):
wm = context.window_manager
print("Invoke big preview")
return wm.invoke_props_dialog(self, width=600, height=600)
def draw(self, context):
layout = self.layout
layout.template_preview( context.material, show_buttons=False, preview_id="corona.big_preview")
context.material
in the materials Properties panel. Maybecontext.object.active_material
if it's not None. $\endgroup$