Merge branch 'development' into Atom/guthadam/multiple_dockable_pinned_material_component_property_editor
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/std/functional.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
//! Sets a variable upon construction and again when the object goes out of scope.
|
||||
template<typename T>
|
||||
class ScopedValue
|
||||
{
|
||||
private:
|
||||
T* m_ptr;
|
||||
T m_finalValue;
|
||||
|
||||
public:
|
||||
ScopedValue(T* ptr, T initialValue, T finalValue) :
|
||||
m_ptr(ptr), m_finalValue(finalValue)
|
||||
{
|
||||
AZ_Assert(m_ptr, "ScopedValue::m_ptr is null");
|
||||
*m_ptr = initialValue;
|
||||
}
|
||||
|
||||
~ScopedValue()
|
||||
{
|
||||
*m_ptr = m_finalValue;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace AZ
|
||||
@@ -19,4 +19,5 @@ set(FILES
|
||||
std/containers/vector_set.h
|
||||
std/containers/vector_set_base.h
|
||||
std/parallel/concurrency_checker.h
|
||||
Utils/ScopedValue.h
|
||||
)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AtomCore/Utils/ScopedValue.h>
|
||||
#include <AzCore/UnitTest/TestTypes.h>
|
||||
|
||||
namespace UnitTest
|
||||
{
|
||||
TEST(ScopedValueTest, TestBoolValue)
|
||||
{
|
||||
bool localValue = false;
|
||||
|
||||
{
|
||||
AZ::ScopedValue<bool> scopedValue(&localValue, true, false);
|
||||
EXPECT_EQ(true, localValue);
|
||||
}
|
||||
|
||||
EXPECT_EQ(false, localValue);
|
||||
}
|
||||
|
||||
TEST(ScopedValueTest, TestIntValue)
|
||||
{
|
||||
int localValue = 0;
|
||||
|
||||
{
|
||||
AZ::ScopedValue<int> scopedValue(&localValue, 1, 2);
|
||||
EXPECT_EQ(1, localValue);
|
||||
}
|
||||
|
||||
EXPECT_EQ(2, localValue);
|
||||
}
|
||||
}
|
||||
@@ -12,5 +12,6 @@ set(FILES
|
||||
InstanceDatabase.cpp
|
||||
lru_cache.cpp
|
||||
Main.cpp
|
||||
ScopedValueTest.cpp
|
||||
vector_set.cpp
|
||||
)
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <Atom/RPI.Public/ViewportContextBus.h>
|
||||
#include <Atom/RPI.Public/RPISystemInterface.h>
|
||||
#include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
|
||||
#include <Atom/RPI.Public/Shader/ShaderSystem.h>
|
||||
|
||||
#include <Atom/Bootstrap/DefaultWindowBus.h>
|
||||
#include <Atom/Bootstrap/BootstrapNotificationBus.h>
|
||||
@@ -303,6 +304,11 @@ namespace AZ
|
||||
RPI::RenderPipelineDescriptor renderPipelineDescriptor = *RPI::GetDataFromAnyAsset<RPI::RenderPipelineDescriptor>(pipelineAsset);
|
||||
renderPipelineDescriptor.m_name = AZStd::string::format("%s_%i", renderPipelineDescriptor.m_name.c_str(), viewportContext->GetId());
|
||||
|
||||
// Make sure non-msaa super variant is used for non-msaa pipeline
|
||||
bool isNonMsaaPipeline = (renderPipelineDescriptor.m_renderSettings.m_multisampleState.m_samples == 1);
|
||||
const char* supervariantName = isNonMsaaPipeline ? AZ::RPI::NoMsaaSupervariantName : "";
|
||||
AZ::RPI::ShaderSystemInterface::Get()->SetSupervariantName(AZ::Name(supervariantName));
|
||||
|
||||
if (!scene->GetRenderPipeline(AZ::Name(renderPipelineDescriptor.m_name)))
|
||||
{
|
||||
RPI::RenderPipelinePtr renderPipeline = RPI::RenderPipeline::CreateRenderPipelineForWindow(renderPipelineDescriptor, *viewportContext->GetWindowContext().get());
|
||||
|
||||
@@ -22,6 +22,7 @@ local FindMaterialAssignmentTest =
|
||||
"materials/presets/macbeth/12_orange_yellow_srgb.tif.streamingimage",
|
||||
"materials/presets/macbeth/17_magenta_srgb.tif.streamingimage"
|
||||
},
|
||||
MaterialSlotFilter = ""
|
||||
},
|
||||
}
|
||||
|
||||
@@ -50,18 +51,6 @@ function FindMaterialAssignmentTest:OnActivate()
|
||||
self.colors = {}
|
||||
self.lerpDirs = {}
|
||||
|
||||
self.assignmentIds =
|
||||
{
|
||||
MaterialComponentRequestBus.Event.FindMaterialAssignmentId(self.entityId, -1, "lambert"),
|
||||
}
|
||||
|
||||
for index = 1, #self.assignmentIds do
|
||||
local id = self.assignmentIds[index]
|
||||
if (id ~= nil) then
|
||||
self.colors[index] = randomColor()
|
||||
self.lerpDirs[index] = randomDir()
|
||||
end
|
||||
end
|
||||
self.tickBusHandler = TickBus.Connect(self);
|
||||
end
|
||||
|
||||
@@ -144,10 +133,33 @@ function FindMaterialAssignmentTest:lerpColors(deltaTime)
|
||||
end
|
||||
|
||||
function FindMaterialAssignmentTest:OnTick(deltaTime, timePoint)
|
||||
|
||||
|
||||
if(nil == self.assignmentIds) then
|
||||
|
||||
local originalAssignments = MaterialComponentRequestBus.Event.GetOriginalMaterialAssignments(self.entityId)
|
||||
if(nil == originalAssignments or #originalAssignments <= 1) then -- There is always 1 entry for the default assignment; a loaded model will have at least 2 assignments
|
||||
return
|
||||
end
|
||||
|
||||
self.assignmentIds =
|
||||
{
|
||||
MaterialComponentRequestBus.Event.FindMaterialAssignmentId(self.entityId, -1, self.Properties.MaterialSlotFilter),
|
||||
}
|
||||
|
||||
for index = 1, #self.assignmentIds do
|
||||
local id = self.assignmentIds[index]
|
||||
if (id ~= nil) then
|
||||
self.colors[index] = randomColor()
|
||||
self.lerpDirs[index] = randomDir()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self.timer = self.timer + deltaTime
|
||||
self.totalTime = self.totalTime + deltaTime
|
||||
self:lerpColors(deltaTime)
|
||||
|
||||
|
||||
if (self.timer > self.timeUpdate and self.totalTime < self.totalTimeMax) then
|
||||
self.timer = self.timer - self.timeUpdate
|
||||
self:UpdateProperties()
|
||||
@@ -155,6 +167,7 @@ function FindMaterialAssignmentTest:OnTick(deltaTime, timePoint)
|
||||
self:ClearProperties()
|
||||
self.tickBusHandler:Disconnect(self);
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return FindMaterialAssignmentTest
|
||||
return FindMaterialAssignmentTest
|
||||
|
||||
@@ -370,11 +370,27 @@ namespace AZ
|
||||
{
|
||||
// set draw list mask
|
||||
m_cullable.m_cullData.m_drawListMask.reset();
|
||||
m_cullable.m_cullData.m_drawListMask =
|
||||
m_stencilDrawPacket->GetDrawListMask() |
|
||||
m_blendWeightDrawPacket->GetDrawListMask() |
|
||||
m_renderOuterDrawPacket->GetDrawListMask() |
|
||||
m_renderInnerDrawPacket->GetDrawListMask();
|
||||
|
||||
// check for draw packets due certain render pipelines such as lowend render pipeline that might not have this feature enabled
|
||||
if (m_stencilDrawPacket)
|
||||
{
|
||||
m_cullable.m_cullData.m_drawListMask |= m_stencilDrawPacket->GetDrawListMask();
|
||||
}
|
||||
|
||||
if (m_blendWeightDrawPacket)
|
||||
{
|
||||
m_cullable.m_cullData.m_drawListMask |= m_blendWeightDrawPacket->GetDrawListMask();
|
||||
}
|
||||
|
||||
if (m_renderOuterDrawPacket)
|
||||
{
|
||||
m_cullable.m_cullData.m_drawListMask |= m_renderOuterDrawPacket->GetDrawListMask();
|
||||
}
|
||||
|
||||
if (m_renderInnerDrawPacket)
|
||||
{
|
||||
m_cullable.m_cullData.m_drawListMask |= m_renderInnerDrawPacket->GetDrawListMask();
|
||||
}
|
||||
|
||||
// setup the Lod entry, using one entry for all four draw packets
|
||||
m_cullable.m_lodData.m_lods.clear();
|
||||
|
||||
@@ -466,7 +466,7 @@ namespace AZ
|
||||
|
||||
bool DescriptorSet::IsNullDescriptorInfo(const VkDescriptorImageInfo& descriptorInfo)
|
||||
{
|
||||
return descriptorInfo.imageView == VK_NULL_HANDLE;
|
||||
return (descriptorInfo.imageView == VK_NULL_HANDLE && descriptorInfo.sampler == VK_NULL_HANDLE);
|
||||
}
|
||||
|
||||
bool DescriptorSet::IsNullDescriptorInfo(const VkBufferView& descriptorInfo)
|
||||
|
||||
@@ -74,6 +74,7 @@ namespace AZ
|
||||
MaterialPropertyIndex FindPropertyIndex(const Name& name) const;
|
||||
|
||||
//! Sets the value of a material property. The template data type must match the property's data type.
|
||||
//! @return true if property value was changed
|
||||
template<typename Type>
|
||||
bool SetPropertyValue(MaterialPropertyIndex index, const Type& value);
|
||||
|
||||
@@ -81,12 +82,15 @@ namespace AZ
|
||||
template<typename Type>
|
||||
const Type& GetPropertyValue(MaterialPropertyIndex index) const;
|
||||
|
||||
//! Gets flags indicating which properties have been modified.
|
||||
const MaterialPropertyFlags& GetPropertyDirtyFlags() const;
|
||||
|
||||
//! Sets the value of a material property. The @value data type must match the property's data type.
|
||||
//! @return true if property value was changed
|
||||
bool SetPropertyValue(MaterialPropertyIndex index, const MaterialPropertyValue& value);
|
||||
|
||||
const MaterialPropertyValue& GetPropertyValue(MaterialPropertyIndex index) const;
|
||||
const AZStd::vector<MaterialPropertyValue>& GetPropertyValues() const;
|
||||
|
||||
//! Gets flags indicating which properties have been modified.
|
||||
const MaterialPropertyFlags& GetPropertyDirtyFlags() const;
|
||||
|
||||
//! Gets the material properties layout.
|
||||
RHI::ConstPtr<MaterialPropertiesLayout> GetMaterialPropertiesLayout() const;
|
||||
@@ -111,6 +115,12 @@ namespace AZ
|
||||
//! @param return the number of shader options that were updated, or Failure if the material owns the indicated shader option.
|
||||
AZ::Outcome<uint32_t> SetSystemShaderOption(const Name& shaderOptionName, RPI::ShaderOptionValue value);
|
||||
|
||||
//! Override the material's default PSO handling setting.
|
||||
//! This is normally used in tools like Asset Processor or Material Editor to allow changes that impact
|
||||
//! Pipeline State Objects which is not allowed at runtime. See MaterialPropertyPsoHandling for more details.
|
||||
//! Do not set this in the shipping runtime unless you know what you are doing.
|
||||
void SetPsoHandlingOverride(MaterialPropertyPsoHandling psoHandlingOverride);
|
||||
|
||||
const RHI::ShaderResourceGroup* GetRHIShaderResourceGroup() const;
|
||||
|
||||
const Data::Asset<MaterialAsset>& GetAsset() const;
|
||||
@@ -189,6 +199,10 @@ namespace AZ
|
||||
|
||||
//! Records the m_currentChangeId when the material was last compiled.
|
||||
ChangeId m_compiledChangeId = DEFAULT_CHANGE_ID;
|
||||
|
||||
bool m_isInitializing = false;
|
||||
|
||||
MaterialPropertyPsoHandling m_psoHandling = MaterialPropertyPsoHandling::Warning;
|
||||
};
|
||||
|
||||
} // namespace RPI
|
||||
|
||||
@@ -83,14 +83,19 @@ namespace AZ
|
||||
AZ_TYPE_INFO(AZ::RPI::LuaMaterialFunctorCommonContext, "{2CCCB9A9-AD4F-447C-B587-E7A91CEA8088}");
|
||||
|
||||
explicit LuaMaterialFunctorCommonContext(MaterialFunctor::RuntimeContext* runtimeContextImpl,
|
||||
const MaterialPropertyFlags* materialPropertyDependencies,
|
||||
const AZStd::string& propertyNamePrefix,
|
||||
const AZStd::string& srgNamePrefix,
|
||||
const AZStd::string& optionsNamePrefix);
|
||||
|
||||
explicit LuaMaterialFunctorCommonContext(MaterialFunctor::EditorContext* editorContextImpl,
|
||||
const MaterialPropertyFlags* materialPropertyDependencies,
|
||||
const AZStd::string& propertyNamePrefix,
|
||||
const AZStd::string& srgNamePrefix,
|
||||
const AZStd::string& optionsNamePrefix);
|
||||
|
||||
//! Returns false if PSO changes are not allowed, and may report errors or warnings
|
||||
bool CheckPsoChangesAllowed();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -100,6 +105,12 @@ namespace AZ
|
||||
MaterialPropertyIndex GetMaterialPropertyIndex(const char* name, const char* functionName) const;
|
||||
|
||||
const MaterialPropertyValue& GetMaterialPropertyValue(MaterialPropertyIndex propertyIndex) const;
|
||||
|
||||
MaterialPropertyPsoHandling GetMaterialPropertyPsoHandling() const;
|
||||
|
||||
RHI::ConstPtr<MaterialPropertiesLayout> GetMaterialPropertiesLayout() const;
|
||||
|
||||
AZStd::string GetMaterialPropertyDependenciesString() const;
|
||||
|
||||
// These are prefix strings that will be applied to every name lookup in the lua functor.
|
||||
// This allows the lua script to be reused in different contexts.
|
||||
@@ -112,6 +123,8 @@ namespace AZ
|
||||
// Only one of these will be valid
|
||||
MaterialFunctor::RuntimeContext* m_runtimeContextImpl = nullptr;
|
||||
MaterialFunctor::EditorContext* m_editorContextImpl = nullptr;
|
||||
const MaterialPropertyFlags* m_materialPropertyDependencies = nullptr;
|
||||
bool m_psoChangesReported = false; //!< errors/warnings about PSO changes will only be reported once per execution of the functor
|
||||
};
|
||||
|
||||
//! Wraps RHI::RenderStates for LuaMaterialFunctor access
|
||||
@@ -241,7 +254,11 @@ namespace AZ
|
||||
|
||||
static void Reflect(BehaviorContext* behaviorContext);
|
||||
|
||||
explicit LuaMaterialFunctorShaderItem(ShaderCollection::Item* shaderItem) : m_shaderItem(shaderItem) {}
|
||||
LuaMaterialFunctorShaderItem() :
|
||||
m_context(nullptr), m_shaderItem(nullptr) {}
|
||||
|
||||
explicit LuaMaterialFunctorShaderItem(LuaMaterialFunctorCommonContext* context, ShaderCollection::Item* shaderItem) :
|
||||
m_context(context), m_shaderItem(shaderItem) {}
|
||||
|
||||
LuaMaterialFunctorRenderStates GetRenderStatesOverride();
|
||||
void SetEnabled(bool enable);
|
||||
@@ -253,6 +270,7 @@ namespace AZ
|
||||
private:
|
||||
void SetShaderOptionValue(const Name& name, AZStd::function<bool(ShaderOptionGroup*, ShaderOptionIndex)> setValueCommand);
|
||||
|
||||
LuaMaterialFunctorCommonContext* m_context = nullptr;
|
||||
ShaderCollection::Item* m_shaderItem = nullptr;
|
||||
};
|
||||
|
||||
@@ -265,6 +283,7 @@ namespace AZ
|
||||
static void Reflect(BehaviorContext* behaviorContext);
|
||||
|
||||
explicit LuaMaterialFunctorRuntimeContext(MaterialFunctor::RuntimeContext* runtimeContextImpl,
|
||||
const MaterialPropertyFlags* materialPropertyDependencies,
|
||||
const AZStd::string& propertyNamePrefix,
|
||||
const AZStd::string& srgNamePrefix,
|
||||
const AZStd::string& optionsNamePrefix);
|
||||
@@ -304,6 +323,7 @@ namespace AZ
|
||||
static void Reflect(BehaviorContext* behaviorContext);
|
||||
|
||||
explicit LuaMaterialFunctorEditorContext(MaterialFunctor::EditorContext* editorContextImpl,
|
||||
const MaterialPropertyFlags* materialPropertyDependencies,
|
||||
const AZStd::string& propertyNamePrefix,
|
||||
const AZStd::string& srgNamePrefix,
|
||||
const AZStd::string& optionsNamePrefix);
|
||||
|
||||
@@ -28,6 +28,24 @@ namespace AZ
|
||||
class MaterialPropertiesLayout;
|
||||
|
||||
using MaterialPropertyFlags = AZStd::bitset<Limits::Material::PropertyCountMax>;
|
||||
|
||||
//! Indicates how the material system should respond to any material property changes that
|
||||
//! impact Pipeline State Object configuration. This is significant because some platforms
|
||||
//! require that PSOs be pre-compiled and shipped with the game.
|
||||
enum class MaterialPropertyPsoHandling
|
||||
{
|
||||
//! PSO-impacting property changes are not allowed, are ignored, and will report an error.
|
||||
//! This should be used at runtime. It is recommended to do this on all platforms, not just the restricted ones,
|
||||
//! to encourage best-practices. However, if a game project is not shipping on any restricted platforms,
|
||||
//! then the team could decide to allow PSO changes.
|
||||
Error,
|
||||
|
||||
//! PSO-impacting property changes are allowed, but produce a warning message.
|
||||
Warning,
|
||||
|
||||
//! PSO-impacting property changes are allowed. This can be used during asset processing, in developer tools, or on platforms that don't restrict PSO changes.
|
||||
Allowed
|
||||
};
|
||||
|
||||
//! MaterialFunctor objects provide custom logic and calculations to configure shaders, render states,
|
||||
//! editor metadata, and more.
|
||||
@@ -81,6 +99,8 @@ namespace AZ
|
||||
const MaterialPropertyValue& GetMaterialPropertyValue(const MaterialPropertyIndex& index) const;
|
||||
|
||||
const MaterialPropertiesLayout* GetMaterialPropertiesLayout() const { return m_materialPropertiesLayout.get(); }
|
||||
|
||||
MaterialPropertyPsoHandling GetMaterialPropertyPsoHandling() const { return m_psoHandling; }
|
||||
|
||||
//! Set the value of a shader option
|
||||
//! @param shaderIndex the index of a shader in the material's ShaderCollection
|
||||
@@ -126,16 +146,18 @@ namespace AZ
|
||||
RHI::ConstPtr<MaterialPropertiesLayout> materialPropertiesLayout,
|
||||
ShaderCollection* shaderCollection,
|
||||
ShaderResourceGroup* shaderResourceGroup,
|
||||
const MaterialPropertyFlags* materialPropertyDependencies
|
||||
const MaterialPropertyFlags* materialPropertyDependencies,
|
||||
MaterialPropertyPsoHandling psoHandling
|
||||
);
|
||||
private:
|
||||
bool SetShaderOptionValue(ShaderCollection::Item& shaderItem, ShaderOptionIndex optionIndex, ShaderOptionValue value);
|
||||
|
||||
const AZStd::vector<MaterialPropertyValue>& m_materialPropertyValues;
|
||||
RHI::ConstPtr<MaterialPropertiesLayout> m_materialPropertiesLayout;
|
||||
ShaderCollection* m_shaderCollection;
|
||||
ShaderResourceGroup* m_shaderResourceGroup;
|
||||
ShaderCollection* m_shaderCollection;
|
||||
ShaderResourceGroup* m_shaderResourceGroup;
|
||||
const MaterialPropertyFlags* m_materialPropertyDependencies = nullptr;
|
||||
MaterialPropertyPsoHandling m_psoHandling = MaterialPropertyPsoHandling::Error;
|
||||
};
|
||||
|
||||
class EditorContext
|
||||
@@ -144,7 +166,7 @@ namespace AZ
|
||||
public:
|
||||
const MaterialPropertyDynamicMetadata* GetMaterialPropertyMetadata(const Name& propertyName) const;
|
||||
const MaterialPropertyDynamicMetadata* GetMaterialPropertyMetadata(const MaterialPropertyIndex& index) const;
|
||||
|
||||
|
||||
const MaterialPropertyGroupDynamicMetadata* GetMaterialPropertyGroupMetadata(const Name& propertyName) const;
|
||||
|
||||
//! Get the property value. The type must be one of those in MaterialPropertyValue.
|
||||
@@ -158,6 +180,8 @@ namespace AZ
|
||||
const MaterialPropertyValue& GetMaterialPropertyValue(const MaterialPropertyIndex& index) const;
|
||||
|
||||
const MaterialPropertiesLayout* GetMaterialPropertiesLayout() const { return m_materialPropertiesLayout.get(); }
|
||||
|
||||
MaterialPropertyPsoHandling GetMaterialPropertyPsoHandling() const { return MaterialPropertyPsoHandling::Allowed; }
|
||||
|
||||
//! Set the visibility dynamic metadata of a material property.
|
||||
bool SetMaterialPropertyVisibility(const Name& propertyName, MaterialPropertyVisibility visibility);
|
||||
@@ -177,7 +201,7 @@ namespace AZ
|
||||
|
||||
bool SetMaterialPropertySoftMaxValue(const Name& propertyName, const MaterialPropertyValue& max);
|
||||
bool SetMaterialPropertySoftMaxValue(const MaterialPropertyIndex& index, const MaterialPropertyValue& max);
|
||||
|
||||
|
||||
bool SetMaterialPropertyGroupVisibility(const Name& propertyGroupName, MaterialPropertyGroupVisibility visibility);
|
||||
|
||||
// [GFX TODO][ATOM-4168] Replace the workaround for unlink-able RPI.Public classes in MaterialFunctor
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <AzCore/Debug/EventTrace.h>
|
||||
#include <AtomCore/Instance/InstanceDatabase.h>
|
||||
#include <AtomCore/Utils/ScopedValue.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -58,6 +59,8 @@ namespace AZ
|
||||
{
|
||||
AZ_TRACE_METHOD();
|
||||
|
||||
ScopedValue isInitializing(&m_isInitializing, true, false);
|
||||
|
||||
m_materialAsset = { &materialAsset, AZ::Data::AssetLoadBehavior::PreLoad };
|
||||
|
||||
// Cache off pointers to some key data structures from the material type...
|
||||
@@ -198,6 +201,11 @@ namespace AZ
|
||||
return AZ::Success(appliedCount);
|
||||
}
|
||||
|
||||
void Material::SetPsoHandlingOverride(MaterialPropertyPsoHandling psoHandlingOverride)
|
||||
{
|
||||
m_psoHandling = psoHandlingOverride;
|
||||
}
|
||||
|
||||
const RHI::ShaderResourceGroup* Material::GetRHIShaderResourceGroup() const
|
||||
{
|
||||
return m_rhiShaderResourceGroup;
|
||||
@@ -310,6 +318,16 @@ namespace AZ
|
||||
|
||||
if (NeedsCompile() && CanCompile())
|
||||
{
|
||||
// On some platforms, PipelineStateObjects must be pre-compiled and shipped with the game; they cannot be compiled at runtime. So at some
|
||||
// point the material system needs to be smart about when it allows PSO changes and when it doesn't. There is a task scheduled to
|
||||
// thoroughly address this in 2022, but for now we just report a warning to alert users who are using the engine in a way that might
|
||||
// not be supported for much longer. PSO changes should only be allowed in developer tools (though we could also expose a way for users to
|
||||
// enable dynamic PSO changes if their project only targets platforms that support this).
|
||||
// PSO modifications are allowed during initialization because that's using the stored asset data, which the asset system can
|
||||
// access to pre-compile the necessary PSOs.
|
||||
MaterialPropertyPsoHandling psoHandling = m_isInitializing ? MaterialPropertyPsoHandling::Allowed : m_psoHandling;
|
||||
|
||||
|
||||
AZ_PROFILE_BEGIN(RPI, "Material::Compile() Processing Functors");
|
||||
for (const Ptr<MaterialFunctor>& functor : m_materialAsset->GetMaterialFunctors())
|
||||
{
|
||||
@@ -325,7 +343,8 @@ namespace AZ
|
||||
m_layout,
|
||||
&m_shaderCollection,
|
||||
m_shaderResourceGroup.get(),
|
||||
&materialPropertyDependencies
|
||||
&materialPropertyDependencies,
|
||||
psoHandling
|
||||
);
|
||||
|
||||
|
||||
@@ -484,6 +503,13 @@ namespace AZ
|
||||
}
|
||||
|
||||
MaterialPropertyValue& savedPropertyValue = m_propertyValues[index.GetIndex()];
|
||||
|
||||
// If the property value didn't actually change, don't waste time running functors and compiling the changes
|
||||
if (savedPropertyValue == value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
savedPropertyValue = value;
|
||||
m_propertyDirtyFlags.set(index.GetIndex());
|
||||
m_propertyOverrideFlags.set(index.GetIndex());
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace AZ
|
||||
|
||||
if (m_scriptStatus == ScriptStatus::Ready)
|
||||
{
|
||||
LuaMaterialFunctorRuntimeContext luaContext{&context, m_propertyNamePrefix, m_srgNamePrefix, m_optionsNamePrefix};
|
||||
LuaMaterialFunctorRuntimeContext luaContext{&context, &GetMaterialPropertyDependencies(), m_propertyNamePrefix, m_srgNamePrefix, m_optionsNamePrefix};
|
||||
AZ::ScriptDataContext call;
|
||||
if (m_scriptContext->Call("Process", call))
|
||||
{
|
||||
@@ -146,7 +146,7 @@ namespace AZ
|
||||
|
||||
if (m_scriptStatus == ScriptStatus::Ready)
|
||||
{
|
||||
LuaMaterialFunctorEditorContext luaContext{&context, m_propertyNamePrefix, m_srgNamePrefix, m_optionsNamePrefix};
|
||||
LuaMaterialFunctorEditorContext luaContext{&context, &GetMaterialPropertyDependencies(), m_propertyNamePrefix, m_srgNamePrefix, m_optionsNamePrefix};
|
||||
AZ::ScriptDataContext call;
|
||||
if (m_scriptContext->Call("ProcessEditor", call))
|
||||
{
|
||||
@@ -157,10 +157,12 @@ namespace AZ
|
||||
}
|
||||
|
||||
LuaMaterialFunctorCommonContext::LuaMaterialFunctorCommonContext(MaterialFunctor::RuntimeContext* runtimeContextImpl,
|
||||
const MaterialPropertyFlags* materialPropertyDependencies,
|
||||
const AZStd::string& propertyNamePrefix,
|
||||
const AZStd::string& srgNamePrefix,
|
||||
const AZStd::string& optionsNamePrefix)
|
||||
: m_runtimeContextImpl(runtimeContextImpl)
|
||||
, m_materialPropertyDependencies(materialPropertyDependencies)
|
||||
, m_propertyNamePrefix(propertyNamePrefix)
|
||||
, m_srgNamePrefix(srgNamePrefix)
|
||||
, m_optionsNamePrefix(optionsNamePrefix)
|
||||
@@ -168,34 +170,96 @@ namespace AZ
|
||||
}
|
||||
|
||||
LuaMaterialFunctorCommonContext::LuaMaterialFunctorCommonContext(MaterialFunctor::EditorContext* editorContextImpl,
|
||||
const MaterialPropertyFlags* materialPropertyDependencies,
|
||||
const AZStd::string& propertyNamePrefix,
|
||||
const AZStd::string& srgNamePrefix,
|
||||
const AZStd::string& optionsNamePrefix)
|
||||
: m_editorContextImpl(editorContextImpl)
|
||||
, m_materialPropertyDependencies(materialPropertyDependencies)
|
||||
, m_propertyNamePrefix(propertyNamePrefix)
|
||||
, m_srgNamePrefix(srgNamePrefix)
|
||||
, m_optionsNamePrefix(optionsNamePrefix)
|
||||
{
|
||||
}
|
||||
|
||||
MaterialPropertyPsoHandling LuaMaterialFunctorCommonContext::GetMaterialPropertyPsoHandling() const
|
||||
{
|
||||
if (m_runtimeContextImpl)
|
||||
{
|
||||
return m_runtimeContextImpl->GetMaterialPropertyPsoHandling();
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_editorContextImpl->GetMaterialPropertyPsoHandling();
|
||||
}
|
||||
}
|
||||
|
||||
RHI::ConstPtr<MaterialPropertiesLayout> LuaMaterialFunctorCommonContext::GetMaterialPropertiesLayout() const
|
||||
{
|
||||
if (m_runtimeContextImpl)
|
||||
{
|
||||
return m_runtimeContextImpl->GetMaterialPropertiesLayout();
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_editorContextImpl->GetMaterialPropertiesLayout();
|
||||
}
|
||||
}
|
||||
|
||||
AZStd::string LuaMaterialFunctorCommonContext::GetMaterialPropertyDependenciesString() const
|
||||
{
|
||||
AZStd::vector<AZStd::string> propertyList;
|
||||
for (size_t i = 0; i < m_materialPropertyDependencies->size(); ++i)
|
||||
{
|
||||
if ((*m_materialPropertyDependencies)[i])
|
||||
{
|
||||
propertyList.push_back(GetMaterialPropertiesLayout()->GetPropertyDescriptor(MaterialPropertyIndex{i})->GetName().GetStringView());
|
||||
}
|
||||
}
|
||||
|
||||
AZStd::string propertyListString;
|
||||
AzFramework::StringFunc::Join(propertyListString, propertyList.begin(), propertyList.end(), ", ");
|
||||
|
||||
return propertyListString;
|
||||
}
|
||||
|
||||
bool LuaMaterialFunctorCommonContext::CheckPsoChangesAllowed()
|
||||
{
|
||||
if (GetMaterialPropertyPsoHandling() == MaterialPropertyPsoHandling::Error)
|
||||
{
|
||||
if (!m_psoChangesReported)
|
||||
{
|
||||
LuaMaterialFunctorUtilities::Script_Error(
|
||||
AZStd::string::format(
|
||||
"The following material properties must not be changed at runtime because they impact Pipeline State Objects: %s", GetMaterialPropertyDependenciesString().c_str()));
|
||||
|
||||
m_psoChangesReported = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
else if (GetMaterialPropertyPsoHandling() == MaterialPropertyPsoHandling::Warning)
|
||||
{
|
||||
if (!m_psoChangesReported)
|
||||
{
|
||||
LuaMaterialFunctorUtilities::Script_Warning(
|
||||
AZStd::string::format(
|
||||
"The following material properties should not be changed at runtime because they impact Pipeline State Objects: %s", GetMaterialPropertyDependenciesString().c_str()));
|
||||
|
||||
m_psoChangesReported = true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
MaterialPropertyIndex LuaMaterialFunctorCommonContext::GetMaterialPropertyIndex(const char* name, const char* functionName) const
|
||||
{
|
||||
MaterialPropertyIndex propertyIndex;
|
||||
|
||||
Name propertyFullName{m_propertyNamePrefix + name};
|
||||
|
||||
if (m_runtimeContextImpl)
|
||||
{
|
||||
propertyIndex = m_runtimeContextImpl->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyFullName);
|
||||
}
|
||||
else if (m_editorContextImpl)
|
||||
{
|
||||
propertyIndex = m_editorContextImpl->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyFullName);
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Assert(false, "Context not initialized properly");
|
||||
}
|
||||
|
||||
propertyIndex = GetMaterialPropertiesLayout()->FindPropertyIndex(propertyFullName);
|
||||
|
||||
if (!propertyIndex.IsValid())
|
||||
{
|
||||
@@ -297,10 +361,11 @@ namespace AZ
|
||||
}
|
||||
|
||||
LuaMaterialFunctorRuntimeContext::LuaMaterialFunctorRuntimeContext(MaterialFunctor::RuntimeContext* runtimeContextImpl,
|
||||
const MaterialPropertyFlags* materialPropertyDependencies,
|
||||
const AZStd::string& propertyNamePrefix,
|
||||
const AZStd::string& srgNamePrefix,
|
||||
const AZStd::string& optionsNamePrefix)
|
||||
: LuaMaterialFunctorCommonContext(runtimeContextImpl, propertyNamePrefix, srgNamePrefix, optionsNamePrefix)
|
||||
: LuaMaterialFunctorCommonContext(runtimeContextImpl, materialPropertyDependencies, propertyNamePrefix, srgNamePrefix, optionsNamePrefix)
|
||||
, m_runtimeContextImpl(runtimeContextImpl)
|
||||
{
|
||||
}
|
||||
@@ -331,7 +396,7 @@ namespace AZ
|
||||
|
||||
if (!shaderItem.MaterialOwnsShaderOption(optionIndex))
|
||||
{
|
||||
LuaMaterialFunctorUtilities::Script_Error(AZStd::string::format("Shader option '%s' is not owned by this material.", fullOptionName.GetCStr()).c_str());
|
||||
LuaMaterialFunctorUtilities::Script_Error(AZStd::string::format("Shader option '%s' is not owned by this material.", fullOptionName.GetCStr()));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -398,12 +463,12 @@ namespace AZ
|
||||
{
|
||||
if (index < GetShaderCount())
|
||||
{
|
||||
return LuaMaterialFunctorShaderItem{&(*m_runtimeContextImpl->m_shaderCollection)[index]};
|
||||
return LuaMaterialFunctorShaderItem{this, &(*m_runtimeContextImpl->m_shaderCollection)[index]};
|
||||
}
|
||||
else
|
||||
{
|
||||
LuaMaterialFunctorUtilities::Script_Error(AZStd::string::format("GetShader(%zu) is invalid.", index));
|
||||
return LuaMaterialFunctorShaderItem{nullptr};
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,13 +477,13 @@ namespace AZ
|
||||
const AZ::Name tag{shaderTag};
|
||||
if (m_runtimeContextImpl->m_shaderCollection->HasShaderTag(tag))
|
||||
{
|
||||
return LuaMaterialFunctorShaderItem{&(*m_runtimeContextImpl->m_shaderCollection)[tag]};
|
||||
return LuaMaterialFunctorShaderItem{this, &(*m_runtimeContextImpl->m_shaderCollection)[tag]};
|
||||
}
|
||||
else
|
||||
{
|
||||
LuaMaterialFunctorUtilities::Script_Error(AZStd::string::format(
|
||||
"GetShaderByTag('%s') is invalid: Could not find a shader with the tag '%s'.", tag.GetCStr(), tag.GetCStr()));
|
||||
return LuaMaterialFunctorShaderItem{nullptr};
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,10 +524,11 @@ namespace AZ
|
||||
}
|
||||
|
||||
LuaMaterialFunctorEditorContext::LuaMaterialFunctorEditorContext(MaterialFunctor::EditorContext* editorContextImpl,
|
||||
const MaterialPropertyFlags* materialPropertyDependencies,
|
||||
const AZStd::string& propertyNamePrefix,
|
||||
const AZStd::string& srgNamePrefix,
|
||||
const AZStd::string& optionsNamePrefix)
|
||||
: LuaMaterialFunctorCommonContext(editorContextImpl, propertyNamePrefix, srgNamePrefix, optionsNamePrefix)
|
||||
: LuaMaterialFunctorCommonContext(editorContextImpl, materialPropertyDependencies, propertyNamePrefix, srgNamePrefix, optionsNamePrefix)
|
||||
, m_editorContextImpl(editorContextImpl)
|
||||
{
|
||||
}
|
||||
@@ -595,7 +661,7 @@ namespace AZ
|
||||
|
||||
LuaMaterialFunctorRenderStates LuaMaterialFunctorShaderItem::GetRenderStatesOverride()
|
||||
{
|
||||
if (m_shaderItem)
|
||||
if (m_context->CheckPsoChangesAllowed() && m_shaderItem)
|
||||
{
|
||||
return LuaMaterialFunctorRenderStates{m_shaderItem->GetRenderStatesOverlay()};
|
||||
}
|
||||
@@ -638,8 +704,7 @@ namespace AZ
|
||||
{
|
||||
LuaMaterialFunctorUtilities::Script_Error(
|
||||
AZStd::string::format(
|
||||
"Shader option '%s' is not owned by the shader '%s'.", name.GetCStr(), m_shaderItem->GetShaderTag().GetCStr())
|
||||
.c_str());
|
||||
"Shader option '%s' is not owned by the shader '%s'.", name.GetCStr(), m_shaderItem->GetShaderTag().GetCStr()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,13 +35,15 @@ namespace AZ
|
||||
RHI::ConstPtr<MaterialPropertiesLayout> materialPropertiesLayout,
|
||||
ShaderCollection* shaderCollection,
|
||||
ShaderResourceGroup* shaderResourceGroup,
|
||||
const MaterialPropertyFlags* materialPropertyDependencies
|
||||
const MaterialPropertyFlags* materialPropertyDependencies,
|
||||
MaterialPropertyPsoHandling psoHandling
|
||||
)
|
||||
: m_materialPropertyValues(propertyValues)
|
||||
, m_materialPropertiesLayout(materialPropertiesLayout)
|
||||
, m_shaderCollection(shaderCollection)
|
||||
, m_shaderResourceGroup(shaderResourceGroup)
|
||||
, m_materialPropertyDependencies(materialPropertyDependencies)
|
||||
, m_psoHandling(psoHandling)
|
||||
{}
|
||||
|
||||
bool MaterialFunctor::RuntimeContext::SetShaderOptionValue(ShaderCollection::Item& shaderItem, ShaderOptionIndex optionIndex, ShaderOptionValue value)
|
||||
|
||||
@@ -1039,6 +1039,42 @@ namespace UnitTest
|
||||
|
||||
drawListTagRegistry->ReleaseTag(tag);
|
||||
}
|
||||
|
||||
TEST_F(LuaMaterialFunctorTests, LuaMaterialFunctor_RuntimeContext_PsoChangesNotAllowed_Error)
|
||||
{
|
||||
using namespace AZ::RPI;
|
||||
|
||||
const char* functorScript =
|
||||
R"(
|
||||
function GetMaterialPropertyDependencies()
|
||||
return {"general.MyBool"}
|
||||
end
|
||||
|
||||
function GetShaderOptionDependencies()
|
||||
return {}
|
||||
end
|
||||
|
||||
function Process(context)
|
||||
local boolValue = context:GetMaterialPropertyValue_bool("general.MyBool")
|
||||
if(boolValue) then
|
||||
context:GetShader(0):GetRenderStatesOverride():SetFillMode(FillMode_Wireframe)
|
||||
else
|
||||
context:GetShader(0):GetRenderStatesOverride():ClearFillMode()
|
||||
end
|
||||
end
|
||||
)";
|
||||
|
||||
TestMaterialData testData;
|
||||
testData.Setup(MaterialPropertyDataType::Bool, "general.MyBool", functorScript);
|
||||
|
||||
testData.GetMaterial()->SetPropertyValue(testData.GetMaterialPropertyIndex(), MaterialPropertyValue{true});
|
||||
|
||||
ErrorMessageFinder errorMessageFinder;
|
||||
|
||||
errorMessageFinder.AddExpectedErrorMessage("not be changed at runtime because they impact Pipeline State Objects: general.MyBool");
|
||||
EXPECT_TRUE(testData.GetMaterial()->Compile());
|
||||
errorMessageFinder.CheckExpectedErrorsFound();
|
||||
}
|
||||
|
||||
TEST_F(LuaMaterialFunctorTests, LuaMaterialFunctor_RuntimeContext_MultisampleCustomPositionCountIndex_Error)
|
||||
{
|
||||
@@ -1067,6 +1103,7 @@ namespace UnitTest
|
||||
TestMaterialData testData;
|
||||
testData.Setup(MaterialPropertyDataType::Bool, "general.MyBool", functorScript);
|
||||
|
||||
testData.GetMaterial()->SetPsoHandlingOverride(AZ::RPI::MaterialPropertyPsoHandling::Allowed);
|
||||
testData.GetMaterial()->SetPropertyValue(testData.GetMaterialPropertyIndex(), MaterialPropertyValue{true});
|
||||
|
||||
ErrorMessageFinder errorMessageFinder;
|
||||
@@ -1107,7 +1144,8 @@ namespace UnitTest
|
||||
errorMessageFinder.AddExpectedErrorMessage("ClearMultisampleCustomPosition(18,...) index is out of range. Must be less than 16.");
|
||||
testData.Setup(MaterialPropertyDataType::Bool, "general.MyBool", functorScript);
|
||||
errorMessageFinder.CheckExpectedErrorsFound();
|
||||
|
||||
|
||||
testData.GetMaterial()->SetPsoHandlingOverride(AZ::RPI::MaterialPropertyPsoHandling::Allowed);
|
||||
testData.GetMaterial()->SetPropertyValue(testData.GetMaterialPropertyIndex(), MaterialPropertyValue{true});
|
||||
|
||||
errorMessageFinder.AddExpectedErrorMessage("SetMultisampleCustomPosition(17,...) index is out of range. Must be less than 16.");
|
||||
@@ -1146,7 +1184,8 @@ namespace UnitTest
|
||||
errorMessageFinder.AddExpectedErrorMessage("ClearBlendEnabled(10,...) index is out of range. Must be less than 8.");
|
||||
testData.Setup(MaterialPropertyDataType::Bool, "general.MyBool", functorScript);
|
||||
errorMessageFinder.CheckExpectedErrorsFound();
|
||||
|
||||
|
||||
testData.GetMaterial()->SetPsoHandlingOverride(AZ::RPI::MaterialPropertyPsoHandling::Allowed);
|
||||
testData.GetMaterial()->SetPropertyValue(testData.GetMaterialPropertyIndex(), MaterialPropertyValue{true});
|
||||
|
||||
errorMessageFinder.AddExpectedErrorMessage("SetBlendEnabled(9,...) index is out of range. Must be less than 8.");
|
||||
|
||||
@@ -168,7 +168,8 @@ namespace UnitTest
|
||||
materialTypeAsset->GetMaterialPropertiesLayout(),
|
||||
&shaderCollectionCopy,
|
||||
unusedSrg,
|
||||
&testFunctorSetOptionA.GetMaterialPropertyDependencies()
|
||||
&testFunctorSetOptionA.GetMaterialPropertyDependencies(),
|
||||
AZ::RPI::MaterialPropertyPsoHandling::Allowed
|
||||
};
|
||||
testFunctorSetOptionA.Process(runtimeContext);
|
||||
EXPECT_TRUE(testFunctorSetOptionA.GetProcessResult());
|
||||
@@ -184,7 +185,8 @@ namespace UnitTest
|
||||
materialTypeAsset->GetMaterialPropertiesLayout(),
|
||||
&shaderCollectionCopy,
|
||||
unusedSrg,
|
||||
&testFunctorSetOptionB.GetMaterialPropertyDependencies()
|
||||
&testFunctorSetOptionB.GetMaterialPropertyDependencies(),
|
||||
AZ::RPI::MaterialPropertyPsoHandling::Allowed
|
||||
};
|
||||
testFunctorSetOptionB.Process(runtimeContext);
|
||||
EXPECT_TRUE(testFunctorSetOptionB.GetProcessResult());
|
||||
@@ -201,7 +203,8 @@ namespace UnitTest
|
||||
materialTypeAsset->GetMaterialPropertiesLayout(),
|
||||
&shaderCollectionCopy,
|
||||
unusedSrg,
|
||||
&testFunctorSetOptionC.GetMaterialPropertyDependencies()
|
||||
&testFunctorSetOptionC.GetMaterialPropertyDependencies(),
|
||||
AZ::RPI::MaterialPropertyPsoHandling::Allowed
|
||||
};
|
||||
testFunctorSetOptionC.Process(runtimeContext);
|
||||
EXPECT_FALSE(testFunctorSetOptionC.GetProcessResult());
|
||||
@@ -216,7 +219,8 @@ namespace UnitTest
|
||||
materialTypeAsset->GetMaterialPropertiesLayout(),
|
||||
&shaderCollectionCopy,
|
||||
unusedSrg,
|
||||
&testFunctorSetOptionInvalid.GetMaterialPropertyDependencies()
|
||||
&testFunctorSetOptionInvalid.GetMaterialPropertyDependencies(),
|
||||
AZ::RPI::MaterialPropertyPsoHandling::Allowed
|
||||
};
|
||||
testFunctorSetOptionInvalid.Process(runtimeContext);
|
||||
EXPECT_FALSE(testFunctorSetOptionInvalid.GetProcessResult());
|
||||
|
||||
@@ -763,6 +763,10 @@ namespace MaterialEditor
|
||||
return false;
|
||||
}
|
||||
|
||||
// Pipeline State Object changes are always allowed in the material editor because it only runs on developer systems
|
||||
// where such changes are supported at runtime.
|
||||
m_materialInstance->SetPsoHandlingOverride(AZ::RPI::MaterialPropertyPsoHandling::Allowed);
|
||||
|
||||
// Populate the property map from a combination of source data and assets
|
||||
// Assets must still be used for now because they contain the final accumulated value after all other materials
|
||||
// in the hierarchy are applied
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
_savebackup/
|
||||
.mayaSwatches/
|
||||
*.swatches
|
||||
[Bb]uild/
|
||||
[Cc]ache/
|
||||
[Uu]ser/
|
||||
[Uu]ser_Env.bat
|
||||
.maya_data/
|
||||
@@ -1,79 +0,0 @@
|
||||
@echo off
|
||||
:: Launches Wing IDE and the DccScriptingInterface Project Files
|
||||
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
REM
|
||||
REM SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
REM
|
||||
REM
|
||||
|
||||
echo.
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
echo ~ Setting up LY DCCsi WingIDE Dev Env...
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
|
||||
:: Store current dir
|
||||
%~d0
|
||||
cd %~dp0
|
||||
PUSHD %~dp0
|
||||
|
||||
:: Keep changes local
|
||||
SETLOCAL enableDelayedExpansion
|
||||
|
||||
SET ABS_PATH=%~dp0
|
||||
echo Current Dir, %ABS_PATH%
|
||||
|
||||
:: WingIDE version Major
|
||||
SET WING_VERSION_MAJOR=7
|
||||
echo WING_VERSION_MAJOR = %WING_VERSION_MAJOR%
|
||||
|
||||
:: WingIDE version Major
|
||||
SET WING_VERSION_MINOR=1
|
||||
echo WING_VERSION_MINOR = %WING_VERSION_MINOR%
|
||||
|
||||
:: note the changed path from IDE to Pro
|
||||
set WINGHOME=%PROGRAMFILES(X86)%\Wing Pro %WING_VERSION_MAJOR%.%WING_VERSION_MINOR%
|
||||
echo WINGHOME = %WINGHOME%
|
||||
|
||||
CALL %~dp0\Project_Env.bat
|
||||
|
||||
echo.
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
echo ~ WingIDE Version %WING_VERSION_MAJOR%.%WING_VERSION_MINOR%
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
|
||||
SET WING_PROJ=%DCCSIG_PATH%\Solutions\.wing\DCCsi_%WING_VERSION_MAJOR%x.wpr
|
||||
echo WING_PROJ = %WING_PROJ%
|
||||
|
||||
echo.
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
echo ~ Launching %LY_PROJECT% project in WingIDE %WING_VERSION_MAJOR%.%WING_VERSION_MINOR% ...
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
|
||||
|
||||
IF EXIST "%WINGHOME%\bin\wing.exe" (
|
||||
start "" "%WINGHOME%\bin\wing.exe" "%WING_PROJ%"
|
||||
) ELSE (
|
||||
Where wing.exe 2> NUL
|
||||
IF ERRORLEVEL 1 (
|
||||
echo wing.exe could not be found
|
||||
pause
|
||||
) ELSE (
|
||||
start "" wing.exe "%WING_PROJ%"
|
||||
)
|
||||
)
|
||||
|
||||
ENDLOCAL
|
||||
|
||||
:: Return to starting directory
|
||||
POPD
|
||||
|
||||
:END_OF_FILE
|
||||
@@ -1,70 +0,0 @@
|
||||
@echo off
|
||||
:: Sets up environment for Lumberyard DCC tools and code access
|
||||
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
REM
|
||||
REM SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
REM
|
||||
REM
|
||||
|
||||
:: Store current dir
|
||||
%~d0
|
||||
cd %~dp0
|
||||
PUSHD %~dp0
|
||||
|
||||
for %%a in (.) do set LY_PROJECT=%%~na
|
||||
|
||||
echo.
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
echo ~ Setting up LY DSI PROJECT Environment ...
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
|
||||
echo LY_PROJECT = %LY_PROJECT%
|
||||
|
||||
:: Put you project env vars and overrides here
|
||||
|
||||
:: chanhe the relative path up to dev
|
||||
set DEV_REL_PATH=../../..
|
||||
set ABS_PATH=%~dp0
|
||||
|
||||
:: Override the default maya version
|
||||
set MAYA_VERSION=2020
|
||||
echo MAYA_VERSION = %MAYA_VERSION%
|
||||
|
||||
set LY_PROJECT_PATH=%ABS_PATH%
|
||||
echo LY_PROJECT_PATH = %LY_PROJECT_PATH%
|
||||
|
||||
:: Change to root Lumberyard dev dir
|
||||
CD /d %LY_PROJECT_PATH%\%DEV_REL_PATH%
|
||||
set LY_DEV=%CD%
|
||||
echo LY_DEV = %LY_DEV%
|
||||
|
||||
CALL %LY_DEV%\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\Launchers\Windows\Env.bat
|
||||
|
||||
rem :: Constant Vars (Global)
|
||||
rem SET LYPY_GDEBUG=0
|
||||
rem echo LYPY_GDEBUG = %LYPY_GDEBUG%
|
||||
rem SET LYPY_DEV_MODE=0
|
||||
rem echo LYPY_DEV_MODE = %LYPY_DEV_MODE%
|
||||
rem SET LYPY_DEBUGGER=WING
|
||||
rem echo LYPY_DEBUGGER = %LYPY_DEBUGGER%
|
||||
|
||||
:: Restore original directory
|
||||
popd
|
||||
|
||||
:: Change to root dir
|
||||
CD /D %ABS_PATH%
|
||||
|
||||
:: if the user has set up a custom env call it
|
||||
IF EXIST "%~dp0User_Env.bat" CALL %~dp0User_Env.bat
|
||||
|
||||
GOTO END_OF_FILE
|
||||
|
||||
:: Return to starting directory
|
||||
POPD
|
||||
|
||||
:END_OF_FILE
|
||||
+8
-10
@@ -1,21 +1,19 @@
|
||||
:: Need to set up
|
||||
|
||||
@echo off
|
||||
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project
|
||||
REM
|
||||
REM SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
REM
|
||||
REM
|
||||
|
||||
:: Set up and run LY Python CMD prompt
|
||||
:: Sets up the DccScriptingInterface_Env,
|
||||
:: Set up and start a O3DE CMD prompt
|
||||
:: Sets up the current (DCC) Project_Env,
|
||||
:: Puts you in the CMD within the dev environment
|
||||
|
||||
:: Set up window
|
||||
TITLE Lumberyard DCC Scripting Interface Cmd
|
||||
TITLE O3DE Asset Gem Cmd
|
||||
:: Use obvious color to prevent confusion (Grey with Yellow Text)
|
||||
COLOR 8E
|
||||
|
||||
@@ -31,7 +29,7 @@ CALL %~dp0\Project_Env.bat
|
||||
echo.
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
echo ~ LY DCC Scripting Interface CMD ...
|
||||
echo ~ O3DE Asset Gem CMD ...
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
|
||||
@@ -43,4 +41,4 @@ ENDLOCAL
|
||||
:: Return to starting directory
|
||||
POPD
|
||||
|
||||
:END_OF_FILE
|
||||
:END_OF_FILE
|
||||
+5
-5
@@ -22,22 +22,22 @@ echo ~ calling PROJ_Env.bat
|
||||
SETLOCAL enableDelayedExpansion
|
||||
|
||||
:: PY version Major
|
||||
set DCCSI_PY_VERSION_MAJOR=2
|
||||
IF "%DCCSI_PY_VERSION_MAJOR%"=="" (set DCCSI_PY_VERSION_MAJOR=2)
|
||||
echo DCCSI_PY_VERSION_MAJOR = %DCCSI_PY_VERSION_MAJOR%
|
||||
|
||||
:: PY version Major
|
||||
set DCCSI_PY_VERSION_MINOR=7
|
||||
IF "%DCCSI_PY_VERSION_MINOR%"=="" (set DCCSI_PY_VERSION_MINOR=7)
|
||||
echo DCCSI_PY_VERSION_MINOR = %DCCSI_PY_VERSION_MINOR%
|
||||
|
||||
:: Maya Version
|
||||
set MAYA_VERSION=2020
|
||||
echo MAYA_VERSION = %MAYA_VERSION%
|
||||
IF "%DCCSI_MAYA_VERSION%"=="" (set DCCSI_MAYA_VERSION=2020)
|
||||
echo DCCSI_MAYA_VERSION = %DCCSI_MAYA_VERSION%
|
||||
|
||||
:: if a local customEnv.bat exists, run it
|
||||
IF EXIST "%~dp0Project_Env.bat" CALL %~dp0Project_Env.bat
|
||||
|
||||
echo ________________________________
|
||||
echo Launching Maya %MAYA_VERSION% for Lumberyard...
|
||||
echo Launching Maya %DCCSI_MAYA_VERSION% for Lumberyard...
|
||||
|
||||
:::: Set Maya native project acess to this project
|
||||
::set MAYA_PROJECT=%LY_PROJECT%
|
||||
@@ -0,0 +1,110 @@
|
||||
@echo off
|
||||
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project
|
||||
REM
|
||||
REM SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
REM
|
||||
REM
|
||||
|
||||
:: Sets up environment for O3DE DCC tools and code access
|
||||
|
||||
:: Set up window
|
||||
TITLE O3DE Asset Gem
|
||||
:: Use obvious color to prevent confusion (Grey with Yellow Text)
|
||||
COLOR 8E
|
||||
|
||||
:: Skip initialization if already completed
|
||||
IF "%O3DE_PROJ_ENV_INIT%"=="1" GOTO :END_OF_FILE
|
||||
|
||||
:: Store current dir
|
||||
%~d0
|
||||
cd %~dp0
|
||||
PUSHD %~dp0
|
||||
|
||||
:: Put you project env vars and overrides in this file
|
||||
|
||||
:: chanhe the relative path up to dev
|
||||
set ABS_PATH=%~dp0
|
||||
|
||||
:: project name as a str tag
|
||||
IF "%LY_PROJECT_NAME%"=="" (
|
||||
for %%I in ("%~dp0.") do for %%J in ("%%~dpI.") do set LY_PROJECT_NAME=%%~nxJ
|
||||
)
|
||||
|
||||
echo.
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
echo ~ Setting up O3DE %LY_PROJECT_NAME% Environment ...
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
echo LY_PROJECT_NAME = %LY_PROJECT_NAME%
|
||||
|
||||
:: if the user has set up a custom env call it
|
||||
:: this should allow the user to locally
|
||||
:: set env hooks like LY_DEV or LY_PROJECT
|
||||
IF EXIST "%~dp0User_Env.bat" CALL %~dp0User_Env.bat
|
||||
echo LY_DEV = %LY_DEV%
|
||||
|
||||
:: Constant Vars (Global)
|
||||
:: global debug flag (propogates)
|
||||
:: The intent here is to set and globally enter a debug mode
|
||||
IF "%DCCSI_GDEBUG%"=="" (set DCCSI_GDEBUG=false)
|
||||
echo DCCSI_GDEBUG = %DCCSI_GDEBUG%
|
||||
:: initiates earliest debugger connection
|
||||
:: we support attaching to WingIDE... PyCharm and VScode in the future
|
||||
IF "%DCCSI_DEV_MODE%"=="" (set DCCSI_DEV_MODE=false)
|
||||
echo DCCSI_DEV_MODE = %DCCSI_DEV_MODE%
|
||||
:: sets debugger, options: WING, PYCHARM
|
||||
IF "%DCCSI_GDEBUGGER%"=="" (set DCCSI_GDEBUGGER=WING)
|
||||
echo DCCSI_GDEBUGGER = %DCCSI_GDEBUGGER%
|
||||
:: Default level logger will handle
|
||||
:: Override this to control the setting
|
||||
:: CRITICAL:50
|
||||
:: ERROR:40
|
||||
:: WARNING:30
|
||||
:: INFO:20
|
||||
:: DEBUG:10
|
||||
:: NOTSET:0
|
||||
IF "%DCCSI_LOGLEVEL%"=="" (set DCCSI_LOGLEVEL=20)
|
||||
echo DCCSI_LOGLEVEL = %DCCSI_LOGLEVEL%
|
||||
|
||||
:: Override the default maya version
|
||||
IF "%DCCSI_MAYA_VERSION%"=="" (set DCCSI_MAYA_VERSION=2020)
|
||||
echo DCCSI_MAYA_VERSION = %DCCSI_MAYA_VERSION%
|
||||
|
||||
:: LY_PROJECT is ideally treated as a full path in the env launchers
|
||||
:: do to changes in o3de, external engine/project/gem folder structures, etc.
|
||||
IF "%LY_PROJECT%"=="" (
|
||||
for %%i in ("%~dp0..") do set "LY_PROJECT=%%~fi"
|
||||
)
|
||||
echo LY_PROJECT = %LY_PROJECT%
|
||||
|
||||
:: this is here for archaic reasons, WILL DEPRECATE
|
||||
IF "%LY_PROJECT_PATH%"=="" (set LY_PROJECT_PATH=%LY_PROJECT%)
|
||||
echo LY_PROJECT_PATH = %LY_PROJECT_PATH%
|
||||
|
||||
:: Change to root Lumberyard dev dir
|
||||
:: You must set this in a User_Env.bat to match youe engine repo location!
|
||||
IF "%LY_DEV%"=="" (set LY_DEV=C:\Depot\o3de-engine)
|
||||
echo LY_DEV = %LY_DEV%
|
||||
|
||||
CALL %LY_DEV%\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\Launchers\Windows\Env_Maya.bat
|
||||
|
||||
:: Restore original directory
|
||||
popd
|
||||
|
||||
:: Change to root dir
|
||||
CD /D %ABS_PATH%
|
||||
|
||||
::ENDLOCAL
|
||||
|
||||
:: Set flag so we don't initialize dccsi environment twice
|
||||
SET O3DE_PROJ_ENV_INIT=1
|
||||
GOTO END_OF_FILE
|
||||
|
||||
:: Return to starting directory
|
||||
POPD
|
||||
|
||||
:END_OF_FILE
|
||||
@@ -0,0 +1,42 @@
|
||||
@echo off
|
||||
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project
|
||||
REM
|
||||
REM SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
REM
|
||||
REM
|
||||
|
||||
:: copy this file, rename to User_Env.bat (remove .template)
|
||||
:: use this file to override any local properties that differ from base
|
||||
|
||||
:: Skip initialization if already completed
|
||||
IF "%O3DE_USER_ENV_INIT%"=="1" GOTO :END_OF_FILE
|
||||
|
||||
:: Store current dir
|
||||
%~d0
|
||||
cd %~dp0
|
||||
PUSHD %~dp0
|
||||
|
||||
SET O3DE_DEV=C:\Depot\o3de-engine
|
||||
::SET OCIO_APPS=C:\Depot\o3de-engine\Tools\ColorGrading\ocio\build\src\apps
|
||||
SET TAG_LY_BUILD_PATH=build
|
||||
SET DCCSI_GDEBUG=True
|
||||
SET DCCSI_DEV_MODE=True
|
||||
|
||||
set DCCSI_MAYA_VERSION=2020
|
||||
|
||||
:: set the your user name here for windows path
|
||||
SET TAG_USERNAME=NOT_SET
|
||||
SET DCCSI_PY_REV=rev1
|
||||
SET DCCSI_PY_PLATFORM=windows
|
||||
|
||||
:: Set flag so we don't initialize dccsi environment twice
|
||||
SET O3DE_USER_ENV_INIT=1
|
||||
GOTO END_OF_FILE
|
||||
|
||||
:: Return to starting directory
|
||||
POPD
|
||||
|
||||
:END_OF_FILE
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"gem_name": "ReferenceMaterials",
|
||||
"display_name": "ReferenceMaterials",
|
||||
"license": "Apache-2.0 Or MIT",
|
||||
"origin": "Open 3D Engine - o3de.org",
|
||||
"display_name": "PBR Reference Materials",
|
||||
"license": "Code, text, data files: Apache-2.0 Or MIT, assets/content/images: CC BY 4.0",
|
||||
"origin": "https://github.com/aws-lumberyard-dev/o3de.git",
|
||||
"type": "Asset",
|
||||
"summary": "Atom Asset Gem with a library of reference materials for StandardPBR (and others in the future)",
|
||||
"canonical_tags": ["Gem"],
|
||||
"user_tags": ["Assets"],
|
||||
"requirements": ""
|
||||
"user_tags": ["Assets", "PBR", "Materials"],
|
||||
"icon_path": "preview.png"
|
||||
}
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
@echo off
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
REM
|
||||
REM SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
REM
|
||||
REM
|
||||
|
||||
:: Store current dir
|
||||
%~d0
|
||||
cd %~dp0
|
||||
PUSHD %~dp0
|
||||
|
||||
:: This is a legacy envar which is being migrated to LY_PROJECT_NAME
|
||||
for %%a in (.) do set LY_PROJECT=%%~na
|
||||
|
||||
echo.
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
echo ~ Setting up LY DSI PROJECT Environment ...
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
|
||||
echo LY_PROJECT = %LY_PROJECT%
|
||||
|
||||
set LY_PROJECT_NAME=%LY_PROJECT%
|
||||
echo LY_PROJECT_NAME = %LY_PROJECT_NAME%
|
||||
|
||||
:: Put you project env vars and overrides here
|
||||
|
||||
:: chanhe the relative path up to dev
|
||||
set DEV_REL_PATH=../../..
|
||||
set ABS_PATH=%~dp0
|
||||
|
||||
:: Override the default maya version
|
||||
set MAYA_VERSION=2020
|
||||
echo MAYA_VERSION = %MAYA_VERSION%
|
||||
|
||||
set LY_PROJECT_PATH=%ABS_PATH%
|
||||
echo LY_PROJECT_PATH = %LY_PROJECT_PATH%
|
||||
|
||||
:: Change to root Lumberyard dev dir
|
||||
CD /d %LY_PROJECT_PATH%\%DEV_REL_PATH%
|
||||
set LY_DEV=%CD%
|
||||
echo LY_DEV = %LY_DEV%
|
||||
|
||||
CALL %LY_DEV%\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\Launchers\Windows\Env_Maya.bat
|
||||
|
||||
rem :: Constant Vars (Global)
|
||||
rem SET LYPY_GDEBUG=0
|
||||
rem echo LYPY_GDEBUG = %LYPY_GDEBUG%
|
||||
rem SET LYPY_DEV_MODE=0
|
||||
rem echo LYPY_DEV_MODE = %LYPY_DEV_MODE%
|
||||
rem SET LYPY_DEBUGGER=WING
|
||||
rem echo LYPY_DEBUGGER = %LYPY_DEBUGGER%
|
||||
|
||||
:: Restore original directory
|
||||
popd
|
||||
|
||||
:: Change to root dir
|
||||
CD /D %ABS_PATH%
|
||||
|
||||
:: if the user has set up a custom env call it
|
||||
IF EXIST "%~dp0User_Env.bat" CALL %~dp0User_Env.bat
|
||||
|
||||
GOTO END_OF_FILE
|
||||
|
||||
:: Return to starting directory
|
||||
POPD
|
||||
|
||||
:END_OF_FILE
|
||||
@@ -1,19 +1,19 @@
|
||||
@echo off
|
||||
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
REM
|
||||
REM SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
REM
|
||||
REM
|
||||
|
||||
@echo off
|
||||
:: Set up and run LY Python CMD prompt
|
||||
:: Sets up the DccScriptingInterface_Env,
|
||||
:: Set up and start a O3DE CMD prompt
|
||||
:: Sets up the current (DCC) Project_Env,
|
||||
:: Puts you in the CMD within the dev environment
|
||||
|
||||
:: Set up window
|
||||
TITLE Lumberyard DCC Scripting Interface Cmd
|
||||
TITLE O3DE DCC Scripting Interface Cmd
|
||||
:: Use obvious color to prevent confusion (Grey with Yellow Text)
|
||||
COLOR 8E
|
||||
|
||||
@@ -24,7 +24,7 @@ PUSHD %~dp0
|
||||
:: Keep changes local
|
||||
SETLOCAL enableDelayedExpansion
|
||||
|
||||
CALL %~dp0\..\Project_Env.bat
|
||||
CALL %~dp0\Project_Env.bat
|
||||
|
||||
echo.
|
||||
echo _____________________________________________________________________
|
||||
|
||||
+16
-20
@@ -1,4 +1,5 @@
|
||||
@echo off
|
||||
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
@@ -7,11 +8,6 @@ REM SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
REM
|
||||
REM
|
||||
|
||||
:: Launches maya wityh a bunch of local hooks for Lumberyard
|
||||
:: ToDo: move all of this to a .json data driven boostrapping system
|
||||
|
||||
@echo off
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
PUSHD %~dp0
|
||||
@@ -23,22 +19,22 @@ echo ~ calling PROJ_Env.bat
|
||||
SETLOCAL enableDelayedExpansion
|
||||
|
||||
:: PY version Major
|
||||
set DCCSI_PY_VERSION_MAJOR=2
|
||||
IF "%DCCSI_PY_VERSION_MAJOR%"=="" (set DCCSI_PY_VERSION_MAJOR=2)
|
||||
echo DCCSI_PY_VERSION_MAJOR = %DCCSI_PY_VERSION_MAJOR%
|
||||
|
||||
:: PY version Major
|
||||
set DCCSI_PY_VERSION_MINOR=7
|
||||
IF "%DCCSI_PY_VERSION_MINOR%"=="" (set DCCSI_PY_VERSION_MINOR=7)
|
||||
echo DCCSI_PY_VERSION_MINOR = %DCCSI_PY_VERSION_MINOR%
|
||||
|
||||
:: Maya Version
|
||||
set MAYA_VERSION=2020
|
||||
echo MAYA_VERSION = %MAYA_VERSION%
|
||||
IF "%DCCSI_MAYA_VERSION%"=="" (set DCCSI_MAYA_VERSION=2020)
|
||||
echo DCCSI_MAYA_VERSION = %DCCSI_MAYA_VERSION%
|
||||
|
||||
:: if a local customEnv.bat exists, run it
|
||||
IF EXIST "%~dp0..\..\Project_Env.bat" CALL %~dp0..\..\Project_Env.bat
|
||||
IF EXIST "%~dp0Project_Env.bat" CALL %~dp0Project_Env.bat
|
||||
|
||||
echo ________________________________
|
||||
echo Launching Maya %MAYA_VERSION% for Lumberyard...
|
||||
echo Launching Maya %DCCSI_MAYA_VERSION% for Lumberyard...
|
||||
|
||||
:::: Set Maya native project acess to this project
|
||||
::set MAYA_PROJECT=%LY_PROJECT%
|
||||
@@ -49,15 +45,15 @@ Set MAYA_VP2_DEVICE_OVERRIDE = VirtualDeviceDx11
|
||||
|
||||
:: Default to the right version of Maya if we can detect it... and launch
|
||||
IF EXIST "%MAYA_LOCATION%\bin\Maya.exe" (
|
||||
start "" "%MAYA_LOCATION%\bin\Maya.exe" %*
|
||||
start "" "%MAYA_LOCATION%\bin\Maya.exe" %*
|
||||
) ELSE (
|
||||
Where maya.exe 2> NUL
|
||||
IF ERRORLEVEL 1 (
|
||||
echo Maya.exe could not be found
|
||||
pause
|
||||
) ELSE (
|
||||
start "" Maya.exe %*
|
||||
)
|
||||
Where maya.exe 2> NUL
|
||||
IF ERRORLEVEL 1 (
|
||||
echo Maya.exe could not be found
|
||||
pause
|
||||
) ELSE (
|
||||
start "" Maya.exe %*
|
||||
)
|
||||
)
|
||||
|
||||
:: Return to starting directory
|
||||
@@ -65,4 +61,4 @@ POPD
|
||||
|
||||
:END_OF_FILE
|
||||
|
||||
exit /b 0
|
||||
exit /b 0
|
||||
@@ -0,0 +1,110 @@
|
||||
@echo off
|
||||
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project
|
||||
REM
|
||||
REM SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
REM
|
||||
REM
|
||||
|
||||
:: Sets up environment for O3DE DCC tools and code access
|
||||
|
||||
:: Set up window
|
||||
TITLE O3DE Asset Gem
|
||||
:: Use obvious color to prevent confusion (Grey with Yellow Text)
|
||||
COLOR 8E
|
||||
|
||||
:: Skip initialization if already completed
|
||||
IF "%O3DE_PROJ_ENV_INIT%"=="1" GOTO :END_OF_FILE
|
||||
|
||||
:: Store current dir
|
||||
%~d0
|
||||
cd %~dp0
|
||||
PUSHD %~dp0
|
||||
|
||||
:: Put you project env vars and overrides in this file
|
||||
|
||||
:: chanhe the relative path up to dev
|
||||
set ABS_PATH=%~dp0
|
||||
|
||||
:: project name as a str tag
|
||||
IF "%LY_PROJECT_NAME%"=="" (
|
||||
for %%I in ("%~dp0.") do for %%J in ("%%~dpI.") do set LY_PROJECT_NAME=%%~nxJ
|
||||
)
|
||||
|
||||
echo.
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
echo ~ Setting up O3DE %LY_PROJECT_NAME% Environment ...
|
||||
echo _____________________________________________________________________
|
||||
echo.
|
||||
echo LY_PROJECT_NAME = %LY_PROJECT_NAME%
|
||||
|
||||
:: if the user has set up a custom env call it
|
||||
:: this should allow the user to locally
|
||||
:: set env hooks like LY_DEV or LY_PROJECT
|
||||
IF EXIST "%~dp0User_Env.bat" CALL %~dp0User_Env.bat
|
||||
echo LY_DEV = %LY_DEV%
|
||||
|
||||
:: Constant Vars (Global)
|
||||
:: global debug flag (propogates)
|
||||
:: The intent here is to set and globally enter a debug mode
|
||||
IF "%DCCSI_GDEBUG%"=="" (set DCCSI_GDEBUG=false)
|
||||
echo DCCSI_GDEBUG = %DCCSI_GDEBUG%
|
||||
:: initiates earliest debugger connection
|
||||
:: we support attaching to WingIDE... PyCharm and VScode in the future
|
||||
IF "%DCCSI_DEV_MODE%"=="" (set DCCSI_DEV_MODE=false)
|
||||
echo DCCSI_DEV_MODE = %DCCSI_DEV_MODE%
|
||||
:: sets debugger, options: WING, PYCHARM
|
||||
IF "%DCCSI_GDEBUGGER%"=="" (set DCCSI_GDEBUGGER=WING)
|
||||
echo DCCSI_GDEBUGGER = %DCCSI_GDEBUGGER%
|
||||
:: Default level logger will handle
|
||||
:: Override this to control the setting
|
||||
:: CRITICAL:50
|
||||
:: ERROR:40
|
||||
:: WARNING:30
|
||||
:: INFO:20
|
||||
:: DEBUG:10
|
||||
:: NOTSET:0
|
||||
IF "%DCCSI_LOGLEVEL%"=="" (set DCCSI_LOGLEVEL=20)
|
||||
echo DCCSI_LOGLEVEL = %DCCSI_LOGLEVEL%
|
||||
|
||||
:: Override the default maya version
|
||||
IF "%DCCSI_MAYA_VERSION%"=="" (set DCCSI_MAYA_VERSION=2020)
|
||||
echo DCCSI_MAYA_VERSION = %DCCSI_MAYA_VERSION%
|
||||
|
||||
:: LY_PROJECT is ideally treated as a full path in the env launchers
|
||||
:: do to changes in o3de, external engine/project/gem folder structures, etc.
|
||||
IF "%LY_PROJECT%"=="" (
|
||||
for %%i in ("%~dp0..") do set "LY_PROJECT=%%~fi"
|
||||
)
|
||||
echo LY_PROJECT = %LY_PROJECT%
|
||||
|
||||
:: this is here for archaic reasons, WILL DEPRECATE
|
||||
IF "%LY_PROJECT_PATH%"=="" (set LY_PROJECT_PATH=%LY_PROJECT%)
|
||||
echo LY_PROJECT_PATH = %LY_PROJECT_PATH%
|
||||
|
||||
:: Change to root Lumberyard dev dir
|
||||
:: You must set this in a User_Env.bat to match youe engine repo location!
|
||||
IF "%LY_DEV%"=="" (set LY_DEV=C:\Depot\o3de-engine)
|
||||
echo LY_DEV = %LY_DEV%
|
||||
|
||||
CALL %LY_DEV%\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\Launchers\Windows\Env_Maya.bat
|
||||
|
||||
:: Restore original directory
|
||||
popd
|
||||
|
||||
:: Change to root dir
|
||||
CD /D %ABS_PATH%
|
||||
|
||||
::ENDLOCAL
|
||||
|
||||
:: Set flag so we don't initialize dccsi environment twice
|
||||
SET O3DE_PROJ_ENV_INIT=1
|
||||
GOTO END_OF_FILE
|
||||
|
||||
:: Return to starting directory
|
||||
POPD
|
||||
|
||||
:END_OF_FILE
|
||||
@@ -0,0 +1,42 @@
|
||||
@echo off
|
||||
|
||||
REM
|
||||
REM Copyright (c) Contributors to the Open 3D Engine Project
|
||||
REM
|
||||
REM SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
REM
|
||||
REM
|
||||
|
||||
:: copy this file, rename to User_Env.bat (remove .template)
|
||||
:: use this file to override any local properties that differ from base
|
||||
|
||||
:: Skip initialization if already completed
|
||||
IF "%O3DE_USER_ENV_INIT%"=="1" GOTO :END_OF_FILE
|
||||
|
||||
:: Store current dir
|
||||
%~d0
|
||||
cd %~dp0
|
||||
PUSHD %~dp0
|
||||
|
||||
SET O3DE_DEV=C:\Depot\o3de-engine
|
||||
::SET OCIO_APPS=C:\Depot\o3de-engine\Tools\ColorGrading\ocio\build\src\apps
|
||||
SET TAG_LY_BUILD_PATH=build
|
||||
SET DCCSI_GDEBUG=True
|
||||
SET DCCSI_DEV_MODE=True
|
||||
|
||||
set DCCSI_MAYA_VERSION=2020
|
||||
|
||||
:: set the your user name here for windows path
|
||||
SET TAG_USERNAME=NOT_SET
|
||||
SET DCCSI_PY_REV=rev1
|
||||
SET DCCSI_PY_PLATFORM=windows
|
||||
|
||||
:: Set flag so we don't initialize dccsi environment twice
|
||||
SET O3DE_USER_ENV_INIT=1
|
||||
GOTO END_OF_FILE
|
||||
|
||||
:: Return to starting directory
|
||||
POPD
|
||||
|
||||
:END_OF_FILE
|
||||
@@ -1 +0,0 @@
|
||||
set LY_DEV=C:\Depot\o3de-engine
|
||||
+8
-1
@@ -117,8 +117,15 @@ namespace AZ
|
||||
: public ComponentBus
|
||||
{
|
||||
public:
|
||||
virtual void OnMaterialsUpdated([[maybe_unused]] const MaterialAssignmentMap& materials) {}
|
||||
|
||||
//! This message is sent every time a material or property update affects UI.
|
||||
virtual void OnMaterialsEdited() {}
|
||||
|
||||
//! This message is sent when one or more material property changes have been applied, at most once per frame.
|
||||
virtual void OnMaterialsUpdated([[maybe_unused]] const MaterialAssignmentMap& materials) {}
|
||||
|
||||
//! This message is sent when the component has created the material instance to be used for rendering.
|
||||
virtual void OnMaterialInstanceCreated([[maybe_unused]] const MaterialAssignment& materialAssignment) {}
|
||||
};
|
||||
using MaterialComponentNotificationBus = EBus<MaterialComponentNotifications>;
|
||||
|
||||
|
||||
+10
@@ -222,6 +222,16 @@ namespace AZ
|
||||
&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_AttributesAndValues);
|
||||
}
|
||||
|
||||
void EditorMaterialComponent::OnMaterialInstanceCreated(const MaterialAssignment& materialAssignment)
|
||||
{
|
||||
// PSO-impacting property changes are allowed in the editor
|
||||
// because the saved slice data can be analyzed to pre-compile the necessary PSOs.
|
||||
if (materialAssignment.m_materialInstance)
|
||||
{
|
||||
materialAssignment.m_materialInstance->SetPsoHandlingOverride(AZ::RPI::MaterialPropertyPsoHandling::Allowed);
|
||||
}
|
||||
}
|
||||
|
||||
AZ::u32 EditorMaterialComponent::OnConfigurationChanged()
|
||||
{
|
||||
return AZ::Edit::PropertyRefreshLevels::AttributesAndValues;
|
||||
|
||||
@@ -49,6 +49,9 @@ namespace AZ
|
||||
//! MaterialReceiverNotificationBus::Handler overrides...
|
||||
void OnMaterialAssignmentsChanged() override;
|
||||
|
||||
//! MaterialComponentNotificationBus::Handler overrides...
|
||||
void OnMaterialInstanceCreated(const MaterialAssignment& materialAssignment) override;
|
||||
|
||||
// Regenerates the editor component material slots based on the material and
|
||||
// LOD mapping from the model or other consumer of materials.
|
||||
// If any corresponding material assignments are found in the component
|
||||
|
||||
+5
@@ -259,6 +259,7 @@ namespace AZ
|
||||
for (auto& materialPair : m_configuration.m_materials)
|
||||
{
|
||||
materialPair.second.RebuildInstance();
|
||||
MaterialComponentNotificationBus::Event(m_entityId, &MaterialComponentNotifications::OnMaterialInstanceCreated, materialPair.second);
|
||||
QueuePropertyChanges(materialPair.first);
|
||||
}
|
||||
QueueMaterialUpdateNotification();
|
||||
@@ -405,6 +406,7 @@ namespace AZ
|
||||
{
|
||||
materialAssignment.m_propertyOverrides[AZ::Name(propertyName)] = value;
|
||||
materialAssignment.RebuildInstance();
|
||||
MaterialComponentNotificationBus::Event(m_entityId, &MaterialComponentNotifications::OnMaterialInstanceCreated, materialAssignment);
|
||||
QueueMaterialUpdateNotification();
|
||||
}
|
||||
else
|
||||
@@ -597,6 +599,7 @@ namespace AZ
|
||||
if (materialIt->second.m_propertyOverrides.empty())
|
||||
{
|
||||
materialIt->second.RebuildInstance();
|
||||
MaterialComponentNotificationBus::Event(m_entityId, &MaterialComponentNotifications::OnMaterialInstanceCreated, materialIt->second);
|
||||
QueueMaterialUpdateNotification();
|
||||
}
|
||||
|
||||
@@ -615,6 +618,7 @@ namespace AZ
|
||||
{
|
||||
materialIt->second.m_propertyOverrides = {};
|
||||
materialIt->second.RebuildInstance();
|
||||
MaterialComponentNotificationBus::Event(m_entityId, &MaterialComponentNotifications::OnMaterialInstanceCreated, materialIt->second);
|
||||
QueueMaterialUpdateNotification();
|
||||
}
|
||||
}
|
||||
@@ -628,6 +632,7 @@ namespace AZ
|
||||
{
|
||||
materialPair.second.m_propertyOverrides = {};
|
||||
materialPair.second.RebuildInstance();
|
||||
MaterialComponentNotificationBus::Event(m_entityId, &MaterialComponentNotifications::OnMaterialInstanceCreated, materialPair.second);
|
||||
QueueMaterialUpdateNotification();
|
||||
cleared = true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ IF "%DCCSI_PY_VERSION_MINOR%"=="" (set DCCSI_PY_VERSION_MINOR=7)
|
||||
IF "%DCCSI_PY_VERSION_RELEASE%"=="" (set DCCSI_PY_VERSION_RELEASE=11)
|
||||
|
||||
:: Default Maya Version
|
||||
IF "%DCCSI_MAYA_VERSION%"=="" (set DCCSI_MAYA_VERSION=2020)
|
||||
IF "%DCCSI_MAYA_VERSION%"=="" (set DCCSI_MAYA_VERSION=%MAYA_VERSION%)
|
||||
|
||||
:: Initialize env
|
||||
CALL %~dp0\Env_Core.bat
|
||||
|
||||
@@ -7,15 +7,16 @@
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
# -- This line is 75 characters -------------------------------------------
|
||||
# note: this module should reamin py2.7 compatible (Maya) so no f'strings
|
||||
# --------------------------------------------------------------------------
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
import site
|
||||
import logging as _logging
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
|
||||
from pathlib import Path # note: we provide this in py2.7
|
||||
# so using it here suggests some boostrapping has occured before using azpy
|
||||
# --------------------------------------------------------------------------
|
||||
_PACKAGENAME = 'azpy.config_utils'
|
||||
|
||||
@@ -28,8 +29,31 @@ _LOGGER.debug('Initializing: {0}.'.format({_PACKAGENAME}))
|
||||
|
||||
__all__ = ['get_os', 'return_stub', 'get_stub_check_path',
|
||||
'get_dccsi_config', 'get_current_project']
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# note: this module should reamin py2.7 compatible (Maya) so no f'strings
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# just a quick check to ensure what paths have code access
|
||||
_G_DEBUG = False # enable for debug prints
|
||||
if _G_DEBUG:
|
||||
known_paths = list()
|
||||
for p in sys.path:
|
||||
known_paths.append(p)
|
||||
_LOGGER.debug(known_paths)
|
||||
|
||||
# this import can fail in Maya 2020 (and earlier) stuck on py2.7
|
||||
# wrapped in a try, to trap and providing messaging to help user correct
|
||||
try:
|
||||
from pathlib import Path # note: we provide this in py2.7
|
||||
# so using it here suggests some boostrapping has occured before using azpy
|
||||
except Exception as e:
|
||||
_LOGGER.warning('Maya 2020 and below, use py2.7')
|
||||
_LOGGER.warning('py2.7 does not include pathlib')
|
||||
_LOGGER.warning('Try installing the O3DE DCCsi py2.7 requirements.txt')
|
||||
_LOGGER.warning("See instructions: 'C:\\< your o3de engine >\\Gems\\AtomLyIntegration\\TechnicalArt\\DccScriptingInterface\\SDK\Maya\\readme.txt'")
|
||||
_LOGGER.warning("Other code in this module with fail!!!")
|
||||
_LOGGER.error(e)
|
||||
pass # fail gracefully, note: code accesing Path will fail!
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user