22 lines
1.2 KiB
Python
22 lines
1.2 KiB
Python
import codecs
|
|
|
|
def replace_in_file(path):
|
|
with codecs.open(path, 'r', 'utf-8') as f:
|
|
content = f.read()
|
|
orig = content
|
|
|
|
content = content.replace('.GameObjects = editorContext.GetScene().GetGameObjects()', '.GameObjects = editorContext.GetScene().CaptureSnapshot().GameObjects')
|
|
content = content.replace('.GameObjects = sourceScene.GetGameObjects()', '.GameObjects = sourceScene.CaptureSnapshot().GameObjects')
|
|
content = content.replace('.GameObjects = scene.GetGameObjects()', '.GameObjects = scene.CaptureSnapshot().GameObjects')
|
|
content = content.replace('.GameObjects = MetaCore::MetaCoreCreateDefaultScene().GetGameObjects()', '.GameObjects = MetaCore::MetaCoreCreateDefaultScene().CaptureSnapshot().GameObjects')
|
|
content = content.replace('editorContext.GetScene().GetGameObjects().push_back(std::move(clonedObject));', '')
|
|
|
|
if content != orig:
|
|
with codecs.open(path, 'w', 'utf-8') as f:
|
|
f.write(content)
|
|
print(f"Fixed {path}")
|
|
|
|
replace_in_file('Source/MetaCoreEditor/Private/MetaCoreBuiltinCoreServicesModule.cpp')
|
|
replace_in_file('tools/MetaCoreRuntimeConfigTool/main.cpp')
|
|
replace_in_file('tests/MetaCoreSmokeTests.cpp')
|