[SOLVED] Help to improve Corona Exporter for Blender 2.8+

Hi. This is appeared everytime on Camera settings panel.


How to solve this from python codeline? This is Default code by Glen Blanchard for “Corona render exporter for Blender 2.80”:

import bpy

#---------------------------------------
# Camera UI
#---------------------------------------
class CORONA_RENDER_PT_CameraPanel( bpy.types.Panel):
    bl_label = "Corona Camera"
    bl_space_type = "PROPERTIES"
    bl_region_type = "WINDOW"
    COMPAT_ENGINES = {'CORONA'}
    bl_context = "data"

    @classmethod
    def poll( cls, context):
        renderer = context.scene.render
        return renderer.engine == 'CORONA' and context.active_object.type == 'CAMERA'

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        crn_scene_props = scene.corona
        cam_data = context.object.data
        crn_cam_props = context.active_object.data.corona
        cam_props = context.object.data

        layout.prop(crn_cam_props, "camera_type", text = 'Camera')
        if crn_cam_props.camera_type == 'perspective':
            # Generic camera settings
            row = layout.row()
            row.prop(cam_props, "lens_unit")
            if cam_props.lens_unit == 'FOV':
                row.prop(cam_props, "angle")
            else:
                row.prop(cam_props, "lens")

            layout.prop(crn_cam_props, "use_dof")

            box = layout.box()

            row = box.row()
            row.prop(context.active_object.data, "dof_distance", text = "Focal distance")
            row.active = context.active_object.data.dof_object is None

            row = box.row()
            row.prop(context.active_object.data, "dof_object", text = 'Focal object')

            box.separator()

            # DoF / Exposure settings
            box.label( text="Basic Settings:")
            row = box.row()
            row.prop(crn_cam_props, "camera_dof")
            row.prop( crn_scene_props, "colmap_iso")

            row = box.row()
            row.prop( crn_scene_props, "shutter_speed")
            row.prop(context.object.data, "sensor_width")

            box.separator()

            # Aperture shape
            box.label( text="Aperture Shape (bokeh):")
            row = box.row()
            row.prop( crn_cam_props, "bokeh_blades")
            row.prop( crn_cam_props, "bokeh_rotation")

        elif crn_cam_props.camera_type == 'ortho':
            layout.prop(crn_cam_props, "ortho_width")

        elif crn_cam_props.camera_type == 'cylindrical':
            layout.prop(crn_cam_props, "cylindrical_height")

        elif crn_cam_props.camera_type == 'spherical' or crn_cam_props.camera_type == 'cubemap':
            layout.prop( crn_cam_props, "use_vr")
            if crn_cam_props.use_vr:
                layout.prop(crn_cam_props, "vr_eyeSeparation")
                layout.prop(crn_cam_props, "vr_frontOffset")
                layout.prop(crn_cam_props, "vr_convergenceDistance")

        layout.separator()

        # Render region settings
        layout.prop( crn_cam_props, "render_clipping")

        row = layout.row( align=True)
        row.active = crn_cam_props.render_clipping
        row.prop( cam_props, "clip_start")
        row.prop( cam_props, "clip_end")

        row = layout.row( align = True)
        row.prop( cam_props, "shift_x")
        row.prop( cam_props, "shift_y")

        layout.separator()
        layout.prop( crn_cam_props, "use_region")

#---------------------------------------
# Motion Blur UI
#---------------------------------------
class CORONA_RENDER_PT_MBPanel( bpy.types.Panel):
    bl_label = "Corona Motion Blur"
    bl_space_type = "PROPERTIES"
    bl_region_type = "WINDOW"
    COMPAT_ENGINES = {'CORONA'}
    bl_context = "data"

    @classmethod
    def poll( cls, context):
        renderer = context.scene.render
        return renderer.engine in CoronaMBPanel.COMPAT_ENGINES and context.active_object.type == 'CAMERA'

    def draw( self, context):
        layout = self.layout
        scene = context.scene
        crn_props = scene.corona

        row = layout.row()
        row.prop( crn_props, "use_cam_mblur", text = "Enable Camera")
        if crn_props.use_cam_mblur:
            row.prop( crn_props, "cam_mblur_segments")

        row = layout.row()
        row.prop( crn_props, "use_ob_mblur", text = "Enable Transform")
        if crn_props.use_ob_mblur:
            row.prop( crn_props, "ob_mblur_segments", text = "Segments")

        # layout.prop( crn_props, "use_def_mblur")
        layout.prop( crn_props, "frame_offset")


def register():
    bpy.utils.register_class( CORONA_RENDER_PT_CameraPanel)

def unregister():
    bpy.utils.unregister_class( CORONA_RENDER_PT_CameraPanel)

Can anyone help me to improve the code?

Its because of layout.box() . check here for similar solution.

sorry, but which lines am i must to change? can you put it as I posted code?

your code is not working for me. Not sure which one should be removed.

@bartv are you know who can helps here for me?

No, sorry.

Well I dont have corona installed and cant give it a quick test and also dont have time for it, but to get the ball rolling for you, it seems as if the box created in line 38 is not filled with content. That very likely means that you have get an error in line 41
row.prop(context.active_object.data, "dof_distance", text = "Focal distance")

Have you ever checked your system console for errors? I guess theres an error, that should help you debugging this.

Yes, you was right:

so, what am i must to do now?

@ohsnapitsjoel @ideasman42 @zeauro @Jacques_Lucke @HooglyBoogly can you help?

Well in that line there’s a check, a check if dof_object is None, but the check raises an error message. That tells you that dof_object is not just None its not there at all. And the fact that your box is totally empty, also means that line 41 with dof_distance also isn’t there, cause it was before the error. If this is really meant to be blender camera data, then the dof access is wrong and should rather look like this

row = box.row()
row.prop(context.active_object.data.dof, "focus_distance", text = "Focal distance")
row.active = context.active_object.data.dof.focus_object is None

row = box.row()
row.prop(context.active_object.data.dof, "focus_object", text = 'Focal object')

Take care on its correct indentation.

Remote debugging like this is very time consuming and it seems you’ve never programmed, right? There might be much more broken, the best tip I can give is, you should really contact the author of this code and ask him for help and about the general situation of this plugin, or for an update. But with a bit of luck its running fine now. Keeping fingers crossed for you.:slightly_smiling_face:

1 Like

:smiley: :smiley: :blush: thank you it works now perfectly!

1 Like

@Debuk now, I must to solve Environment texture handler. It gaves me an error like this on Blender 2.93:

AND THIS IS python code:
outputs.py (75.2 KB)

@Scoped @Zorian

In exporter has some bugs:

  • unsupported LatLong map (HDRI) or code errors;
  • unsupported export without applying Mirror modifiers if it has on the objects.

But anyways this screens from Blender 2.93 and Corona standalone 3 (ABSOLUTELY FREE):

1 Like

Thats a custom corona field just referenced this single time. Can’t say anything about it. Contact the author.

Thanks. But I cannot (also nobody cannot) contact with him by the forum or by github/bitbucket. He had not been posted any contact info about himself. This is the reason why cannot. Well, are you can recommend me any developer that can helps me?

Well no I know nobody with interest in that, if you can’t debug this yourself, then open a thread on a corona forum or try create an issue report on github/bitbucket directly in his project.

1 Like

I don’t use corona. But it looks like you should try to contact blanchg in this thread.
https://forum.corona-renderer.com/index.php?topic=14537.0;all

1 Like

Thanks. But I know already a long years ago this thread. The main aim is to fix two or three bugs manually in exporter python code. Are you know whos can helps with Python knowledge base for me?