mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-26 14:55:39 +00:00
Shifts handling of material and terrain material definitions to be written into the asset definition taml file instead of having an extra loose file
Also updates importers to correctly handle this change Adds ability for taml XML serialization to properly assign array'd fields Adds 'inheritFrom' field to simobjects for when objects with parent objects are serialized AssetBase how inherits from SimGroup so it can have objects like material definitions embedded in them for save/load in the taml definition file Updated loading/handling logic in terrain material asset to be more similar to regular material assets
This commit is contained in:
parent
656475deaf
commit
630285def6
20 changed files with 791 additions and 318 deletions
|
|
@ -269,6 +269,7 @@ function SubMaterialSelector::onSelect( %this )
|
|||
}
|
||||
else
|
||||
{
|
||||
MaterialEditorGui.currentMaterialAsset = %material;
|
||||
%assetDef = AssetDatabase.acquireAsset(%material);
|
||||
%material = %assetDef.materialDefinitionName;
|
||||
}
|
||||
|
|
@ -1906,6 +1907,7 @@ function MaterialEditorGui::saveDialogDontSave( %this, %material )
|
|||
|
||||
if(AssetDatabase.isDeclaredAsset(%material))
|
||||
{
|
||||
MaterialEditorGui.currentMaterialAsset = %material;
|
||||
%material = AssetDatabase.acquireAsset(%material).materialDefinitionName;
|
||||
}
|
||||
|
||||
|
|
@ -1916,6 +1918,7 @@ function MaterialEditorGui::saveDialogSave( %this, %material )
|
|||
{
|
||||
if(AssetDatabase.isDeclaredAsset(%material))
|
||||
{
|
||||
MaterialEditorGui.currentMaterialAsset = %material;
|
||||
%material = AssetDatabase.acquireAsset(%material).materialDefinitionName;
|
||||
}
|
||||
|
||||
|
|
@ -1945,8 +1948,18 @@ function MaterialEditorGui::save( %this )
|
|||
if( %currentMaterial.isAutoGenerated() )
|
||||
%currentMaterial.setAutoGenerated( false );
|
||||
|
||||
// Save the material using the persistence manager
|
||||
matEd_PersistMan.saveDirty();
|
||||
if(MaterialEditorGui.currentMaterialAsset !$= "")
|
||||
{
|
||||
MaterialEditorGui.copyMaterials( materialEd_previewMaterial, notDirtyMaterial );
|
||||
|
||||
%assetDef = AssetDatabase.acquireAsset(MaterialEditorGui.currentMaterialAsset);
|
||||
%assetDef.saveAsset(); //write it out
|
||||
}
|
||||
else
|
||||
{
|
||||
// Save the material using the persistence manager
|
||||
matEd_PersistMan.saveDirty();
|
||||
}
|
||||
|
||||
// Clean up the Material Editor
|
||||
MaterialEditorGui.copyMaterials( materialEd_previewMaterial, notDirtyMaterial );
|
||||
|
|
@ -2211,6 +2224,7 @@ function MaterialEditorGui::changeMaterial(%this, %fromMaterial, %toMaterial)
|
|||
if(AssetDatabase.isDeclaredAsset(%toMaterial))
|
||||
{
|
||||
%isMatAsset = true;
|
||||
MaterialEditorGui.currentMaterialAsset = %toMaterial;
|
||||
%assetDef = AssetDatabase.acquireAsset(%toMaterial);
|
||||
%toMaterialDefinition = %assetDef.materialDefinitionName;
|
||||
%filename = %assetDef.getScriptPath();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue