Merge branch 'stabilization/2106' into Streamer/ConfigUpdates
This commit is contained in:
@@ -57,7 +57,13 @@ namespace AZ
|
||||
//! Determines if a component can be created from the asset type
|
||||
//! This will be called before attempting to create a component from an asset (drag&drop, etc)
|
||||
//! You can use this to filter by subIds or do your own validation here if needed
|
||||
virtual bool CanCreateComponent(const AZ::Data::AssetId& /*assetId*/) const { return true; }
|
||||
virtual bool CanCreateComponent([[maybe_unused]] const AZ::Data::AssetId& assetId) const { return true; }
|
||||
|
||||
//! Determines if other products conflict with the given one when multiple are generated from a source asset.
|
||||
//! This will be called before attempting to create a component from an asset (drag&drop, etc)
|
||||
//! You can use this to filter by conflicting product types or in case you want to skip for UX reasons.
|
||||
//! @param[in] productAssetTypes Asset types of all generated products, including the one for our given type in this bus.
|
||||
virtual bool HasConflictingProducts([[maybe_unused]] const AZStd::vector<AZ::Data::AssetType>& productAssetTypes) const { return false; }
|
||||
};
|
||||
|
||||
using AssetTypeInfoBus = AZ::EBus<AssetTypeInfo>;
|
||||
|
||||
@@ -1206,7 +1206,7 @@ namespace JsonSerializationTests
|
||||
if (this->m_features.m_enableInitializationTest)
|
||||
{
|
||||
auto instance = this->m_description.CreateDefaultInstance();
|
||||
typename TypeParam::Type compare = typename TypeParam::Type{};
|
||||
AZStd::remove_cvref_t<typename TypeParam::Type> compare;
|
||||
if (!this->m_description.AreEqual(*instance, compare))
|
||||
{
|
||||
auto serializer = this->m_description.CreateSerializer();
|
||||
|
||||
@@ -75,6 +75,8 @@ namespace AzFramework
|
||||
// Add a fullscreen button in the upper right of the title bar.
|
||||
[m_nativeWindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
|
||||
m_nativeWindow.tabbingMode = NSWindowTabbingModeDisallowed;
|
||||
|
||||
// Make the window active
|
||||
[m_nativeWindow makeKeyAndOrderFront:nil];
|
||||
m_nativeWindow.title = m_windowTitle;
|
||||
|
||||
@@ -493,7 +493,30 @@ namespace AzQtComponents
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CE_MenuItem:
|
||||
{
|
||||
const QMenu* menu = qobject_cast<const QMenu*>(widget);
|
||||
QAction* action = menu->activeAction();
|
||||
if (action)
|
||||
{
|
||||
QMenu* subMenu = action->menu();
|
||||
if (subMenu)
|
||||
{
|
||||
QVariant noHover = subMenu->property("noHover");
|
||||
if (noHover.isValid() && noHover.toBool())
|
||||
{
|
||||
// First draw as standard to get the correct hover background for the complete control.
|
||||
QProxyStyle::drawControl(element, option, painter, widget);
|
||||
// Now draw the icon as non-hovered so control behaves as designed.
|
||||
QStyleOptionMenuItem myOpt = *qstyleoption_cast<const QStyleOptionMenuItem*>(option);
|
||||
myOpt.state &= ~QStyle::State_Selected;
|
||||
return QProxyStyle::drawControl(element, &myOpt, painter, widget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return QProxyStyle::drawControl(element, option, painter, widget);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Helpers Icon</title>
|
||||
<defs>
|
||||
<circle id="path-1" cx="8" cy="8" r="8"></circle>
|
||||
<path d="M8.59736328,10.1821289 L8.59736328,9.79394531 C8.59736328,9.07617188 8.86835937,8.71728516 9.84248047,8.15332031 C10.8751953,7.54541016 11.4098633,6.77636719 11.4098633,5.67041016 C11.4098633,4.00048828 10.0255859,2.8359375 7.93085937,2.8359375 C5.68232422,2.8359375 4.40791016,4.09570312 4.37128906,5.89746094 L6.35615234,5.89746094 C6.40009766,5.06982422 6.95673828,4.53515625 7.79902344,4.53515625 C8.63398437,4.53515625 9.190625,5.04052734 9.190625,5.73632812 C9.190625,6.43212891 8.90498047,6.79101562 7.96015625,7.35498047 C6.94941406,7.94824219 6.54658203,8.60742188 6.64179687,9.75732422 L6.65644531,10.1821289 L8.59736328,10.1821289 Z M7.70380859,13.7124023 C8.52412109,13.7124023 9.02949219,13.2436523 9.02949219,12.4892578 C9.02949219,11.7275391 8.52412109,11.2587891 7.70380859,11.2587891 C6.88349609,11.2587891 6.37080078,11.7275391 6.37080078,12.4892578 C6.37080078,13.2436523 6.88349609,13.7124023 7.70380859,13.7124023 Z" id="path-3"></path>
|
||||
</defs>
|
||||
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="2nd-ToolBar-v2-(Perspective)-3" transform="translate(-1161.000000, -7.000000)">
|
||||
<g id="2nd-ToolBar-buttons-on-right" transform="translate(1076.000000, 5.000000)">
|
||||
<g id="Helpers-Icon" transform="translate(85.000000, 2.000000)">
|
||||
<mask id="mask-2" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
<use id="Oval" fill="#FFFFFF" xlink:href="#path-1"></use>
|
||||
<g id="?" fill-rule="nonzero" mask="url(#mask-2)">
|
||||
<use fill="#909090" xlink:href="#path-3"></use>
|
||||
<use fill="#3F3F3F" xlink:href="#path-3"></use>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Buttons / Dropdown button with Icon / no arrow</title>
|
||||
<g id="Buttons-/-Dropdown-button-with-Icon-/-no-arrow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Icons-/-System-/-Menu" fill="#FFFFFF">
|
||||
<rect id="Rectangle-11" x="1.33333333" y="2.66666667" width="13.3333333" height="1.33333333"></rect>
|
||||
<rect id="Rectangle-11" x="1.33333333" y="7.33333333" width="13.3333333" height="1.33333333"></rect>
|
||||
<rect id="Rectangle-11" x="1.33333333" y="12" width="13.3333333" height="1.33333333"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 786 B |
@@ -1,4 +1,4 @@
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.0708 0.87087L11.0708 0.87074C10.4286 0.371024 9.61107 0.13517 8.79265 0.213464C7.97422 0.291757 7.21961 0.678004 6.6897 1.28985L5.76756 2.36366C5.63378 2.51944 5.56909 2.72055 5.58771 2.92273C5.60634 3.12492 5.70675 3.31163 5.86686 3.44178C6.02698 3.57194 6.23368 3.63488 6.44149 3.61676C6.6493 3.59864 6.8412 3.50094 6.97498 3.34516L7.89716 2.27122C8.03184 2.11488 8.19736 1.98639 8.38395 1.89334C8.57053 1.8003 8.7744 1.74459 8.98349 1.7295C9.19258 1.71442 9.40266 1.74027 9.60131 1.80552C9.79996 1.87078 9.98315 1.97411 10.1401 2.10942C10.4422 2.38256 10.6244 2.75851 10.6488 3.15904C10.6732 3.55957 10.5379 3.95383 10.2711 4.25978L8.35381 6.49309L8.33616 6.51209C8.23375 6.62767 8.11374 6.72729 7.98031 6.80749C7.67189 6.99364 7.30661 7.06983 6.94686 7.02305C6.58711 6.97626 6.25522 6.8094 6.00789 6.55097C5.86556 6.40288 5.66865 6.31578 5.46039 6.30879C5.25213 6.30179 5.04952 6.37546 4.89703 6.51365C4.74453 6.65183 4.65462 6.84323 4.64701 7.04584C4.6394 7.24845 4.71472 7.44572 4.85645 7.59436C5.21222 7.96578 5.65746 8.24515 6.15198 8.40726C6.6465 8.56937 7.17473 8.60911 7.68898 8.52289C7.84983 8.49539 8.00828 8.45599 8.16298 8.40505C8.70939 8.22568 9.19408 7.90261 9.56335 7.47165L11.4758 5.24457C11.7478 4.92529 11.9523 4.55683 12.0773 4.16038C12.2024 3.76394 12.2457 3.34735 12.2046 2.93457C12.1671 2.53429 12.0475 2.1454 11.8527 1.79092C11.658 1.43644 11.3921 1.12358 11.0708 0.87087Z" fill="white"/>
|
||||
<path d="M5.40958 9.14055L4.58546 10.1003C4.32342 10.4101 3.94867 10.6097 3.53919 10.6576C3.12972 10.7054 2.71706 10.5977 2.3871 10.357C2.22234 10.2309 2.08525 10.0738 1.98392 9.89526C1.8826 9.71668 1.81911 9.52014 1.79719 9.31727C1.77528 9.1144 1.79539 8.90932 1.85634 8.71414C1.91729 8.51896 2.01784 8.33765 2.15204 8.18093L4.10231 5.90975L4.11666 5.89415C4.21908 5.77861 4.3391 5.67903 4.47254 5.59887C4.75216 5.42921 5.07976 5.34988 5.4085 5.37222C5.73725 5.39457 6.05033 5.51745 6.30299 5.72329C6.3635 5.77246 6.42015 5.82595 6.47246 5.88333C6.54738 5.9658 6.63971 6.03156 6.74316 6.07611C6.84661 6.12066 6.95872 6.14295 7.07184 6.14146C7.18361 6.13992 7.29372 6.11492 7.39465 6.06817C7.49558 6.02143 7.58495 5.95403 7.65666 5.8706L7.66607 5.85958C7.78641 5.72083 7.85132 5.54454 7.8489 5.36301C7.84647 5.18148 7.77687 5.00689 7.65286 4.87124C7.35341 4.54132 6.98422 4.27825 6.57057 4.10003C6.15692 3.92182 5.70858 3.83266 5.25623 3.83866C4.80388 3.84467 4.35821 3.94569 3.94971 4.13482C3.54122 4.32395 3.17954 4.59672 2.88945 4.93446L0.944626 7.19943C0.420065 7.81564 0.163643 8.60683 0.230025 9.40433C0.296406 10.2018 0.68034 10.9426 1.29998 11.4686C1.61272 11.7312 1.97644 11.9301 2.3696 12.0535C2.76277 12.1769 3.17738 12.2223 3.5889 12.187C3.687 12.1793 3.78434 12.1672 3.88093 12.1507C4.62877 12.0232 5.30663 11.6437 5.79562 11.0786L6.617 10.1221C6.75077 9.96628 6.81547 9.76517 6.79684 9.56299C6.77822 9.3608 6.6778 9.17409 6.51769 9.04394C6.35758 8.91378 6.15088 8.85084 5.94306 8.86896C5.73525 8.88708 5.54335 8.98477 5.40957 9.14055H5.40958Z" fill="white"/>
|
||||
<path d="M11.0708 0.87087L11.0708 0.87074C10.4286 0.371024 9.61107 0.13517 8.79265 0.213464C7.97422 0.291757 7.21961 0.678004 6.6897 1.28985L5.76756 2.36366C5.63378 2.51944 5.56909 2.72055 5.58771 2.92273C5.60634 3.12492 5.70675 3.31163 5.86686 3.44178C6.02698 3.57194 6.23368 3.63488 6.44149 3.61676C6.6493 3.59864 6.8412 3.50094 6.97498 3.34516L7.89716 2.27122C8.03184 2.11488 8.19736 1.98639 8.38395 1.89334C8.57053 1.8003 8.7744 1.74459 8.98349 1.7295C9.19258 1.71442 9.40266 1.74027 9.60131 1.80552C9.79996 1.87078 9.98315 1.97411 10.1401 2.10942C10.4422 2.38256 10.6244 2.75851 10.6488 3.15904C10.6732 3.55957 10.5379 3.95383 10.2711 4.25978L8.35381 6.49309L8.33616 6.51209C8.23375 6.62767 8.11374 6.72729 7.98031 6.80749C7.67189 6.99364 7.30661 7.06983 6.94686 7.02305C6.58711 6.97626 6.25522 6.8094 6.00789 6.55097C5.86556 6.40288 5.66865 6.31578 5.46039 6.30879C5.25213 6.30179 5.04952 6.37546 4.89703 6.51365C4.74453 6.65183 4.65462 6.84323 4.64701 7.04584C4.6394 7.24845 4.71472 7.44572 4.85645 7.59436C5.21222 7.96578 5.65746 8.24515 6.15198 8.40726C6.6465 8.56937 7.17473 8.60911 7.68898 8.52289C7.84983 8.49539 8.00828 8.45599 8.16298 8.40505C8.70939 8.22568 9.19408 7.90261 9.56335 7.47165L11.4758 5.24457C11.7478 4.92529 11.9523 4.55683 12.0773 4.16038C12.2024 3.76394 12.2457 3.34735 12.2046 2.93457C12.1671 2.53429 12.0475 2.1454 11.8527 1.79092C11.658 1.43644 11.3921 1.12358 11.0708 0.87087Z" fill="#3F3F3F"/>
|
||||
<path d="M5.40958 9.14055L4.58546 10.1003C4.32342 10.4101 3.94867 10.6097 3.53919 10.6576C3.12972 10.7054 2.71706 10.5977 2.3871 10.357C2.22234 10.2309 2.08525 10.0738 1.98392 9.89526C1.8826 9.71668 1.81911 9.52014 1.79719 9.31727C1.77528 9.1144 1.79539 8.90932 1.85634 8.71414C1.91729 8.51896 2.01784 8.33765 2.15204 8.18093L4.10231 5.90975L4.11666 5.89415C4.21908 5.77861 4.3391 5.67903 4.47254 5.59887C4.75216 5.42921 5.07976 5.34988 5.4085 5.37222C5.73725 5.39457 6.05033 5.51745 6.30299 5.72329C6.3635 5.77246 6.42015 5.82595 6.47246 5.88333C6.54738 5.9658 6.63971 6.03156 6.74316 6.07611C6.84661 6.12066 6.95872 6.14295 7.07184 6.14146C7.18361 6.13992 7.29372 6.11492 7.39465 6.06817C7.49558 6.02143 7.58495 5.95403 7.65666 5.8706L7.66607 5.85958C7.78641 5.72083 7.85132 5.54454 7.8489 5.36301C7.84647 5.18148 7.77687 5.00689 7.65286 4.87124C7.35341 4.54132 6.98422 4.27825 6.57057 4.10003C6.15692 3.92182 5.70858 3.83266 5.25623 3.83866C4.80388 3.84467 4.35821 3.94569 3.94971 4.13482C3.54122 4.32395 3.17954 4.59672 2.88945 4.93446L0.944626 7.19943C0.420065 7.81564 0.163643 8.60683 0.230025 9.40433C0.296406 10.2018 0.68034 10.9426 1.29998 11.4686C1.61272 11.7312 1.97644 11.9301 2.3696 12.0535C2.76277 12.1769 3.17738 12.2223 3.5889 12.187C3.687 12.1793 3.78434 12.1672 3.88093 12.1507C4.62877 12.0232 5.30663 11.6437 5.79562 11.0786L6.617 10.1221C6.75077 9.96628 6.81547 9.76517 6.79684 9.56299C6.77822 9.3608 6.6778 9.17409 6.51769 9.04394C6.35758 8.91378 6.15088 8.85084 5.94306 8.86896C5.73525 8.88708 5.54335 8.98477 5.40957 9.14055H5.40958Z" fill="#3F3F3F"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
@@ -28,5 +28,7 @@
|
||||
<file alias="script_canvas_editor.svg">Menu/script_canvas_editor.svg</file>
|
||||
<file alias="trackview_editor.svg">Menu/trackview_editor.svg</file>
|
||||
<file alias="ui_editor.svg">Menu/ui_editor.svg</file>
|
||||
<file alias="menu.svg">Menu/menu.svg</file>
|
||||
<file alias="helpers.svg">Menu/helpers.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
+13
-2
@@ -524,8 +524,6 @@ namespace AzToolsFramework
|
||||
rootSpawnableIndex = m_playInEditorData.m_assets.size();
|
||||
}
|
||||
|
||||
LoadReferencedAssets(product.GetReferencedAssets());
|
||||
|
||||
AZ::Data::AssetInfo info;
|
||||
info.m_assetId = product.GetAsset().GetId();
|
||||
info.m_assetType = product.GetAssetType();
|
||||
@@ -534,6 +532,19 @@ namespace AzToolsFramework
|
||||
AZ::Data::AssetCatalogRequestBus::Broadcast(
|
||||
&AZ::Data::AssetCatalogRequestBus::Events::RegisterAsset, info.m_assetId, info);
|
||||
m_playInEditorData.m_assets.emplace_back(product.ReleaseAsset().release(), AZ::Data::AssetLoadBehavior::Default);
|
||||
|
||||
// Ensure the product asset is registered with the AssetManager
|
||||
// Hold on to the returned asset to keep ref count alive until we assign it the latest data
|
||||
AZ::Data::Asset<AZ::Data::AssetData> asset =
|
||||
AZ::Data::AssetManager::Instance().FindOrCreateAsset(info.m_assetId, info.m_assetType, AZ::Data::AssetLoadBehavior::Default);
|
||||
|
||||
// Update the asset registered in the AssetManager with the data of our product from the Prefab Processor
|
||||
AZ::Data::AssetManager::Instance().AssignAssetData(m_playInEditorData.m_assets.back());
|
||||
}
|
||||
|
||||
for (auto& product : context.GetProcessedObjects())
|
||||
{
|
||||
LoadReferencedAssets(product.GetReferencedAssets());
|
||||
}
|
||||
|
||||
// make sure that PRE_NOTIFY assets get their notify before we activate, so that we can preserve the order of
|
||||
|
||||
@@ -922,8 +922,8 @@ namespace AzToolsFramework
|
||||
return AZ::Failure(AZStd::string("Failed to duplicate : Couldn't get a valid owning instance for the common root entity of the entities provided."));
|
||||
}
|
||||
|
||||
// If the first entity id is a container entity id, then we need to mark its parent as the common owning instance because you
|
||||
// cannot duplicate an instance from itself.
|
||||
// If the first entity id is a container entity id, then we need to mark its parent as the common owning instance
|
||||
// This is because containers, despite representing the nested instance in the parent, are owned by the child.
|
||||
if (commonOwningInstance->get().GetContainerEntityId() == firstEntityIdToDuplicate)
|
||||
{
|
||||
commonOwningInstance = commonOwningInstance->get().GetParentInstance();
|
||||
@@ -967,17 +967,18 @@ namespace AzToolsFramework
|
||||
|
||||
// Duplicate any nested entities and instances as requested
|
||||
AZStd::unordered_map<InstanceAlias, Instance*> newInstanceAliasToOldInstanceMap;
|
||||
AZStd::unordered_map<EntityAlias, EntityAlias> duplicateEntityAliasMap;
|
||||
DuplicateNestedEntitiesInInstance(commonOwningInstance->get(),
|
||||
entities, instanceDomAfter, duplicatedEntityAndInstanceIds);
|
||||
DuplicateNestedInstancesInInstance(commonOwningInstance->get(),
|
||||
instances, instanceDomAfter, duplicatedEntityAndInstanceIds,
|
||||
newInstanceAliasToOldInstanceMap);
|
||||
entities, instanceDomAfter, duplicatedEntityAndInstanceIds, duplicateEntityAliasMap);
|
||||
|
||||
PrefabUndoInstance* command = aznew PrefabUndoInstance("Entity/Instance duplication");
|
||||
command->SetParent(undoBatch.GetUndoBatch());
|
||||
command->Capture(instanceDomBefore, instanceDomAfter, commonOwningInstance->get().GetTemplateId());
|
||||
command->Redo();
|
||||
|
||||
DuplicateNestedInstancesInInstance(commonOwningInstance->get(),
|
||||
instances, instanceDomAfter, duplicatedEntityAndInstanceIds, newInstanceAliasToOldInstanceMap);
|
||||
|
||||
// Create links for our duplicated instances (if any were duplicated)
|
||||
for (auto [newInstanceAlias, oldInstance] : newInstanceAliasToOldInstanceMap)
|
||||
{
|
||||
@@ -995,8 +996,35 @@ namespace AzToolsFramework
|
||||
PrefabDom linkPatchesCopy;
|
||||
linkPatchesCopy.CopyFrom(linkPatches->get(), linkPatchesCopy.GetAllocator());
|
||||
|
||||
m_prefabSystemComponentInterface->CreateLink(
|
||||
commonOwningInstance->get().GetTemplateId(), oldInstance->GetTemplateId(), newInstanceAlias, linkPatchesCopy);
|
||||
// If the instance was duplicated as part of an ancestor's nested hierarchy, the container's parent patch
|
||||
// will need to be refreshed to point to the new duplicated parent entity
|
||||
auto oldInstanceContainerEntityId = oldInstance->GetContainerEntityId();
|
||||
AZ_Assert(oldInstanceContainerEntityId.IsValid(), "Instance returned invalid Container Entity Id");
|
||||
|
||||
AZ::EntityId previousParentEntityId;
|
||||
AZ::TransformBus::EventResult(previousParentEntityId, oldInstanceContainerEntityId, &AZ::TransformBus::Events::GetParentId);
|
||||
|
||||
if (previousParentEntityId.IsValid() && AZStd::find(duplicatedEntityAndInstanceIds.begin(), duplicatedEntityAndInstanceIds.end(), previousParentEntityId))
|
||||
{
|
||||
auto oldParentAlias = commonOwningInstance->get().GetEntityAlias(previousParentEntityId);
|
||||
if (oldParentAlias.has_value() && duplicateEntityAliasMap.contains(oldParentAlias->get()))
|
||||
{
|
||||
// Get the dom into a QString for search/replace purposes
|
||||
rapidjson::StringBuffer buffer;
|
||||
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
|
||||
linkPatchesCopy.Accept(writer);
|
||||
|
||||
QString linkPatchesString(buffer.GetString());
|
||||
|
||||
ReplaceOldAliases(linkPatchesString, oldParentAlias->get(), duplicateEntityAliasMap[oldParentAlias->get()]);
|
||||
|
||||
linkPatchesCopy.Parse(linkPatchesString.toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
||||
PrefabUndoHelpers::CreateLink(
|
||||
oldInstance->GetTemplateId(), commonOwningInstance->get().GetTemplateId(),
|
||||
AZStd::move(linkPatchesCopy), newInstanceAlias, undoBatch.GetUndoBatch());
|
||||
}
|
||||
|
||||
// Select the duplicated entities/instances
|
||||
@@ -1507,14 +1535,13 @@ namespace AzToolsFramework
|
||||
|
||||
void PrefabPublicHandler::DuplicateNestedEntitiesInInstance(Instance& commonOwningInstance,
|
||||
const AZStd::vector<AZ::Entity*>& entities, PrefabDom& domToAddDuplicatedEntitiesUnder,
|
||||
EntityIdList& duplicatedEntityIds)
|
||||
EntityIdList& duplicatedEntityIds, AZStd::unordered_map<EntityAlias, EntityAlias>& oldAliasToNewAliasMap)
|
||||
{
|
||||
if (entities.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AZStd::unordered_map<EntityAlias, EntityAlias> oldAliasToNewAliasMap;
|
||||
AZStd::unordered_map<EntityAlias, QString> aliasToEntityDomMap;
|
||||
|
||||
for (AZ::Entity* entity : entities)
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace AzToolsFramework
|
||||
*/
|
||||
void DuplicateNestedEntitiesInInstance(Instance& commonOwningInstance,
|
||||
const AZStd::vector<AZ::Entity*>& entities, PrefabDom& domToAddDuplicatedEntitiesUnder,
|
||||
EntityIdList& duplicatedEntityIds);
|
||||
EntityIdList& duplicatedEntityIds, AZStd::unordered_map<EntityAlias, EntityAlias>& oldAliasToNewAliasMap);
|
||||
/**
|
||||
* Duplicate a list of instances owned by a common owning instance by directly
|
||||
* copying/modifying their entries in the instance DOM
|
||||
|
||||
+8
@@ -13,6 +13,7 @@
|
||||
#include <AzCore/Math/ToString.h>
|
||||
#include <AzCore/Math/Transform.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzFramework/Components/NonUniformScaleComponent.h>
|
||||
#include <AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponent.h>
|
||||
|
||||
@@ -57,6 +58,13 @@ namespace AzToolsFramework
|
||||
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly);
|
||||
}
|
||||
}
|
||||
|
||||
if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
|
||||
{
|
||||
behaviorContext->ConstantProperty("EditorNonUniformScaleComponentTypeId", BehaviorConstant(EditorNonUniformScaleComponent::RTTI_Type()))
|
||||
->Attribute(AZ::Script::Attributes::Module, "editor")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorNonUniformScaleComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent)
|
||||
|
||||
@@ -210,6 +210,19 @@ namespace AzToolsFramework
|
||||
//! Type to inherit to implement ViewportInteractionRequests.
|
||||
using ViewportInteractionRequestBus = AZ::EBus<ViewportInteractionRequests, ViewportEBusTraits>;
|
||||
|
||||
//! An interface to notify when changes to viewport settings have happened.
|
||||
class ViewportSettingNotifications
|
||||
{
|
||||
public:
|
||||
virtual void OnGridSnappingChanged([[maybe_unused]] bool enabled) {}
|
||||
virtual void OnDrawHelpersChanged([[maybe_unused]] bool enabled) {}
|
||||
|
||||
protected:
|
||||
ViewportSettingNotifications() = default;
|
||||
};
|
||||
|
||||
using ViewportSettingsNotificationBus = AZ::EBus<ViewportSettingNotifications, ViewportEBusTraits>;
|
||||
|
||||
//! Requests to freeze the Viewport Input
|
||||
//! Added to prevent a bug with the legacy CryEngine Viewport code that would
|
||||
//! keep doing raycast tests even when no level is loaded, causing a crash.
|
||||
|
||||
@@ -56,7 +56,8 @@ namespace AzAssetBrowserRequestHandlerPrivate
|
||||
using namespace AzToolsFramework;
|
||||
using namespace AzToolsFramework::AssetBrowser;
|
||||
// return true ONLY if we can handle the drop request in the viewport.
|
||||
bool CanSpawnEntityForProduct(const ProductAssetBrowserEntry* product)
|
||||
bool CanSpawnEntityForProduct(const ProductAssetBrowserEntry* product,
|
||||
AZStd::optional<const AZStd::vector<AZ::Data::AssetType>> optionalProductAssetTypes = AZStd::nullopt)
|
||||
{
|
||||
if (!product)
|
||||
{
|
||||
@@ -70,7 +71,6 @@ namespace AzAssetBrowserRequestHandlerPrivate
|
||||
|
||||
bool canCreateComponent = false;
|
||||
AZ::AssetTypeInfoBus::EventResult(canCreateComponent, product->GetAssetType(), &AZ::AssetTypeInfo::CanCreateComponent, product->GetAssetId());
|
||||
|
||||
if (!canCreateComponent)
|
||||
{
|
||||
return false;
|
||||
@@ -78,16 +78,25 @@ namespace AzAssetBrowserRequestHandlerPrivate
|
||||
|
||||
AZ::Uuid componentTypeId = AZ::Uuid::CreateNull();
|
||||
AZ::AssetTypeInfoBus::EventResult(componentTypeId, product->GetAssetType(), &AZ::AssetTypeInfo::GetComponentTypeId);
|
||||
|
||||
if (!componentTypeId.IsNull())
|
||||
if (componentTypeId.IsNull())
|
||||
{
|
||||
// we have a component type that handles this asset.
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (optionalProductAssetTypes.has_value())
|
||||
{
|
||||
bool hasConflictingProducts = false;
|
||||
AZ::AssetTypeInfoBus::EventResult(hasConflictingProducts, product->GetAssetType(), &AZ::AssetTypeInfo::HasConflictingProducts, optionalProductAssetTypes.value());
|
||||
if (hasConflictingProducts)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// additional operations can be added here.
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void SpawnEntityAtPoint(const ProductAssetBrowserEntry* product, AzQtComponents::ViewportDragContext* viewportDragContext, EntityIdList& spawnList, AzFramework::SliceInstantiationTicket& spawnTicket)
|
||||
@@ -511,9 +520,16 @@ void AzAssetBrowserRequestHandler::Drop(QDropEvent* event, AzQtComponents::DragA
|
||||
}
|
||||
|
||||
// Handle products
|
||||
AZStd::vector<AZ::Data::AssetType> productAssetTypes;
|
||||
productAssetTypes.reserve(products.size());
|
||||
for (const AzToolsFramework::AssetBrowser::ProductAssetBrowserEntry* entry : products)
|
||||
{
|
||||
productAssetTypes.emplace_back(entry->GetAssetType());
|
||||
}
|
||||
|
||||
for (const ProductAssetBrowserEntry* product : products)
|
||||
{
|
||||
if (CanSpawnEntityForProduct(product))
|
||||
if (CanSpawnEntityForProduct(product, productAssetTypes))
|
||||
{
|
||||
SpawnEntityAtPoint(product, viewportDragContext, spawnedEntities, spawnTicket);
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ ly_add_target(
|
||||
Legacy::EditorCore
|
||||
RUNTIME_DEPENDENCIES
|
||||
Gem::AtomViewportDisplayInfo
|
||||
Legacy::EditorCommon
|
||||
)
|
||||
ly_add_source_properties(
|
||||
SOURCES CryEdit.cpp
|
||||
|
||||
@@ -208,22 +208,9 @@ WelcomeScreenDialog QLabel
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QLabel#titleLabel
|
||||
WelcomeScreenDialog QLabel#currentProjectLabel
|
||||
{
|
||||
font-size: 22px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QLabel#bodyLabel
|
||||
{
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QLabel[fontStyle="sectionTitle"], QLabel#titleLabel[fontStyle="sectionTitle"], QLabel#documentationLink
|
||||
{
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QPushButton
|
||||
@@ -232,36 +219,20 @@ WelcomeScreenDialog QPushButton
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QFrame#viewContainer
|
||||
{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QFrame#viewContainer[articleStyle="pinned"]
|
||||
{
|
||||
background: rgba(180,139,255,5%);
|
||||
border: 1px solid #B48BFF;
|
||||
box-shadow: 0 0 4px 0 rgba(0,0,0,50%);
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QWidget#articleViewContainerRoot
|
||||
{
|
||||
background: #111111;
|
||||
background: #444444;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QScrollArea#previewArea
|
||||
WelcomeScreenDialog QWidget#levelViewFTUEContainer
|
||||
{
|
||||
background-color: transparent;
|
||||
background: #282828;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QWidget#articleViewContents
|
||||
{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QFrame#imageFrame
|
||||
{
|
||||
background-color: transparent;
|
||||
QTableWidget#recentLevelTable::item {
|
||||
background-color: rgb(64,64,64);
|
||||
margin-bottom: 4px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* Particle Editor */
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
#include <AzCore/std/algorithm.h>
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
#include <AzToolsFramework/Viewport/ViewportMessages.h>
|
||||
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
#include "ui_ViewportTitleDlg.h"
|
||||
@@ -57,13 +58,16 @@ inline namespace Helpers
|
||||
{
|
||||
void ToggleHelpers()
|
||||
{
|
||||
GetIEditor()->GetDisplaySettings()->DisplayHelpers(!GetIEditor()->GetDisplaySettings()->IsDisplayHelpers());
|
||||
const bool newValue = !GetIEditor()->GetDisplaySettings()->IsDisplayHelpers();
|
||||
GetIEditor()->GetDisplaySettings()->DisplayHelpers(newValue);
|
||||
GetIEditor()->Notify(eNotify_OnDisplayRenderUpdate);
|
||||
|
||||
if (GetIEditor()->GetDisplaySettings()->IsDisplayHelpers() == false)
|
||||
if (newValue == false)
|
||||
{
|
||||
GetIEditor()->GetObjectManager()->SendEvent(EVENT_HIDE_HELPER);
|
||||
}
|
||||
AzToolsFramework::ViewportInteraction::ViewportSettingsNotificationBus::Broadcast(
|
||||
&AzToolsFramework::ViewportInteraction::ViewportSettingNotifications::OnDrawHelpersChanged, newValue);
|
||||
}
|
||||
|
||||
bool IsHelpersShown()
|
||||
@@ -126,6 +130,7 @@ CViewportTitleDlg::CViewportTitleDlg(QWidget* pParent)
|
||||
SetupCameraDropdownMenu();
|
||||
SetupResolutionDropdownMenu();
|
||||
SetupViewportInformationMenu();
|
||||
SetupHelpersButton();
|
||||
SetupOverflowMenu();
|
||||
|
||||
Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::PushRequest, gSettings.bMuteAudio ? m_oMuteAudioRequest : m_oUnmuteAudioRequest);
|
||||
@@ -207,15 +212,16 @@ void CViewportTitleDlg::SetupViewportInformationMenu()
|
||||
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetupHelpersButton()
|
||||
{
|
||||
connect(m_ui->m_helpers, &QToolButton::clicked, this, &CViewportTitleDlg::OnToggleHelpers);
|
||||
m_ui->m_helpers->setChecked(Helpers::IsHelpersShown());
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetupOverflowMenu()
|
||||
{
|
||||
// Setup the overflow menu
|
||||
QMenu* overFlowMenu = new QMenu(this);
|
||||
m_debugHelpersAction = new QAction("Debug Helpers", overFlowMenu);
|
||||
m_debugHelpersAction->setCheckable(true);
|
||||
m_debugHelpersAction->setChecked(Helpers::IsHelpersShown());
|
||||
connect(m_debugHelpersAction, &QAction::triggered, this, &CViewportTitleDlg::OnToggleHelpers);
|
||||
overFlowMenu->addAction(m_debugHelpersAction);
|
||||
|
||||
m_audioMuteAction = new QAction("Mute Audio", overFlowMenu);
|
||||
connect(m_audioMuteAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedMuteAudio);
|
||||
@@ -329,7 +335,7 @@ void CViewportTitleDlg::OnMaximize()
|
||||
void CViewportTitleDlg::OnToggleHelpers()
|
||||
{
|
||||
Helpers::ToggleHelpers();
|
||||
m_debugHelpersAction->setChecked(Helpers::IsHelpersShown());
|
||||
m_ui->m_helpers->setChecked(Helpers::IsHelpersShown());
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::SetNoViewportInfo()
|
||||
@@ -755,7 +761,7 @@ void CViewportTitleDlg::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
switch (event)
|
||||
{
|
||||
case eNotify_OnDisplayRenderUpdate:
|
||||
m_debugHelpersAction->setChecked(Helpers::IsHelpersShown());
|
||||
m_ui->m_helpers->setChecked(Helpers::IsHelpersShown());
|
||||
break;
|
||||
case eNotify_OnBeginGameMode:
|
||||
case eNotify_OnEndGameMode:
|
||||
|
||||
@@ -102,6 +102,7 @@ protected:
|
||||
void SetupResolutionDropdownMenu();
|
||||
void SetupViewportInformationMenu();
|
||||
void SetupOverflowMenu();
|
||||
void SetupHelpersButton();
|
||||
|
||||
QString m_title;
|
||||
|
||||
@@ -172,7 +173,6 @@ protected:
|
||||
QAction* m_normalInformationAction = nullptr;
|
||||
QAction* m_fullInformationAction = nullptr;
|
||||
QAction* m_compactInformationAction = nullptr;
|
||||
QAction* m_debugHelpersAction = nullptr;
|
||||
QAction* m_audioMuteAction = nullptr;
|
||||
QAction* m_enableVRAction = nullptr;
|
||||
QAction* m_enableGridSnappingAction = nullptr;
|
||||
|
||||
@@ -81,6 +81,18 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_helpers">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/Menu/helpers.svg</normaloff>:/Menu/helpers.svg
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="m_resolutionMenu">
|
||||
<property name="icon">
|
||||
@@ -94,7 +106,7 @@
|
||||
<widget class="QToolButton" name="m_overflowBtn">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/stylesheet/img/UI20/menu-centered.svg</normaloff>:/stylesheet/img/UI20/menu-centered.svg
|
||||
<normaloff>:/Menu/menu.svg</normaloff>:/Menu/menu.svg
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:263e95489560dac6e5944ef3caba13e598f83ddead324b943ad7735ba015e1a9
|
||||
size 70727
|
||||
@@ -15,7 +15,8 @@
|
||||
#include "WelcomeScreenDialog.h"
|
||||
|
||||
// Qt
|
||||
#include <QStringListModel>
|
||||
#include <QTableWidget>
|
||||
#include <QTableWidgetItem>
|
||||
#include <QToolTip>
|
||||
#include <QMenu>
|
||||
#include <QDesktopServices>
|
||||
@@ -24,6 +25,7 @@
|
||||
#include <QScreen>
|
||||
#include <QDesktopWidget>
|
||||
#include <QTimer>
|
||||
#include <QDateTime>
|
||||
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
|
||||
@@ -74,65 +76,39 @@ static int GetSmallestScreenHeight()
|
||||
WelcomeScreenDialog::WelcomeScreenDialog(QWidget* pParent)
|
||||
: QDialog(new WindowDecorationWrapper(WindowDecorationWrapper::OptionAutoAttach | WindowDecorationWrapper::OptionAutoTitleBarButtons, pParent), Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint | Qt::WindowTitleHint)
|
||||
, ui(new Ui::WelcomeScreenDialog)
|
||||
, m_pRecentListModel(new QStringListModel(this))
|
||||
, m_pRecentList(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// Make our welcome screen checkboxes appear as toggle switches
|
||||
AzQtComponents::CheckBox::applyToggleSwitchStyle(ui->autoLoadLevel);
|
||||
AzQtComponents::CheckBox::applyToggleSwitchStyle(ui->showOnStartup);
|
||||
ui->recentLevelTable->setColumnCount(3);
|
||||
ui->recentLevelTable->setMouseTracking(true);
|
||||
ui->recentLevelTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
ui->recentLevelTable->horizontalHeader()->hide();
|
||||
ui->recentLevelTable->verticalHeader()->hide();
|
||||
ui->recentLevelTable->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
ui->recentLevelTable->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
ui->recentLevelTable->setIconSize(QSize(20, 20));
|
||||
installEventFilter(this);
|
||||
|
||||
ui->autoLoadLevel->setChecked(gSettings.bAutoloadLastLevelAtStartup);
|
||||
ui->showOnStartup->setChecked(!gSettings.bShowDashboardAtStartup);
|
||||
|
||||
ui->recentLevelList->setModel(m_pRecentListModel);
|
||||
ui->recentLevelList->setMouseTracking(true);
|
||||
ui->recentLevelList->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
auto currentProjectButtonMenu = new QMenu();
|
||||
|
||||
ui->currentProjectButton->setMenu(currentProjectButtonMenu);
|
||||
auto projectName = AZ::Utils::GetProjectName();
|
||||
ui->currentProjectButton->setText(projectName.c_str());
|
||||
ui->currentProjectButton->adjustSize();
|
||||
ui->currentProjectButton->setMinimumWidth(ui->currentProjectButton->width() + 40);
|
||||
ui->currentProjectName->setText(projectName.c_str());
|
||||
|
||||
ui->documentationLink->setCursor(Qt::PointingHandCursor);
|
||||
ui->documentationLink->installEventFilter(this);
|
||||
ui->newLevelButton->setDefault(true);
|
||||
|
||||
connect(ui->recentLevelList, &QWidget::customContextMenuRequested, this, &WelcomeScreenDialog::OnShowContextMenu);
|
||||
// Hide these buttons until the new functionality is added
|
||||
ui->gridButton->hide();
|
||||
ui->objectListButton->hide();
|
||||
ui->switchProjectButton->hide();
|
||||
|
||||
connect(ui->recentLevelList, &QListView::entered, this, &WelcomeScreenDialog::OnShowToolTip);
|
||||
connect(ui->recentLevelList, &QListView::clicked, this, &WelcomeScreenDialog::OnRecentLevelListItemClicked);
|
||||
connect(ui->recentLevelTable, &QWidget::customContextMenuRequested, this, &WelcomeScreenDialog::OnShowContextMenu);
|
||||
|
||||
connect(ui->recentLevelTable, &QTableWidget::entered, this, &WelcomeScreenDialog::OnShowToolTip);
|
||||
connect(ui->recentLevelTable, &QTableWidget::clicked, this, &WelcomeScreenDialog::OnRecentLevelTableItemClicked);
|
||||
|
||||
connect(ui->newLevelButton, &QPushButton::clicked, this, &WelcomeScreenDialog::OnNewLevelBtnClicked);
|
||||
connect(ui->levelFileLabel, &QLabel::linkActivated, this, &WelcomeScreenDialog::OnNewLevelLabelClicked);
|
||||
connect(ui->openLevelButton, &QPushButton::clicked, this, &WelcomeScreenDialog::OnOpenLevelBtnClicked);
|
||||
|
||||
connect(ui->newSliceButton, &QPushButton::clicked, this, &WelcomeScreenDialog::OnNewSliceBtnClicked);
|
||||
connect(ui->openSliceButton, &QPushButton::clicked, this, &WelcomeScreenDialog::OnOpenSliceBtnClicked);
|
||||
|
||||
connect(ui->documentationButton, &QPushButton::clicked, this, &WelcomeScreenDialog::OnDocumentationBtnClicked);
|
||||
connect(ui->showOnStartup, &QCheckBox::clicked, this, &WelcomeScreenDialog::OnShowOnStartupBtnClicked);
|
||||
connect(ui->autoLoadLevel, &QCheckBox::clicked, this, &WelcomeScreenDialog::OnAutoLoadLevelBtnClicked);
|
||||
|
||||
m_manifest = new News::ResourceManifest(
|
||||
std::bind(&WelcomeScreenDialog::SyncSuccess, this),
|
||||
std::bind(&WelcomeScreenDialog::SyncFail, this, std::placeholders::_1),
|
||||
std::bind(&WelcomeScreenDialog::SyncUpdate, this, std::placeholders::_1, std::placeholders::_2));
|
||||
|
||||
m_articleViewContainer = new News::ArticleViewContainer(this, *m_manifest);
|
||||
connect(m_articleViewContainer, &News::ArticleViewContainer::scrolled,
|
||||
this, &WelcomeScreenDialog::previewAreaScrolled);
|
||||
ui->articleViewContainerRoot->layout()->addWidget(m_articleViewContainer);
|
||||
|
||||
m_manifest->Sync();
|
||||
|
||||
#ifndef ENABLE_SLICE_EDITOR
|
||||
ui->newSliceButton->hide();
|
||||
ui->openSliceButton->hide();
|
||||
#endif
|
||||
|
||||
// Adjust the height, if need be
|
||||
// Do it in the constructor so that the WindowDecoratorWrapper handles it correctly
|
||||
int smallestHeight = GetSmallestScreenHeight();
|
||||
@@ -153,16 +129,10 @@ WelcomeScreenDialog::WelcomeScreenDialog(QWidget* pParent)
|
||||
WelcomeScreenDialog::~WelcomeScreenDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete m_manifest;
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::done(int result)
|
||||
{
|
||||
if (m_waitingOnAsync)
|
||||
{
|
||||
m_manifest->Abort();
|
||||
}
|
||||
|
||||
QDialog::done(result);
|
||||
}
|
||||
|
||||
@@ -173,13 +143,11 @@ const QString& WelcomeScreenDialog::GetLevelPath()
|
||||
|
||||
bool WelcomeScreenDialog::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (watched == ui->documentationLink)
|
||||
if (event->type() == QEvent::Show)
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonRelease)
|
||||
{
|
||||
OnDocumentationBtnClicked(false);
|
||||
return true;
|
||||
}
|
||||
ui->recentLevelTable->horizontalHeader()->resizeSection(0, ui->nameLabel->width());
|
||||
ui->recentLevelTable->horizontalHeader()->resizeSection(1, ui->modifiedLabel->width());
|
||||
ui->recentLevelTable->horizontalHeader()->resizeSection(2, ui->typeLabel->width());
|
||||
}
|
||||
|
||||
return QDialog::eventFilter(watched, event);
|
||||
@@ -207,7 +175,9 @@ void WelcomeScreenDialog::SetRecentFileList(RecentFileList* pList)
|
||||
int nCurDir = sCurDir.length();
|
||||
|
||||
int recentListSize = pList->GetSize();
|
||||
for (int i = 0; i < recentListSize; ++i)
|
||||
int currentRow = 0;
|
||||
ui->recentLevelTable->setRowCount(recentListSize);
|
||||
for (int i = 0; i < recentListSize; ++i)
|
||||
{
|
||||
const QString& recentFile = pList->m_arrNames[i];
|
||||
if (recentFile.endsWith(m_levelExtension))
|
||||
@@ -218,7 +188,7 @@ void WelcomeScreenDialog::SetRecentFileList(RecentFileList* pList)
|
||||
if (sCurEntryDir.compare(sCurDir, Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
QString fullPath = recentFile;
|
||||
QString name = Path::GetFileName(fullPath);
|
||||
const QString name = Path::GetFile(fullPath);
|
||||
|
||||
Path::ConvertSlashToBackSlash(fullPath);
|
||||
fullPath = Path::ToUnixPath(fullPath.toLower());
|
||||
@@ -226,18 +196,34 @@ void WelcomeScreenDialog::SetRecentFileList(RecentFileList* pList)
|
||||
|
||||
if (fullPath.contains(gamePath))
|
||||
{
|
||||
m_pRecentListModel->setStringList(m_pRecentListModel->stringList() << QString(name));
|
||||
if (gSettings.prefabSystem)
|
||||
{
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(":/Level/level.svg"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
ui->recentLevelTable->setItem(currentRow, 0, new QTableWidgetItem(icon, name));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->recentLevelTable->setItem(currentRow, 0, new QTableWidgetItem(name));
|
||||
}
|
||||
QFileInfo file(recentFile);
|
||||
QDateTime dateTime = file.lastModified();
|
||||
QString date = QLocale::system().toString(dateTime.date(), QLocale::ShortFormat) + " " +
|
||||
QLocale::system().toString(dateTime.time(), QLocale::LongFormat);
|
||||
ui->recentLevelTable->setItem(currentRow, 1, new QTableWidgetItem(date));
|
||||
ui->recentLevelTable->setItem(currentRow++, 2, new QTableWidgetItem(tr("Level")));
|
||||
m_levels.push_back(std::make_pair(name, recentFile));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ui->recentLevelTable->setRowCount(currentRow);
|
||||
ui->recentLevelTable->setMinimumHeight(currentRow * ui->recentLevelTable->verticalHeader()->defaultSectionSize());
|
||||
ui->recentLevelTable->setMaximumHeight(currentRow * ui->recentLevelTable->verticalHeader()->defaultSectionSize());
|
||||
ui->levelFileLabel->setVisible(currentRow ? false : true);
|
||||
|
||||
ui->recentLevelList->setCurrentIndex(QModelIndex());
|
||||
int rowSize = ui->recentLevelList->sizeHintForRow(0) + ui->recentLevelList->spacing() * 2;
|
||||
ui->recentLevelList->setMinimumHeight(m_pRecentListModel->rowCount() * rowSize);
|
||||
ui->recentLevelList->setMaximumHeight(m_pRecentListModel->rowCount() * rowSize);
|
||||
ui->recentLevelTable->setCurrentIndex(QModelIndex());
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +231,7 @@ void WelcomeScreenDialog::RemoveLevelEntry(int index)
|
||||
{
|
||||
TNamePathPair levelPath = m_levels[index];
|
||||
|
||||
m_pRecentListModel->removeRow(index);
|
||||
ui->recentLevelTable->removeRow(index);
|
||||
m_levels.erase(m_levels.begin() + index);
|
||||
|
||||
|
||||
@@ -284,21 +270,18 @@ void WelcomeScreenDialog::OnShowToolTip(const QModelIndex& index)
|
||||
{
|
||||
const QString& fullPath = m_levels[index.row()].second;
|
||||
|
||||
//TEMPORARY:Begin This can be put back once the main window is in Qt
|
||||
//QRect itemRect = ui->recentLevelList->visualRect(index);
|
||||
QToolTip::showText(QCursor::pos(), QString("Open level: %1").arg(fullPath) /*, ui->recentLevelList, itemRect*/);
|
||||
//TEMPORARY:END
|
||||
QToolTip::showText(QCursor::pos(), QString("Open level: %1").arg(fullPath));
|
||||
}
|
||||
|
||||
|
||||
void WelcomeScreenDialog::OnShowContextMenu(const QPoint& pos)
|
||||
{
|
||||
QModelIndex index = ui->recentLevelList->indexAt(pos);
|
||||
QModelIndex index = ui->recentLevelTable->indexAt(pos);
|
||||
if (index.isValid())
|
||||
{
|
||||
QString level = m_pRecentListModel->data(index, 0).toString();
|
||||
QString level = ui->recentLevelTable->itemAt(pos)->text();
|
||||
|
||||
QPoint globalPos = ui->recentLevelList->viewport()->mapToGlobal(pos);
|
||||
QPoint globalPos = ui->recentLevelTable->viewport()->mapToGlobal(pos);
|
||||
|
||||
QMenu contextMenu;
|
||||
contextMenu.addAction(QString("Remove " + level + " from recent list"));
|
||||
@@ -310,13 +293,16 @@ void WelcomeScreenDialog::OnShowContextMenu(const QPoint& pos)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WelcomeScreenDialog::OnNewLevelBtnClicked([[maybe_unused]] bool checked)
|
||||
{
|
||||
m_levelPath = "new";
|
||||
accept();
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnNewLevelLabelClicked([[maybe_unused]] const QString& path)
|
||||
{
|
||||
OnNewLevelBtnClicked(true);
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnOpenLevelBtnClicked([[maybe_unused]] bool checked)
|
||||
{
|
||||
@@ -329,27 +315,7 @@ void WelcomeScreenDialog::OnOpenLevelBtnClicked([[maybe_unused]] bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnNewSliceBtnClicked([[maybe_unused]] bool checked)
|
||||
{
|
||||
m_levelPath = "new slice";
|
||||
accept();
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnOpenSliceBtnClicked(bool)
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(MainWindow::instance(),
|
||||
tr("Open Slice"),
|
||||
Path::GetEditingGameDataFolder().c_str(),
|
||||
tr("Slice (*.slice)"));
|
||||
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
m_levelPath = fileName;
|
||||
accept();
|
||||
}
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnRecentLevelListItemClicked(const QModelIndex& modelIndex)
|
||||
void WelcomeScreenDialog::OnRecentLevelTableItemClicked(const QModelIndex& modelIndex)
|
||||
{
|
||||
int index = modelIndex.row();
|
||||
|
||||
@@ -365,45 +331,6 @@ void WelcomeScreenDialog::OnCloseBtnClicked([[maybe_unused]] bool checked)
|
||||
accept();
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnAutoLoadLevelBtnClicked(bool checked)
|
||||
{
|
||||
gSettings.bAutoloadLastLevelAtStartup = checked;
|
||||
gSettings.Save();
|
||||
}
|
||||
|
||||
|
||||
void WelcomeScreenDialog::OnShowOnStartupBtnClicked(bool checked)
|
||||
{
|
||||
gSettings.bShowDashboardAtStartup = !checked;
|
||||
gSettings.Save();
|
||||
|
||||
if (gSettings.bShowDashboardAtStartup == false)
|
||||
{
|
||||
QMessageBox msgBox(AzToolsFramework::GetActiveWindow());
|
||||
msgBox.setWindowTitle(QObject::tr("Skip the Welcome dialog on startup"));
|
||||
msgBox.setText(QObject::tr("You may re-enable the Welcome dialog at any time by going to Edit > Editor Settings > Global Preferences in the menu bar."));
|
||||
msgBox.exec();
|
||||
}
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnDocumentationBtnClicked([[maybe_unused]] bool checked)
|
||||
{
|
||||
QString webLink = tr("https://aws.amazon.com/lumberyard/support/");
|
||||
QDesktopServices::openUrl(QUrl(webLink));
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::SyncFail([[maybe_unused]] News::ErrorCode error)
|
||||
{
|
||||
m_articleViewContainer->AddErrorMessage();
|
||||
m_waitingOnAsync = false;
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::SyncSuccess()
|
||||
{
|
||||
m_articleViewContainer->PopulateArticles();
|
||||
m_waitingOnAsync = false;
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::previewAreaScrolled()
|
||||
{
|
||||
//this should only be reported once per session
|
||||
|
||||
@@ -52,13 +52,9 @@ private:
|
||||
Ui::WelcomeScreenDialog* ui;
|
||||
|
||||
QString m_levelPath;
|
||||
QStringListModel* m_pRecentListModel;
|
||||
TNameFullPathArray m_levels;
|
||||
RecentFileList* m_pRecentList;
|
||||
News::ResourceManifest* m_manifest = nullptr;
|
||||
News::ArticleViewContainer* m_articleViewContainer = nullptr;
|
||||
const char* m_levelExtension = nullptr;
|
||||
bool m_waitingOnAsync = true;
|
||||
bool m_messageScrollReported = false;
|
||||
|
||||
void RemoveLevelEntry(int index);
|
||||
@@ -66,19 +62,11 @@ private:
|
||||
void OnShowToolTip(const QModelIndex& index);
|
||||
void OnShowContextMenu(const QPoint& point);
|
||||
void OnNewLevelBtnClicked(bool checked);
|
||||
void OnNewLevelLabelClicked(const QString& checked);
|
||||
void OnOpenLevelBtnClicked(bool checked);
|
||||
void OnNewSliceBtnClicked(bool checked);
|
||||
void OnOpenSliceBtnClicked(bool checked);
|
||||
void OnRecentLevelListItemClicked(const QModelIndex& index);
|
||||
void OnGettingStartedBtnClicked(bool checked);
|
||||
void OnTutorialsBtnClicked(bool checked);
|
||||
void OnDocumentationBtnClicked(bool checked);
|
||||
void OnForumsBtnClicked(bool checked);
|
||||
void OnAutoLoadLevelBtnClicked(bool checked);
|
||||
void OnShowOnStartupBtnClicked(bool checked);
|
||||
void OnRecentLevelTableItemClicked(const QModelIndex& index);
|
||||
void OnCloseBtnClicked(bool checked);
|
||||
|
||||
void SyncUpdate(const QString& /* message */, News::LogType /* logType */) {}
|
||||
void SyncFail(News::ErrorCode error);
|
||||
void SyncSuccess();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="WelcomeScreenDialog">
|
||||
<file>WelcomeScreenDialogHeader.png</file>
|
||||
<file>DefaultActiveProject.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
<ui version="4.0">
|
||||
<class>WelcomeScreenDialog</class>
|
||||
<widget class="QWidget" name="WelcomeScreenDialog">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
<width>945</width>
|
||||
<height>639</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -18,21 +21,21 @@
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
<width>945</width>
|
||||
<height>639</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>16777215</height>
|
||||
<width>945</width>
|
||||
<height>639</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::TabFocus</enum>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Welcome to Open 3D Engine</string>
|
||||
<string>Welcome to O3DE</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
@@ -53,100 +56,6 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="projectViewContainer" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="projectViewContainer_layout" stretch="0,0,1,0,0">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="currentProjectLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Current project:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="currentProjectButton">
|
||||
<property name="text">
|
||||
<string>Current Project Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: "black"</string>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="bodyContainer">
|
||||
<property name="spacing">
|
||||
@@ -165,20 +74,26 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="levelViewFTUEContainer" native="true">
|
||||
<widget class="QWidget" name="articleViewContainerRoot" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<width>183</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<width>183</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<layout class="QVBoxLayout" name="newsContainerLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -191,6 +106,143 @@
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="currentProjectLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Active project</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="activeProjectIcon">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>126</width>
|
||||
<height>167</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>126</width>
|
||||
<height>167</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="WelcomeScreenDialog.qrc">:/WelcomeScreenDialog/DefaultActiveProject.png</pixmap>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="currentProjectName">
|
||||
<property name="text">
|
||||
<string>MyGame</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="switchProjectButton">
|
||||
<property name="text">
|
||||
<string>Switch project...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="levelViewFTUEContainer" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>762</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>762</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -227,7 +279,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open or create a level</string>
|
||||
<string>Recent Files</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>-1</number>
|
||||
@@ -255,16 +307,6 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QListView" name="recentLevelList">
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -310,8 +352,26 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="newLevelButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>156</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>156</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New level...</string>
|
||||
<string>Create new...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -333,8 +393,67 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="openLevelButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>156</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>156</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open level...</string>
|
||||
<string>Open...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="objectListButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Framework/AzQtComponents/AzQtComponents/Components/resources.qrc">
|
||||
<normaloff>:/stylesheet/img/UI20/toolbar/Object_list.svg</normaloff>:/stylesheet/img/UI20/toolbar/Object_list.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="gridButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Framework/AzQtComponents/AzQtComponents/Components/resources.qrc">
|
||||
<normaloff>:/stylesheet/img/UI20/toolbar/Grid.svg</normaloff>:/stylesheet/img/UI20/toolbar/Grid.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -358,65 +477,130 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="horizontalWidget_2" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="2,2,1">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="sliceControlContainer">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="newSliceButton">
|
||||
<property name="text">
|
||||
<string>New slice...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="openSliceButton">
|
||||
<property name="text">
|
||||
<string>Open slice...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<item>
|
||||
<widget class="QLabel" name="nameLabel">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="modifiedLabel">
|
||||
<property name="text">
|
||||
<string>Last modified</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="typeLabel">
|
||||
<property name="text">
|
||||
<string>Type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7" stretch="0,0,0">
|
||||
<property name="leftMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="levelFileLabel">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>No level file created yet for this project. <a href="#">Create one</a> now.</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableWidget" name="recentLevelTable">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<number>1</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<number>48</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderHighlightSections">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="maximumSize">
|
||||
@@ -439,205 +623,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignHCenter">
|
||||
<widget class="QWidget" name="documentationLinkContainer" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>48</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>48</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="documentationButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>info</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/stylesheet/img/UI20/Info.svg</normaloff>:/stylesheet/img/UI20/Info.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="documentationLink">
|
||||
<property name="text">
|
||||
<string>Documentation and tutorials</string>
|
||||
</property>
|
||||
<property name="class" stdset="0">
|
||||
<string>link</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>1</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: "black"</string>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="articleViewContainerRoot" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>480</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="newsContainerLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: "black"</string>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignRight">
|
||||
<widget class="QWidget" name="optionsViewContainer" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="optionsViewContainer_layout">
|
||||
<property name="spacing">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="autoLoadLevel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Auto-load last opened level on startup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="showOnStartup">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Skip this dialog on startup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="WelcomeScreenDialog.qrc"/>
|
||||
<include location="../../../Framework/AzQtComponents/AzQtComponents/Components/resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:53b846352880d940621b14b1ea9514e0a4c95aa6ead4d00234a98684c061c04f
|
||||
size 29505
|
||||
@@ -255,7 +255,6 @@ namespace AZ
|
||||
{
|
||||
return AZStd::make_pair(animation, anim);
|
||||
}
|
||||
|
||||
Events::ProcessingResult AssImpAnimationImporter::ImportAnimation(AssImpSceneNodeAppendedContext& context)
|
||||
{
|
||||
AZ_TraceContext("Importer", "Animation");
|
||||
@@ -447,7 +446,22 @@ namespace AZ
|
||||
|
||||
return combinedAnimationResult.GetResult();
|
||||
}
|
||||
decltype(boneAnimations) parentFillerAnimations;
|
||||
|
||||
AZStd::unordered_set<AZStd::string> boneList;
|
||||
|
||||
for (int meshIndex = 0; meshIndex < scene->mNumMeshes; ++meshIndex)
|
||||
{
|
||||
aiMesh* mesh = scene->mMeshes[meshIndex];
|
||||
|
||||
for (int boneIndex = 0; boneIndex < mesh->mNumBones; ++boneIndex)
|
||||
{
|
||||
aiBone* bone = mesh->mBones[boneIndex];
|
||||
|
||||
boneList.insert(bone->mName.C_Str());
|
||||
}
|
||||
}
|
||||
|
||||
decltype(boneAnimations) fillerAnimations;
|
||||
|
||||
// Go through all the animations and make sure we create animations for bones who's parents don't have an animation
|
||||
for (auto&& anim : boneAnimations)
|
||||
@@ -459,8 +473,8 @@ namespace AZ
|
||||
{
|
||||
if (!IsPivotNode(parent->mName))
|
||||
{
|
||||
if (boneAnimations.find(parent->mName.C_Str()) == boneAnimations.end() &&
|
||||
parentFillerAnimations.find(parent->mName.C_Str()) == parentFillerAnimations.end())
|
||||
if (!boneAnimations.contains(parent->mName.C_Str()) &&
|
||||
!fillerAnimations.contains(parent->mName.C_Str()))
|
||||
{
|
||||
// Create 1 key for each type that just copies the current transform
|
||||
ConsolidatedNodeAnim emptyAnimation;
|
||||
@@ -472,7 +486,7 @@ namespace AZ
|
||||
globalTransform.Decompose(scale, rotation, position);
|
||||
|
||||
emptyAnimation.mNumRotationKeys = emptyAnimation.mNumPositionKeys = emptyAnimation.mNumScalingKeys = 1;
|
||||
|
||||
|
||||
emptyAnimation.m_ownedPositionKeys.emplace_back(0, position);
|
||||
emptyAnimation.mPositionKeys = emptyAnimation.m_ownedPositionKeys.data();
|
||||
|
||||
@@ -481,9 +495,9 @@ namespace AZ
|
||||
|
||||
emptyAnimation.m_ownedScalingKeys.emplace_back(0, scale);
|
||||
emptyAnimation.mScalingKeys = emptyAnimation.m_ownedScalingKeys.data();
|
||||
|
||||
parentFillerAnimations.insert(
|
||||
AZStd::make_pair(parent->mName.C_Str(), AZStd::make_pair(anim.second.first, AZStd::move(emptyAnimation))));
|
||||
|
||||
fillerAnimations.insert(AZStd::make_pair(
|
||||
parent->mName.C_Str(), AZStd::make_pair(anim.second.first, AZStd::move(emptyAnimation))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,7 +505,7 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
boneAnimations.insert(AZStd::make_move_iterator(parentFillerAnimations.begin()), AZStd::make_move_iterator(parentFillerAnimations.end()));
|
||||
boneAnimations.insert(AZStd::make_move_iterator(fillerAnimations.begin()), AZStd::make_move_iterator(fillerAnimations.end()));
|
||||
|
||||
auto animItr = boneAnimations.equal_range(currentNode->mName.C_Str());
|
||||
|
||||
|
||||
@@ -98,6 +98,20 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
aiMatrix4x4 CalculateWorldTransform(const aiNode* currentNode)
|
||||
{
|
||||
aiMatrix4x4 transform = {};
|
||||
const aiNode* iteratingNode = currentNode;
|
||||
|
||||
while (iteratingNode)
|
||||
{
|
||||
transform = iteratingNode->mTransformation * transform;
|
||||
iteratingNode = iteratingNode->mParent;
|
||||
}
|
||||
|
||||
return transform;
|
||||
}
|
||||
|
||||
Events::ProcessingResult AssImpBoneImporter::ImportBone(AssImpNodeEncounteredContext& context)
|
||||
{
|
||||
AZ_TraceContext("Importer", "Bone");
|
||||
@@ -111,12 +125,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
bool isBone = false;
|
||||
|
||||
if (NodeParentIsOfType(context.m_scene.GetGraph(), context.m_currentGraphPosition, DataTypes::IBoneData::TYPEINFO_Uuid()))
|
||||
{
|
||||
isBone = true;
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
AZStd::unordered_map<AZStd::string, const aiNode*> mainBoneList;
|
||||
AZStd::unordered_map<AZStd::string, const aiBone*> boneLookup;
|
||||
@@ -170,15 +179,8 @@ namespace AZ
|
||||
{
|
||||
createdBoneData = AZStd::make_shared<SceneData::GraphData::RootBoneData>();
|
||||
}
|
||||
|
||||
aiMatrix4x4 transform = currentNode->mTransformation;
|
||||
const aiNode* parent = currentNode->mParent;
|
||||
|
||||
while (parent)
|
||||
{
|
||||
transform = parent->mTransformation * transform;
|
||||
parent = parent->mParent;
|
||||
}
|
||||
aiMatrix4x4 transform = CalculateWorldTransform(currentNode);
|
||||
|
||||
SceneAPI::DataTypes::MatrixType globalTransform = AssImpSDKWrapper::AssImpTypeConverter::ToTransform(transform);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace AZ
|
||||
~AssImpBoneImporter() override = default;
|
||||
|
||||
static void Reflect(ReflectContext* context);
|
||||
|
||||
|
||||
Events::ProcessingResult ImportBone(AssImpNodeEncounteredContext& context);
|
||||
};
|
||||
} // namespace FbxSceneBuilder
|
||||
|
||||
@@ -46,8 +46,9 @@ namespace AZ
|
||||
serializeContext->Class<AssImpTransformImporter, SceneCore::LoadingComponent>()->Version(1);
|
||||
}
|
||||
}
|
||||
|
||||
void GetAllBones(const aiScene* scene, AZStd::unordered_map<AZStd::string, const aiBone*>& boneLookup)
|
||||
|
||||
void GetAllBones(
|
||||
const aiScene* scene, AZStd::unordered_multimap<AZStd::string, const aiBone*>& boneLookup)
|
||||
{
|
||||
for (unsigned meshIndex = 0; meshIndex < scene->mNumMeshes; ++meshIndex)
|
||||
{
|
||||
@@ -57,7 +58,7 @@ namespace AZ
|
||||
{
|
||||
const aiBone* bone = mesh->mBones[boneIndex];
|
||||
|
||||
boneLookup[bone->mName.C_Str()] = bone;
|
||||
boneLookup.emplace(bone->mName.C_Str(), bone);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,41 +74,53 @@ namespace AZ
|
||||
return Events::ProcessingResult::Ignored;
|
||||
}
|
||||
|
||||
AZStd::unordered_map<AZStd::string, const aiBone*> boneLookup;
|
||||
AZStd::unordered_multimap<AZStd::string, const aiBone*> boneLookup;
|
||||
GetAllBones(scene, boneLookup);
|
||||
|
||||
auto boneIterator = boneLookup.find(currentNode->mName.C_Str());
|
||||
const bool isBone = boneIterator != boneLookup.end();
|
||||
|
||||
aiMatrix4x4 combinedTransform;
|
||||
|
||||
DataTypes::MatrixType localTransform;
|
||||
|
||||
if (isBone)
|
||||
{
|
||||
auto parentNode = currentNode->mParent;
|
||||
AZStd::vector<DataTypes::MatrixType> offsets, inverseOffsets;
|
||||
auto iteratingNode = currentNode;
|
||||
|
||||
aiMatrix4x4 offsetMatrix = boneIterator->second->mOffsetMatrix;
|
||||
aiMatrix4x4 parentOffset {};
|
||||
|
||||
auto parentBoneIterator = boneLookup.find(parentNode->mName.C_Str());
|
||||
|
||||
if (parentNode && parentBoneIterator != boneLookup.end())
|
||||
while (iteratingNode && boneLookup.count(iteratingNode->mName.C_Str()))
|
||||
{
|
||||
const auto& parentBone = parentBoneIterator->second;
|
||||
AZStd::string name = iteratingNode->mName.C_Str();
|
||||
|
||||
parentOffset = parentBone->mOffsetMatrix;
|
||||
auto range = boneLookup.equal_range(name);
|
||||
|
||||
if (range.first != range.second)
|
||||
{
|
||||
// There can be multiple offsetMatrices for a given bone, we're only interested in grabbing the first one
|
||||
auto boneFirstOffsetMatrix = range.first->second->mOffsetMatrix;
|
||||
auto azMat = AssImpSDKWrapper::AssImpTypeConverter::ToTransform(boneFirstOffsetMatrix);
|
||||
offsets.push_back(azMat);
|
||||
inverseOffsets.push_back(azMat.GetInverseFull());
|
||||
}
|
||||
|
||||
iteratingNode = iteratingNode->mParent;
|
||||
}
|
||||
|
||||
auto inverseOffset = offsetMatrix;
|
||||
inverseOffset.Inverse();
|
||||
|
||||
combinedTransform = parentOffset * inverseOffset;
|
||||
|
||||
localTransform =
|
||||
offsets.at(AZ::GetMin(offsets.size()-1, static_cast<decltype(offsets.size())>(1))) // parent bone offset, or if there is no parent, then current node offset
|
||||
* inverseOffsets.at(inverseOffsets.size() - 1) // Inverse of root bone offset
|
||||
* offsets.at(offsets.size() - 1) // Root bone offset
|
||||
* inverseOffsets.at(0); // Inverse of current node offset
|
||||
}
|
||||
else
|
||||
{
|
||||
combinedTransform = GetConcatenatedLocalTransform(currentNode);
|
||||
localTransform = AssImpSDKWrapper::AssImpTypeConverter::ToTransform(GetConcatenatedLocalTransform(currentNode));
|
||||
}
|
||||
|
||||
DataTypes::MatrixType localTransform = AssImpSDKWrapper::AssImpTypeConverter::ToTransform(combinedTransform);
|
||||
// Don't bother adding a node with the identity matrix
|
||||
if (localTransform == DataTypes::MatrixType::Identity())
|
||||
{
|
||||
return Events::ProcessingResult::Ignored;
|
||||
}
|
||||
|
||||
context.m_sourceSceneSystem.SwapTransformForUpAxis(localTransform);
|
||||
context.m_sourceSceneSystem.ConvertUnit(localTransform);
|
||||
|
||||
@@ -1765,16 +1765,8 @@ namespace LUAEditor
|
||||
return false;
|
||||
}
|
||||
|
||||
//name has the full path in it, we need to convert it to an asset name
|
||||
AZStd::string projectRoot, databaseRoot, databasePath, databaseFile, fileExtension;
|
||||
if (!AzFramework::StringFunc::AssetDatabasePath::Split(name.toUtf8().data(), &projectRoot, &databaseRoot, &databasePath, &databaseFile, &fileExtension))
|
||||
{
|
||||
AZ_Warning("LUAEditorMainWindow", false, AZStd::string::format("<span severity=\"err\">Path is invalid: '%s'</span>", name.toUtf8().data()).c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
AzFramework::StringFunc::Path::Split(name.toUtf8().data(), nullptr, &m_lastOpenFilePath);
|
||||
AzFramework::StringFunc::AssetDatabasePath::Join(databasePath.c_str(), databaseFile.c_str(), newAssetName);
|
||||
newAssetName = name.toUtf8().data();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user