Commit Graph

5 Commits

Author SHA1 Message Date
Miikka Heikkinen
8a8a2f5c55 QmlDesigner: Unify the background of 3D preview images
Added 3D checkerboard floor on all 3D previews.
Since shadows generally look bad for arbitrary 3D scenes, and would
mostly be obscured by the model itself as we want the light mostly
from the front, removed shadows also from the material preview to unify
the previews.

Qt5 had issues rendering the 3D floor texture, so used a static image
there, as Qt5 only generates previews of one size.

Fixes: QDS-7078
Change-Id: I74d094878ed01e6e531ad60df1f8d9d7cf415860
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-06-23 13:06:04 +00:00
Miikka Heikkinen
dedbbc75b5 QmlDesigner: Apply root item transform in Node component previews
When generating a preview from a component with a 3D node for a root,
the root Node transform is now applied when calculating camera zoom.

Fixes: QDS-7131
Change-Id: I73054a09b3e82868c999ef6f9797dc941e625b33
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-06-10 13:15:05 +00:00
Miikka Heikkinen
80ea026fd8 QmlDesigner: Refactor library icon generation for imported 3D assets
Previously, icon generation was done at import time, but that was
wasteful, as we now have image cache backed icon generation
available for component library icons. Added the few remaining missing
bits to support icon generation for image cache and disabled the old
icon generation implementation for Qt6.

A few issues in fit algorithm for preview image generation were also
uncovered and fixed to make icons render scene in comparable size to
the old version.

Qt5 imports still generate using old way since component library
3D previews generation doesn't work on Qt5.

Fixes: QDS-6205
Change-Id: I5418fa19d86e81adcd184be023f1dfbc813d0bf5
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-30 14:16:53 +00:00
Miikka Heikkinen
f146b846cd QmlDesigner: Implement proper preview for pure 3D scenes
Refactored the existing 3D node preview generation to be done
synchronously, which enables their use also for creating state
and item library previews for 3D nodes with ease.

Fixes: QDS-5785
Change-Id: Ib493eccbc239f33bcad3301673a865494616a901
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-02-10 14:47:26 +00:00
Miikka Heikkinen
b058b6e841 QmlPuppet: Add separate set of qml files for Qt6 for 3D editor
Import QtQuick3D 1.15 no longer works in Qt 6.2, so provide a separate
set of qml files for each major Qt version.

Fixes: QDS-4642
Change-Id: I3e17fb248f71f87fb9a40dcad3c03e037cafb0f4
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-29 12:03:57 +00:00