Remove a number of unused CryCommon interfaces and docs related folders. (#788)
This commit is contained in:
@@ -1,290 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "AlembicCompileDialog.h"
|
||||
|
||||
// Qt
|
||||
#include <QPushButton>
|
||||
|
||||
// AzCore
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
|
||||
#include <Pak/CryPakUtils.h>
|
||||
|
||||
// Editor
|
||||
#include "Util/PathUtil.h"
|
||||
#include "Util/EditorUtils.h"
|
||||
|
||||
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
#include <Alembic/ui_AlembicCompileDialog.h>
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
|
||||
CAlembicCompileDialog::CAlembicCompileDialog(const XmlNodeRef config)
|
||||
: m_ui(new Ui::AlembicCompileDialog)
|
||||
{
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
m_ui->setupUi(this);
|
||||
m_config = LoadConfig("", config);
|
||||
|
||||
OnInitDialog();
|
||||
|
||||
connect(m_ui->m_yUpRadio, &QRadioButton::clicked, this, &CAlembicCompileDialog::OnRadioYUp);
|
||||
connect(m_ui->m_zUpRadio, &QRadioButton::clicked, this, &CAlembicCompileDialog::OnRadioZUp);
|
||||
connect(m_ui->m_playbackFromMemoryCheckBox, &QCheckBox::clicked, this, &CAlembicCompileDialog::OnPlaybackFromMemory);
|
||||
connect(m_ui->m_blockCompressionFormatCombo, &QComboBox::currentTextChanged, this, &CAlembicCompileDialog::OnBlockCompressionSelected);
|
||||
connect(m_ui->m_meshPredictionCheckBox, &QCheckBox::clicked, this, &CAlembicCompileDialog::OnMeshPredictionCheckBox);
|
||||
connect(m_ui->m_useBFramesCheckBox, &QCheckBox::clicked, this, &CAlembicCompileDialog::OnUseBFramesCheckBox);
|
||||
connect(m_ui->m_indexFrameDistanceEdit, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &CAlembicCompileDialog::OnIndexFrameDistanceChanged);
|
||||
connect(m_ui->m_positionPrecisionEdit, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &CAlembicCompileDialog::OnPositionPrecisionChanged);
|
||||
connect(m_ui->m_uvMaxEdit, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, &CAlembicCompileDialog::OnUVmaxChanged);
|
||||
connect(m_ui->m_presetComboBox, &QComboBox::currentTextChanged, this, &CAlembicCompileDialog::OnPresetSelected);
|
||||
}
|
||||
|
||||
CAlembicCompileDialog::~CAlembicCompileDialog()
|
||||
{
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::OnInitDialog()
|
||||
{
|
||||
// custom 'Ok' and 'Cancel' text for this dialog
|
||||
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setText("Recompile .cax File");
|
||||
m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setText("Use Existing .cax File");
|
||||
|
||||
m_ui->m_blockCompressionFormatCombo->addItem(QStringLiteral("store"));
|
||||
m_ui->m_blockCompressionFormatCombo->addItem(QStringLiteral("deflate"));
|
||||
m_ui->m_blockCompressionFormatCombo->addItem(QStringLiteral("lz4hc"));
|
||||
m_ui->m_blockCompressionFormatCombo->addItem(QStringLiteral("zstd"));
|
||||
AZStd::vector<AZStd::string> presetFiles;
|
||||
const char* const filePattern = "*.cbc";
|
||||
|
||||
SDirectoryEnumeratorHelper dirHelper;
|
||||
|
||||
auto engineAssetSourceRoot = AZ::IO::FixedMaxPath(AZ::Utils::GetEnginePath()) / "Assets";
|
||||
dirHelper.ScanDirectoryRecursive(gEnv->pCryPak, engineAssetSourceRoot.c_str(), "Editor/Presets/GeomCache", filePattern, presetFiles);
|
||||
|
||||
for (auto iter = presetFiles.begin(); iter != presetFiles.end(); ++iter)
|
||||
{
|
||||
const auto& file = *iter;
|
||||
const AZ::IO::FixedMaxPath filePath = engineAssetSourceRoot / file;
|
||||
m_presets.push_back(LoadConfig(Path::GetFileName(file.c_str()), XmlHelpers::LoadXmlFromFile(filePath.c_str())));
|
||||
m_ui->m_presetComboBox->addItem(m_presets.back().m_name);
|
||||
}
|
||||
|
||||
m_ui->m_presetComboBox->addItem(tr("(Custom)"));
|
||||
|
||||
SetFromConfig(m_config);
|
||||
UpdatePresetSelection();
|
||||
UpdateEnabledStates();
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::SetFromConfig(const SConfig& config)
|
||||
{
|
||||
if (QString::compare(config.m_blockCompressionFormat, QLatin1String("deflate"), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_ui->m_blockCompressionFormatCombo->setCurrentIndex(1);
|
||||
}
|
||||
else if (QString::compare(config.m_blockCompressionFormat, QLatin1String("lz4hc"), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_ui->m_blockCompressionFormatCombo->setCurrentIndex(2);
|
||||
}
|
||||
else if (QString::compare(config.m_blockCompressionFormat, QLatin1String("zstd"), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_ui->m_blockCompressionFormatCombo->setCurrentIndex(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->m_blockCompressionFormatCombo->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
if (QString::compare(config.m_upAxis, QLatin1String("Y"), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_ui->m_yUpRadio->setChecked(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->m_zUpRadio->setChecked(true);
|
||||
}
|
||||
|
||||
m_ui->m_playbackFromMemoryCheckBox->setChecked(config.m_playbackFromMemory == QStringLiteral("1"));
|
||||
m_ui->m_meshPredictionCheckBox->setChecked(config.m_meshPrediction == QStringLiteral("1"));
|
||||
m_ui->m_useBFramesCheckBox->setChecked(config.m_useBFrames == QStringLiteral("1"));
|
||||
|
||||
m_ui->m_indexFrameDistanceEdit->setValue(config.m_indexFrameDistance);
|
||||
m_ui->m_positionPrecisionEdit->setValue(aznumeric_cast<int>(config.m_positionPrecision));
|
||||
m_ui->m_uvMaxEdit->setValue(config.m_uvMax);
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::UpdateEnabledStates()
|
||||
{
|
||||
m_ui->m_meshPredictionCheckBox->setEnabled(false);
|
||||
m_ui->m_useBFramesCheckBox->setEnabled(false);
|
||||
m_ui->m_indexFrameDistanceEdit->setEnabled(false);
|
||||
|
||||
if (QString::compare(m_config.m_blockCompressionFormat, QLatin1String("store"), Qt::CaseInsensitive) != 0)
|
||||
{
|
||||
m_ui->m_meshPredictionCheckBox->setEnabled(true);
|
||||
m_ui->m_useBFramesCheckBox->setEnabled(true);
|
||||
|
||||
m_ui->m_indexFrameDistanceEdit->setEnabled(m_config.m_useBFrames == QStringLiteral("1"));
|
||||
}
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::UpdatePresetSelection()
|
||||
{
|
||||
for (uint i = 0; i < m_presets.size(); ++i)
|
||||
{
|
||||
if (m_presets[i] == m_config)
|
||||
{
|
||||
m_ui->m_presetComboBox->setCurrentIndex(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_ui->m_presetComboBox->setCurrentIndex(m_presets.size());
|
||||
}
|
||||
|
||||
QString CAlembicCompileDialog::GetUpAxis() const
|
||||
{
|
||||
return m_config.m_upAxis;
|
||||
}
|
||||
|
||||
QString CAlembicCompileDialog::GetPlaybackFromMemory() const
|
||||
{
|
||||
return m_config.m_playbackFromMemory;
|
||||
}
|
||||
|
||||
QString CAlembicCompileDialog::GetBlockCompressionFormat() const
|
||||
{
|
||||
return m_config.m_blockCompressionFormat;
|
||||
}
|
||||
|
||||
QString CAlembicCompileDialog::GetMeshPrediction() const
|
||||
{
|
||||
return m_config.m_meshPrediction;
|
||||
}
|
||||
|
||||
QString CAlembicCompileDialog::GetUseBFrames() const
|
||||
{
|
||||
return m_config.m_useBFrames;
|
||||
}
|
||||
|
||||
uint CAlembicCompileDialog::GetIndexFrameDistance() const
|
||||
{
|
||||
return m_config.m_indexFrameDistance;
|
||||
}
|
||||
|
||||
double CAlembicCompileDialog::GetPositionPrecision() const
|
||||
{
|
||||
return m_config.m_positionPrecision;
|
||||
}
|
||||
|
||||
float CAlembicCompileDialog::GetUVmax() const
|
||||
{
|
||||
return m_config.m_uvMax;
|
||||
}
|
||||
|
||||
|
||||
void CAlembicCompileDialog::OnRadioYUp()
|
||||
{
|
||||
m_config.m_upAxis = "Y";
|
||||
UpdatePresetSelection();
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::OnRadioZUp()
|
||||
{
|
||||
m_config.m_upAxis = "Z";
|
||||
UpdatePresetSelection();
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::OnPlaybackFromMemory()
|
||||
{
|
||||
m_config.m_playbackFromMemory = m_ui->m_playbackFromMemoryCheckBox->isChecked() ? QStringLiteral("1") : QStringLiteral("0");
|
||||
UpdatePresetSelection();
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::OnBlockCompressionSelected()
|
||||
{
|
||||
m_config.m_blockCompressionFormat = m_ui->m_blockCompressionFormatCombo->currentText();
|
||||
UpdatePresetSelection();
|
||||
UpdateEnabledStates();
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::OnMeshPredictionCheckBox()
|
||||
{
|
||||
m_config.m_meshPrediction = m_ui->m_meshPredictionCheckBox->isChecked() ? QStringLiteral("1") : QStringLiteral("0");
|
||||
UpdatePresetSelection();
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::OnUseBFramesCheckBox()
|
||||
{
|
||||
m_config.m_useBFrames = m_ui->m_useBFramesCheckBox->isChecked() ? QStringLiteral("1") : QStringLiteral("0");
|
||||
UpdatePresetSelection();
|
||||
UpdateEnabledStates();
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::OnIndexFrameDistanceChanged()
|
||||
{
|
||||
m_config.m_indexFrameDistance = m_ui->m_indexFrameDistanceEdit->value();
|
||||
UpdatePresetSelection();
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::OnPositionPrecisionChanged()
|
||||
{
|
||||
m_config.m_positionPrecision = m_ui->m_positionPrecisionEdit->value();
|
||||
UpdatePresetSelection();
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::OnUVmaxChanged()
|
||||
{
|
||||
m_config.m_uvMax = aznumeric_cast<float>(m_ui->m_uvMaxEdit->value());
|
||||
UpdatePresetSelection();
|
||||
}
|
||||
|
||||
void CAlembicCompileDialog::OnPresetSelected()
|
||||
{
|
||||
uint presetIndex = m_ui->m_presetComboBox->currentIndex();
|
||||
if (presetIndex < m_presets.size())
|
||||
{
|
||||
m_config = m_presets[presetIndex];
|
||||
SetFromConfig(m_config);
|
||||
}
|
||||
|
||||
m_ui->m_presetComboBox->setCurrentIndex(presetIndex);
|
||||
UpdateEnabledStates();
|
||||
}
|
||||
|
||||
CAlembicCompileDialog::SConfig CAlembicCompileDialog::LoadConfig(const QString& fileName, XmlNodeRef xml) const
|
||||
{
|
||||
SConfig config;
|
||||
config.m_name = fileName;
|
||||
|
||||
if (xml)
|
||||
{
|
||||
config.m_name = xml->getAttr("Name");
|
||||
config.m_blockCompressionFormat = xml->getAttr("BlockCompressionFormat");
|
||||
config.m_upAxis = xml->getAttr("UpAxis");
|
||||
config.m_playbackFromMemory = xml->getAttr("PlaybackFromMemory");
|
||||
config.m_meshPrediction = xml->getAttr("MeshPrediction");
|
||||
config.m_useBFrames = xml->getAttr("UseBFrames");
|
||||
xml->getAttr("IndexFrameDistance", config.m_indexFrameDistance);
|
||||
xml->getAttr("PositionPrecision", config.m_positionPrecision);
|
||||
xml->getAttr("UVmax", config.m_uvMax);
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
#include <Alembic/moc_AlembicCompileDialog.cpp>
|
||||
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_ALEMBIC_ALEMBICCOMPILEDIALOG_H
|
||||
#define CRYINCLUDE_EDITOR_ALEMBIC_ALEMBICCOMPILEDIALOG_H
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <QDialog>
|
||||
|
||||
#include <IXml.h>
|
||||
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class AlembicCompileDialog;
|
||||
}
|
||||
|
||||
class CAlembicCompileDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CAlembicCompileDialog(const XmlNodeRef config);
|
||||
~CAlembicCompileDialog();
|
||||
|
||||
void OnInitDialog();
|
||||
|
||||
QString GetUpAxis() const;
|
||||
QString GetPlaybackFromMemory() const;
|
||||
QString GetBlockCompressionFormat() const;
|
||||
QString GetMeshPrediction() const;
|
||||
QString GetUseBFrames() const;
|
||||
uint GetIndexFrameDistance() const;
|
||||
double GetPositionPrecision() const;
|
||||
float GetUVmax() const;
|
||||
|
||||
|
||||
private:
|
||||
struct SConfig
|
||||
{
|
||||
SConfig()
|
||||
: m_upAxis("Y")
|
||||
, m_playbackFromMemory("0")
|
||||
, m_blockCompressionFormat("deflate")
|
||||
, m_meshPrediction("1")
|
||||
, m_useBFrames("1")
|
||||
, m_indexFrameDistance(10)
|
||||
, m_positionPrecision(1.0)
|
||||
, m_uvMax(1.0f) {}
|
||||
|
||||
bool operator ==(const SConfig& other) const
|
||||
{
|
||||
return m_blockCompressionFormat == other.m_blockCompressionFormat
|
||||
&& m_upAxis == other.m_upAxis
|
||||
&& m_playbackFromMemory == other.m_playbackFromMemory
|
||||
&& m_meshPrediction == other.m_meshPrediction
|
||||
&& m_useBFrames == other.m_useBFrames
|
||||
&& m_indexFrameDistance == other.m_indexFrameDistance
|
||||
&& m_positionPrecision == other.m_positionPrecision
|
||||
&& m_uvMax == other.m_uvMax;
|
||||
}
|
||||
|
||||
QString m_name;
|
||||
QString m_blockCompressionFormat;
|
||||
QString m_upAxis;
|
||||
QString m_playbackFromMemory;
|
||||
QString m_meshPrediction;
|
||||
QString m_useBFrames;
|
||||
uint m_indexFrameDistance;
|
||||
double m_positionPrecision;
|
||||
float m_uvMax;
|
||||
};
|
||||
|
||||
void SetFromConfig(const SConfig& config);
|
||||
void UpdateEnabledStates();
|
||||
void UpdatePresetSelection();
|
||||
SConfig LoadConfig(const QString& fileName, XmlNodeRef xml) const;
|
||||
|
||||
void OnRadioYUp();
|
||||
void OnRadioZUp();
|
||||
void OnPlaybackFromMemory();
|
||||
void OnBlockCompressionSelected();
|
||||
void OnMeshPredictionCheckBox();
|
||||
void OnUseBFramesCheckBox();
|
||||
void OnIndexFrameDistanceChanged();
|
||||
void OnPositionPrecisionChanged();
|
||||
void OnUVmaxChanged();
|
||||
void OnPresetSelected();
|
||||
|
||||
SConfig m_config;
|
||||
std::vector<SConfig> m_presets;
|
||||
|
||||
QScopedPointer<Ui::AlembicCompileDialog> m_ui;
|
||||
};
|
||||
#endif // CRYINCLUDE_EDITOR_ALEMBIC_ALEMBICCOMPILEDIALOG_H
|
||||
@@ -1,192 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AlembicCompileDialog</class>
|
||||
<widget class="QDialog" name="AlembicCompileDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>432</width>
|
||||
<height>252</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Compile Alembic File</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Preset</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="m_presetComboBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="3">
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="title">
|
||||
<string>Compression Settings</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Block Compression:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="m_blockCompressionFormatCombo"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Precision (mm):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="m_positionPrecisionEdit">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>UV Max:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="m_meshPredictionCheckBox">
|
||||
<property name="text">
|
||||
<string>Use Mesh Prediction</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="m_useBFramesCheckBox">
|
||||
<property name="text">
|
||||
<string>Use Bi-Directional Prediction</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Index Frame Distance:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="m_indexFrameDistanceEdit">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_uvMaxEdit">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Compilation Settings</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_yUpRadio">
|
||||
<property name="text">
|
||||
<string>Y-axis up</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_zUpRadio">
|
||||
<property name="text">
|
||||
<string>Z-axis up</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Runtime Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="m_playbackFromMemoryCheckBox">
|
||||
<property name="text">
|
||||
<string>Playback from Memory</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>AlembicCompileDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>AlembicCompileDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -1,158 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "AlembicCompiler.h"
|
||||
|
||||
// Editor
|
||||
#include "AlembicCompileDialog.h"
|
||||
#include "Util/EditorUtils.h"
|
||||
#include "Util/FileUtil.h"
|
||||
#include "Util/PathUtil.h"
|
||||
|
||||
// AzCore
|
||||
#include <AzCore/std/string/wildcard.h>
|
||||
|
||||
// AzToolsFramework
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserEntry.h>
|
||||
|
||||
|
||||
|
||||
namespace Internal
|
||||
{
|
||||
// Attempt to add the file to source control if it is available
|
||||
bool TryAddFileToSourceControl(const QString& filename)
|
||||
{
|
||||
if (!CFileUtil::CheckoutFile(filename.toUtf8().data(), nullptr))
|
||||
{
|
||||
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_ERROR, "Failed to add file %s to the source control provider", filename.toUtf8().constData());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} // namespace Internal
|
||||
|
||||
CAlembicCompiler::CAlembicCompiler()
|
||||
{
|
||||
AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
CAlembicCompiler::~CAlembicCompiler()
|
||||
{
|
||||
AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
bool CAlembicCompiler::CompileAlembic(const QString& fullPath)
|
||||
{
|
||||
bool compileConfigFileSaved = false;
|
||||
const QString configPath = Path::ReplaceExtension(fullPath, "cbc");
|
||||
XmlNodeRef config = XmlHelpers::LoadXmlFromFile(configPath.toUtf8().data());
|
||||
|
||||
CAlembicCompileDialog dialog(config);
|
||||
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
bool configChanged = false;
|
||||
const QString upAxis = dialog.GetUpAxis();
|
||||
const QString playbackFromMemory = dialog.GetPlaybackFromMemory();
|
||||
const QString blockCompressionFormat = dialog.GetBlockCompressionFormat();
|
||||
const QString meshPrediction = dialog.GetMeshPrediction();
|
||||
const QString useBFrames = dialog.GetUseBFrames();
|
||||
const uint indexFrameDistance = dialog.GetIndexFrameDistance();
|
||||
const double positionPrecision = dialog.GetPositionPrecision();
|
||||
const float uvMax = dialog.GetUVmax();
|
||||
|
||||
if (!config)
|
||||
{
|
||||
CryLog("Build configuration file not found, writing new one");
|
||||
config = XmlHelpers::CreateXmlNode("CacheBuildConfiguration");
|
||||
configChanged = true;
|
||||
}
|
||||
|
||||
if (strcmp(config->getAttr("UpAxis"), upAxis.toUtf8().data()) != 0)
|
||||
{
|
||||
config->setAttr("UpAxis", upAxis.toUtf8().data());
|
||||
configChanged = true;
|
||||
}
|
||||
if (strcmp(config->getAttr("MeshPrediction"), meshPrediction.toUtf8().data()) != 0)
|
||||
{
|
||||
config->setAttr("MeshPrediction", meshPrediction.toUtf8().data());
|
||||
configChanged = true;
|
||||
}
|
||||
if (strcmp(config->getAttr("UseBFrames"), useBFrames.toUtf8().data()) != 0)
|
||||
{
|
||||
config->setAttr("UseBFrames", useBFrames.toUtf8().data());
|
||||
configChanged = true;
|
||||
}
|
||||
if (atoi(config->getAttr("IndexFrameDistance")) != indexFrameDistance)
|
||||
{
|
||||
config->setAttr("IndexFrameDistance", indexFrameDistance);
|
||||
configChanged = true;
|
||||
}
|
||||
if (strcmp(config->getAttr("BlockCompressionFormat"), blockCompressionFormat.toUtf8().data()) != 0)
|
||||
{
|
||||
config->setAttr("BlockCompressionFormat", blockCompressionFormat.toUtf8().data());
|
||||
configChanged = true;
|
||||
}
|
||||
if (strcmp(config->getAttr("PlaybackFromMemory"), playbackFromMemory.toUtf8().data()) != 0)
|
||||
{
|
||||
config->setAttr("PlaybackFromMemory", playbackFromMemory.toUtf8().data());
|
||||
configChanged = true;
|
||||
}
|
||||
if (atof(config->getAttr("PositionPrecision")) != positionPrecision)
|
||||
{
|
||||
config->setAttr("PositionPrecision", positionPrecision);
|
||||
configChanged = true;
|
||||
}
|
||||
if (atof(config->getAttr("UVmax")) != uvMax)
|
||||
{
|
||||
config->setAttr("UVmax", uvMax);
|
||||
configChanged = true;
|
||||
}
|
||||
|
||||
if (configChanged)
|
||||
{
|
||||
compileConfigFileSaved = XmlHelpers::SaveXmlNode(GetIEditor()->GetFileUtil(), config, configPath.toUtf8().data());
|
||||
if (compileConfigFileSaved)
|
||||
{
|
||||
// If we just created the file above, or the cbc file was not previously managed, attempt to add it to perforce now.
|
||||
// Note that XmlHelpers::SaveXmlNode will prompt the user to checkout or overwrite the file
|
||||
Internal::TryAddFileToSourceControl(configPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return compileConfigFileSaved;
|
||||
}
|
||||
|
||||
void CAlembicCompiler::AddSourceFileOpeners(const char* fullSourceFileName, [[maybe_unused]] const AZ::Uuid& sourceUUID, AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers)
|
||||
{
|
||||
using namespace AzToolsFramework;
|
||||
using namespace AzToolsFramework::AssetBrowser;
|
||||
|
||||
if (AZStd::wildcard_match("*.abc", fullSourceFileName))
|
||||
{
|
||||
auto alembicCallback = [this]([[maybe_unused]] const char* fullSourceFileNameInCall, const AZ::Uuid& sourceUUIDInCall)
|
||||
{
|
||||
const SourceAssetBrowserEntry* fullDetails = SourceAssetBrowserEntry::GetSourceByUuid(sourceUUIDInCall);
|
||||
if (fullDetails)
|
||||
{
|
||||
CompileAlembic(fullDetails->GetRelativePath().c_str());
|
||||
}
|
||||
};
|
||||
|
||||
openers.push_back({ "O3DE_AlembicCompiler", "Open In Alembic Compiler...", QIcon(), alembicCallback });
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserBus.h>
|
||||
|
||||
class CAlembicCompiler
|
||||
: public AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler
|
||||
{
|
||||
public:
|
||||
CAlembicCompiler();
|
||||
~CAlembicCompiler();
|
||||
|
||||
bool CompileAlembic(const QString& fullPath);
|
||||
|
||||
protected:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler
|
||||
void AddSourceFileOpeners(const char* fullSourceFileName, const AZ::Uuid& sourceUUID, AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) override;
|
||||
};
|
||||
@@ -57,7 +57,6 @@ AZ_POP_DISABLE_WARNING
|
||||
#include "GameEngine.h"
|
||||
#include "ToolBox.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Alembic/AlembicCompiler.h"
|
||||
#include "UIEnumsDatabase.h"
|
||||
#include "RenderHelpers/AxisHelper.h"
|
||||
#include "Settings.h"
|
||||
@@ -185,7 +184,6 @@ CEditorImpl::CEditorImpl()
|
||||
m_pIconManager = new CIconManager;
|
||||
m_pUndoManager = new CUndoManager;
|
||||
m_pToolBoxManager = new CToolBoxManager;
|
||||
m_pAlembicCompiler = new CAlembicCompiler();
|
||||
m_pSequenceManager = new CTrackViewSequenceManager;
|
||||
m_pAnimationContext = new CAnimationContext;
|
||||
|
||||
@@ -303,7 +301,6 @@ CEditorImpl::~CEditorImpl()
|
||||
m_bExiting = true; // Can't save level after this point (while Crash)
|
||||
SAFE_RELEASE(m_pSourceControl);
|
||||
|
||||
SAFE_DELETE(m_pAlembicCompiler)
|
||||
SAFE_DELETE(m_pIconManager)
|
||||
SAFE_DELETE(m_pViewManager)
|
||||
SAFE_DELETE(m_pObjectManager) // relies on prefab manager
|
||||
|
||||
@@ -48,7 +48,6 @@ class CEditorFileMonitor;
|
||||
class AzAssetWindow;
|
||||
class AzAssetBrowserRequestHandler;
|
||||
class AssetEditorRequestsHandler;
|
||||
class CAlembicCompiler;
|
||||
struct IEditorFileMonitor;
|
||||
class CVegetationMap;
|
||||
|
||||
@@ -356,7 +355,6 @@ protected:
|
||||
CAnimationContext* m_pAnimationContext;
|
||||
CTrackViewSequenceManager* m_pSequenceManager;
|
||||
CToolBoxManager* m_pToolBoxManager;
|
||||
CAlembicCompiler* m_pAlembicCompiler;
|
||||
CMusicManager* m_pMusicManager;
|
||||
CErrorReport* m_pErrorReport;
|
||||
//! Contains the error reports for the last loaded level.
|
||||
|
||||
@@ -33,8 +33,6 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
|
||||
#include <AzQtComponents/Components/Style.h>
|
||||
|
||||
#include "CryPhysicsDeprecation.h"
|
||||
|
||||
void BeautifyEulerAngles(Vec3& v)
|
||||
{
|
||||
if (v.x + v.y + v.z >= 360.0f)
|
||||
@@ -334,7 +332,6 @@ void CInfoBar::OnBnClickedPhysics()
|
||||
|
||||
void CInfoBar::OnBnClickedSingleStepPhys()
|
||||
{
|
||||
CRY_PHYSICS_REPLACEMENT_ASSERT();
|
||||
}
|
||||
|
||||
void CInfoBar::OnBnClickedDoStepPhys()
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#if defined(USE_GEOM_CACHES)
|
||||
#include "TrackViewGeomCacheAnimationTrack.h"
|
||||
|
||||
CTrackViewKeyHandle CTrackViewGeomCacheAnimationTrack::CreateKey(const float time)
|
||||
{
|
||||
return CTrackViewTrack::CreateKey(time);
|
||||
}
|
||||
#endif
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_TRACKVIEW_TRACKVIEWGEOMCACHEANIMATIONTRACK_H
|
||||
#define CRYINCLUDE_EDITOR_TRACKVIEW_TRACKVIEWGEOMCACHEANIMATIONTRACK_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#if defined(USE_GEOM_CACHES)
|
||||
#include "IMovieSystem.h"
|
||||
#include "TrackViewTrack.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// This class represents a time range track of a geom cache node in TrackView
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
class CTrackViewGeomCacheAnimationTrack
|
||||
: public CTrackViewTrack
|
||||
{
|
||||
public:
|
||||
CTrackViewGeomCacheAnimationTrack(IAnimTrack* pTrack, CTrackViewAnimNode* pTrackAnimNode,
|
||||
CTrackViewNode* pParentNode, bool bIsSubTrack = false, unsigned int subTrackIndex = 0)
|
||||
: CTrackViewTrack(pTrack, pTrackAnimNode, pParentNode, bIsSubTrack, subTrackIndex) {}
|
||||
|
||||
virtual CTrackViewKeyHandle CreateKey(const float time);
|
||||
};
|
||||
#endif
|
||||
#endif // CRYINCLUDE_EDITOR_TRACKVIEW_TRACKVIEWGEOMCACHEANIMATIONTRACK_H
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
// Editor
|
||||
#include "TrackViewEventNode.h"
|
||||
#include "TrackViewGeomCacheAnimationTrack.h"
|
||||
|
||||
|
||||
CTrackViewAnimNode* CTrackViewAnimNodeFactory::BuildAnimNode(IAnimSequence* pSequence, IAnimNode* pAnimNode, CTrackViewNode* pParentNode)
|
||||
@@ -43,12 +42,5 @@ CTrackViewAnimNode* CTrackViewAnimNodeFactory::BuildAnimNode(IAnimSequence* pSeq
|
||||
CTrackViewTrack* CTrackViewTrackFactory::BuildTrack(IAnimTrack* pTrack, CTrackViewAnimNode* pTrackAnimNode,
|
||||
CTrackViewNode* pParentNode, bool bIsSubTrack, unsigned int subTrackIndex)
|
||||
{
|
||||
#if defined(USE_GEOM_CACHES)
|
||||
if (pTrack->GetParameterType() == AnimParamType::TimeRanges && pTrackAnimNode->GetType() == AnimNodeType::GeomCache)
|
||||
{
|
||||
return new CTrackViewGeomCacheAnimationTrack(pTrack, pTrackAnimNode, pParentNode, bIsSubTrack, subTrackIndex);
|
||||
}
|
||||
#endif
|
||||
|
||||
return new CTrackViewTrack(pTrack, pTrackAnimNode, pParentNode, bIsSubTrack, subTrackIndex);
|
||||
}
|
||||
|
||||
@@ -307,11 +307,6 @@ set(FILES
|
||||
Util/AffineParts.cpp
|
||||
Objects/BaseObject.cpp
|
||||
Objects/BaseObject.h
|
||||
Alembic/AlembicCompileDialog.cpp
|
||||
Alembic/AlembicCompileDialog.h
|
||||
Alembic/AlembicCompileDialog.ui
|
||||
Alembic/AlembicCompiler.h
|
||||
Alembic/AlembicCompiler.cpp
|
||||
Animation/AnimationBipedBoneNames.cpp
|
||||
Animation/AnimationBipedBoneNames.h
|
||||
AnimationContext.cpp
|
||||
@@ -714,14 +709,12 @@ set(FILES
|
||||
TrackView/TrackViewNode.cpp
|
||||
TrackView/TrackViewSequence.cpp
|
||||
TrackView/TrackViewNodeFactories.cpp
|
||||
TrackView/TrackViewGeomCacheAnimationTrack.cpp
|
||||
TrackView/TrackViewEventNode.cpp
|
||||
TrackView/TrackViewAnimNode.h
|
||||
TrackView/TrackViewTrack.h
|
||||
TrackView/TrackViewNode.h
|
||||
TrackView/TrackViewSequence.h
|
||||
TrackView/TrackViewNodeFactories.h
|
||||
TrackView/TrackViewGeomCacheAnimationTrack.h
|
||||
TrackView/TrackViewEventNode.h
|
||||
ConfigGroup.cpp
|
||||
ConfigGroup.h
|
||||
|
||||
Reference in New Issue
Block a user