// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
    \page studio-importing-3d.html

    \previouspage qtquick-fonts.html
    \nextpage creator-exporting-qml.html

    \title Importing 3D assets

    In \QDS, you can import 3D assets in formats such as \c{.stl}, \c{.dae}, \c{.fbx}, \c{.glb},
    \c{.gltf}, \c{.obj}, \c{.uia}, and \c{.uip}. For a list of formats supported by each
    \l{Qt Quick 3D} version, see the module documentation.

    During the import, you can optimize the files for \QDS. You can remove
    components from meshes to reduce the cache size, find and fix issues in
    the files, optimize graphs and meshes, and so on. The available options
    depend on whether you are importing files that you created with Qt 3D Studio
    or with other 3D graphics tools. See the tooltips in the options dialog
    for more information about a particular option.

    For more information about exporting 3D graphics, see
    \l{Exporting 3D assets}.

    \image {studio-import-3d.webp} {The Asset Import dialog.}

    To import 3D assets to \QDS:

    \list 1
        \li Open the import dialog in one of the following methods:
            \list
                \li Select \l Assets > \imageplus, select the files you
                    want to import, and then select \uicontrol Open.
                \li Drag a 3D asset file from a file manager to the \uicontrol 3D view.
                    You can also select multiple 3D assets and then drag them to
                    the \uicontrol 3D view. In this case, the 3D assets will be added to
                    your scene, so they will appear in the \uicontrol 3D and
                    \uicontrol Navigator views.
            \endlist
        \li Optional: To define options for importing 3D assets:
            \list 1
                \li Select the asset you want to import from the \uicontrol
                    {Imported objects} list.
                \li Define options for importing the files in the \uicontrol
                    {3D Scene Options} tab.
                    \note To see all options, select \uicontrol {Show All Options}.
                \li Select \uicontrol Import to generate the 3D asset with
                    the updated settings.
            \endlist
        \li Optional: Use the preview image to preview the 3D asset before
            importing it. Drag the preview image to rotate it.
        \li Select \uicontrol Accept to import the 3D assets.
    \endlist

    After importing the 3D asset, it is available as a \c{.q3d} file in
    \uicontrol Assets > \uicontrol {3D}.

    \image {3d-asset-assets-view.webp} {The imported 3D asset in the Assets view.}

    To add an imported 3D asset to the scene, drag the \c{.q3d} file from
    \uicontrol Assets to the \uicontrol Navigator or the \uicontrol 3D view, which
    automatically adds the required import to your project.

    \section1 Managing imported 3D assets

    \QDS creates a placeholder \c{.q3d} file for each imported asset in the
    \c{<projectcontent>/3d} folder. You can move the \c{.q3d} files to a different
    content folder if needed.

    To edit the imported 3D assets in \uicontrol Assets, do one of the following
    to open the associated \c{.qml}:
    \list
        \li Double-click the \c{.qd3} file in \uicontrol Assets.
        \li Right-click the \c{.qd3} file in \uicontrol Assets to open the
            context-menu, and then select \uicontrol {Edit Component}.
        \li If the asset has already been added to the scene, right-click
            it in \uicontrol Navigator, and then select
            \uicontrol {Edit Component}
    \endlist

    To delete a 3D asset from \uicontrol Assets, right-click the \c{.q3d} file
    and select \uicontrol {Delete File}. Doing this also removes the imported
    component and any usages from the currently open QML file.

*/
