Material: Compatibility with older FCMat files

Provides compatibility loading older files outside the context of
a library.

Older material files were loaded by specifying a path. The new
material system used the path to associated the material with a
library, which may not be appropriate for legacy files. This change
allows the use of materials outside of a library.

Additionally, legacy files often have name/value pairs not part of the
standard list of properties. Since these were unable to be mapped to
a model property they were ignored. Materials now maintain a legacy
map to hold properties not associated with a property model. These
properties are considered transient and will not be saved. It is not
intended for this feature to be used as a generic container for
properties not mapped to an appropriate model.

Fixes #13302
This commit is contained in:
David Carter
2024-04-06 15:41:07 -04:00
committed by Yorik van Havre
parent 2f81d8712b
commit bc36c8dab5
8 changed files with 135 additions and 0 deletions

View File

@@ -141,6 +141,11 @@
<UserDocu>Check if the material implements the appearance property with the given name</UserDocu>
</Documentation>
</Methode>
<Methode Name="hasLegacyProperties" ReadOnly="true">
<Documentation>
<UserDocu>Returns true of there are legacy properties</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Properties" ReadOnly="true">
<Documentation>
<UserDocu>deprecated -- Dictionary of all material properties.</UserDocu>
@@ -159,6 +164,12 @@
</Documentation>
<Parameter Name="AppearanceProperties" Type="Dict"/>
</Attribute>
<Attribute Name="LegacyProperties" ReadOnly="true">
<Documentation>
<UserDocu>deprecated -- Dictionary of material legacy properties.</UserDocu>
</Documentation>
<Parameter Name="LegacyProperties" Type="Dict"/>
</Attribute>
<Methode Name="getPhysicalValue" ReadOnly="true">
<Documentation>
<UserDocu>Get the value associated with the property</UserDocu>