moved default location of surfacetypemateriallibrary.physmaterial (#2786)
from 'project root' to 'project root/Assets/Physics'
The functionality of creating / using the default physmaterial file has only change in related to the file location, other functionality is unchanged.
The following situations can occur:
This will not affect have any project that uses a custom physmaterial file.
This will not affect have any project that uses the default from the old location, as the configuration will still point there.
New projects created will get the default physmaterial file at the new location.
A Project that fails to load (or deletes) the selected physmaterial file, will get the default physmaterial file at the new location (this happens only on startup of the editor).
Issue: #2765
Signed-off-by: amzn-sean 75276488+amzn-sean@users.noreply.github.com
This commit is contained in:
+3
-2
@@ -64,7 +64,8 @@ def C15096740_Material_LibraryUpdatedCorrectly():
|
||||
|
||||
# Constants
|
||||
library_property_path = "Configuration|Physics Material|Library"
|
||||
default_material_path = "surfacetypemateriallibrary.physmaterial"
|
||||
|
||||
default_material_path = os.path.join("assets", "physics", "surfacetypemateriallibrary.physmaterial")
|
||||
new_material_path = os.path.join("physicssurfaces", "default_phys_materials.physmaterial")
|
||||
|
||||
helper.init_idle()
|
||||
@@ -82,7 +83,7 @@ def C15096740_Material_LibraryUpdatedCorrectly():
|
||||
default_asset = Asset.find_asset_by_path(default_material_path)
|
||||
test_component.set_component_property_value(library_property_path, default_asset.id)
|
||||
default_asset.id = test_component.get_component_property_value(library_property_path)
|
||||
Report.result(Tests.override_default_library, default_asset.get_path() == default_material_path)
|
||||
Report.result(Tests.override_default_library, default_asset.get_path() == default_material_path.replace(os.sep, '/'))
|
||||
|
||||
# 4) Switch it back again to the default material library.
|
||||
test_component.set_component_property_value(library_property_path, azasset.AssetId())
|
||||
|
||||
@@ -133,7 +133,7 @@ class Physmaterial_Editor:
|
||||
def _set_path(self):
|
||||
# type: (str) -> str
|
||||
if self.document_filename == None:
|
||||
self.document_filename = os.path.join(self.project_folder, "surfacetypemateriallibrary.physmaterial")
|
||||
self.document_filename = os.path.join(self.project_folder, "assets", "physics", "surfacetypemateriallibrary.physmaterial")
|
||||
else:
|
||||
for (root, directories, root_files) in os.walk(self.project_folder):
|
||||
for root_file in root_files:
|
||||
|
||||
Reference in New Issue
Block a user