import_scene_elements
Imports a file.
arguments
- "add_scene_shader_paths" : Boolean (default: true)
Whether to add the file path to the shader search path to allow loading of file specific MDL shaders.
References:
- "errors_as_warnings" : Boolean (default: true)
If true then errors produced by the import as downgraded to warnings. This can be useful for importers that return errors for issues like missing textures however still import a functional scene. True errors, like syntax errors that prevent scene parsing, will usually still produce error messages since items like the root group will not be available to create a scene from.
- "filename" : String (default: null)
The name of the file to be imported. Either this or
url
must be provided. This file must be within the content root directory. A relative path will automatically be resolved within the content root. An absolute path must terminate within the content root or else importation will fail. The exception to this is that paths beginning with "${shader}" will be searched for within the configured shader directories. A file URI (file://) may be used instead of a filename in which case the path will always be interpreted as relative to content root. - "filetype" : String (default: null)
Forces use of a specific importer when loading http resources.
filetype
must be provided as a file extension without the period (.) prefix. - "import_options" : Map (default: null)
The import options. All importers support the prefix and list_elements options. The name of the option is used as the key of the map. E.g.: import_options["list_elements"] = true.
- "progress_id" : String (default: null)
The identifier that will be received by command progress callbacks.
- "request_options" : Map (default: null)
Http request options used when importing from http or https. These will be provided to the http import api whenever
url
is provided. Request options are specified as key value pairs and may include the following:method
(String): The http method of the request. Which must be one of the following:get
post
put
connect
head
delete
patch
options
body
(String|Binary): The http request body.timeout
(Number): The timeout in seconds of the entire request.connect_timeout
(Number): The timeout in seconds of the connection handshake.follow_redirects
(Boolean): Whether http redirects will be automatically followed.maintain_request_methods
(Array): A list of http codes (String
) that will maintain http method when followed. May be one of:'301'
,'302'
,'303'
or'all'
.max_redirects
(Number): The maximum number of redirects followed for the request.authenticate_redirects
(Boolean): Whether redirects to other hostnames should have authentication credentials from the original host applied to them.headers
(Map): A collection of header key value pairs. Each value can either be a singleString
or anArray
ofString
if the same header is to be specified multiple times.verify_ssl
(Boolean): Whether ssl connections require certificate verification.
mi::nservices::IHttp_client
documentation.The url of the scene to be imported. Either this or filename
must be provided.
return value
Import_resultA user type containing the name of the imported root group, options block, camera instance and camera. Also an array of imported elements if list_elements was set to true. The messages element will contain an array with any import warnings or messages. On successful import this will contain 1 element with code 0. Any other entries will be import warnings. Import failure is indicated by returning an error response (rather than an Import_result) which will provide an array of error messages as additional error information.