Cleared m_scriptFilename between scene files. (#2278)

This fixes a bug where a Python script file would be run on a scene file
that didn't have a script file set.
Added a general case version to SceneBuilderWorker.cpp, to make it easy
to mark all scene files as dirty.
Automated tests for this will come in a separate pull request.

Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com>
This commit is contained in:
AMZN-stankowi
2021-07-20 10:11:09 -07:00
committed by GitHub
parent d5431e1c57
commit 69b5c04b7f
2 changed files with 7 additions and 0 deletions
@@ -305,6 +305,11 @@ namespace AZ::SceneAPI::Behaviors
{
using namespace AzToolsFramework;
// This behavior persists on the same AssetBuilder. Clear the script file name so that if
// this builder processes a scene file with a script file name, and then later processes
// a scene without a script file name, it won't run the old script on the new scene.
m_scriptFilename.clear();
if (action != ManifestAction::Update)
{
return Events::ProcessingResult::Ignored;