Skip to main content

Exporter

                            
                              
                                interface 
                                Exporter
                              
                              

The main interface for implementing custom exporters.

Methods

configuration

                            
                              
                                public 
                                configuration
                                (): 
                                Promise
                                
                                  
                                    
                                      
                                        
                                          
                                            void
                                          
                                          
                                            RendererSettings
                                          
                                        
                                      
                                    
                                  
                                
                              
                              

Prepare the rendering configuration.

Called at the beginning of the rendering process, before anything else hasbeen set up. The returned value can be used to override the renderingsettings provided by the user.


handleFrame

                            
                              
                                public 
                                handleFrame
                                
                                  
                                    
                                      canvas
                                      : 
                                      HTMLCanvasElement
                                    
                                    
                                      frame
                                      : 
                                      number
                                    
                                    
                                      sceneFrame
                                      : 
                                      number
                                    
                                    
                                      sceneName
                                      : 
                                      string
                                    
                                    
                                      signal
                                      : 
                                      AbortSignal
                                    
                                  
                                
                                : 
                                Promise
                                
                                  
                                    
                                      void
                                    
                                  
                                
                              
                              

Export a frame.

Called each time after a frame is rendered.

Parameters

  • canvas : HTMLCanvasElement

    A canvas containing the rendered frame.

  • frame : number

    The frame number.

  • sceneFrame : number

    The frame number within the scene.

  • sceneName : string

    The name of the scene with which the frame is associated.

  • signal : AbortSignal

    An abort signal triggered if the user aborts the rendering.


start

                            
                              
                                public 
                                start
                                (): 
                                Promise
                                
                                  
                                    
                                      void
                                    
                                  
                                
                              
                              

Begin the rendering process.

Called after the rendering has been set up, right before the first frameis rendered. Once start() is called, it is guaranteed that the stop() method will be called as well. Can be used to initialize any resources thatrequire a clean-up.


stop

                            
                              
                                public 
                                stop
                                
                                  
                                    
                                      result
                                      : 
                                      RendererResult
                                    
                                  
                                
                                : 
                                Promise
                                
                                  
                                    
                                      void
                                    
                                  
                                
                              
                              

Finish the rendering process.

Guaranteed to be called after the rendering has finished - no matter theresult. Can be used to finalize the exporting and perform any necessaryclean-up.

Parameters

  • result : RendererResult

    The result of the rendering.