/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Design Studio.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \page studio-3d-loader-3d.html
    \previouspage studio-3d-repeater-3d.html
    \nextpage quick-component-instances.html

    \title Loader3D

    \note The \uicontrol Loader3D component is released as a tech preview
    feature in \QDS 2.2, and its functionality will be improved in future
    releases.

    \uicontrol Loader3D is a loader component used to dynamically load 3D
    components. It can load a QML file using the \uicontrol Source property or a
    component using the \uicontrol {Source component} property. \uicontrol Loader3D
    is useful for delaying the creation of a component until it is required, for
    example, when a component should be created on demand or when a component
    should not be created unnecessarily for performance reasons.

    Add a \uicontrol Loader3D component to your scene by drag-and-dropping it
    from \uicontrol Components > \uicontrol {Qt Quick 3D} >
    \uicontrol {Qt Quick 3D} to \uicontrol Scene in \uicontrol Navigator.

    For more information, see the \l{https://doc.qt.io/qt/qml-qtquick3d-loader3d.html}
    {Loader3D QML type} in the \uicontrol {Qt Quick 3D} documentation.

    \section1 Loader3D Properties

    Select the \uicontrol Loader3D component in \uicontrol Navigator to specify
    its properties in \uicontrol Properties > \uicontrol Loader3D.

    \image studio-3d-loader3d-properties.png "Loader3D specific properties"

    The \uicontrol Active property is set to \uicontrol true by default, which
    makes the \uicontrol Loader3D currently active. Setting \uicontrol Active to
    \uicontrol false makes \uicontrol Loader3D inactive. If you change the
    \uicontrol Source or \uicontrol {Source component} of an inactive
    \uicontrol Loader3D, the component will not be instantiated until
    \uicontrol Loader3D is made active. Setting \uicontrol Loader3D inactive
    will also cause any item loaded by the loader to be released, but this will
    not affect the files or components defined as \uicontrol Source or
    \uicontrol {Source component}.

    Use the dropdown menu of the \uicontrol Source property to define the URL of
    the 3D component to instantiate. To unload the currently loaded object, set
    this property to an empty string or set the \uicontrol {Source component} to
    undefined. Setting \uicontrol Source to a new URL will also cause the item
    created by the previous URL to be unloaded.

    The \uicontrol {Source component} property defines the component for
    \uicontrol Loader3D to instantiate. Currently, the
    \uicontrol {Source component} needs to be defined in code using the
    \l {Working in Edit Mode}{Edit} mode or \l {Text Editor}.

    Set the \uicontrol Asynchronous property to define whether the component
    will be instantiated asynchronously. This property is set to \uicontrol false
    by default. When used in conjunction with the source property, loading and
    compilation will be performed in a background thread. Loading asynchronously
    creates the objects declared by the component across multiple frames and
    reduces the likelihood of glitches in animation. Setting the value of
    \uicontrol Asynchronous to \uicontrol false while an asynchronous load is in
    progress will force immediate synchronous completion. This allows an
    asynchronous loading to begin and then forces completion if the
    \uicontrol Loader3D content must be accessed before the asynchronous
    loading is completed.

    To avoid seeing the components loading progressively, set the \uicontrol
    Visibility property for \uicontrol Loader3D appropriately in
    \uicontrol {Binding Editor}:
        \list 1
            \li In \uicontrol Properties > \uicontrol Loader3D, select the
                \uicontrol Asynchronous check box to set the property to
                \uicontrol true.
            \li In \uicontrol Node > \l {Setting Node Opacity and Visibility}{Visibility},
                select \inlineimage icons/action-icon.png
                to open the actions menu, and then select \uicontrol {Set Binding}.
            \li Type \c {status === Loader3D.Ready} into \uicontrol {Binding Editor},
                as shown in the image below.
            \li Select \uicontrol OK.
        \endlist

    \image studio-3d-loader3d-binding-editor.png "Setting Visibility in Binding Editor"

*/
