Blender to Arnold Export - Part IV: Blender 4.0 Splash Screen

Jan Walter November 27, 2023 [DCC] #blender #arnold #python

The last part (Blender to Arnold Export - Part III: Base Color) talked about exporting some color information (from Blender) instead of using full materials/shaders. So basically the light sources are still not taken into account. But can we export the latest Splash Screen (for Blender 4.0) to Arnold?

Blender 4.0 Splash Screen rendered by Cycles

The image above was rendered by Cycles. I had to modify the Python code a bit to export the camera in case it's not part of a Collection.

...
class AssExporter:
    def __init__(self):
        self.filename = None

    def export(self, context, filename, use_shader_file, use_shader_file_only):
        def exportMaterials():...
        def exportCamera():...
...
            print('DEBUG: export collections ...')
...
                            if me is None:
                                if ob.type == 'CAMERA':
                                    if ob.name == camera_name:
                                        exportCamera()
...
        if not camera_exported and len(bpy.data.cameras) >= 1:
            # camera was not part of a collection
            objects = bpy.data.objects
            for i, ob_main in enumerate(objects):
                obs = [(ob_main, ob_main.matrix_world)]
                for ob, ob_mat in obs:
                    if ob.name == camera_name:
                        print('DEBUG: export camera ...')
                        exportCamera()
...

The current source code can be found on Codeberg. The Python source code is probably changing with the latest Blender releases, whenever I feel the need to render at least a similar scene with Arnold.

Blender 4.0 Splash Screen rendered by Arnold

This is it for now. On the TODO list is being aware of subdivision surfaces during the export and taking lights into account (which needs also proper materials/shaders).