Hi.
I'm am trying to change the output size of the sbsars programatically in editor.
For this I use this method :
public static void UpdateSubstanceGraphDefinition(EditorAssetUtils.AssetData p_Asset, int p_Definition)
{
SubstanceGraph l_Graph = p_Asset.Assets.Find(o => o is SubstanceGraph) as SubstanceGraph;
if (l_Graph == null) return;
SerializedObject l_SerializedObject = new SerializedObject(l_Graph);
SerializedProperty l_List = l_SerializedObject.FindProperty("mTargetSettingList");
l_List.GetArrayElementAtIndex(0).FindPropertyRelative("textureWidth").intValue = p_Definition;
l_List.GetArrayElementAtIndex(0).FindPropertyRelative("textureHeight").intValue = p_Definition;
l_SerializedObject.ApplyModifiedProperties();
l_SerializedObject.Update();
p_Asset.Assets.ForEach(EditorUtility.SetDirty);
AssetDatabase.WriteImportSettingsIfDirty(p_Asset.AssetPath);
AssetDatabase.ImportAsset(p_Asset.AssetPath);
}
p_Asset is a struct which contains the path to the main substance asset and an array of all assets under the main asset.
it is working to the point where the size changes in inspector. Unfortunately the texture aren't generated. How am I supposed to do it ?
Thank you
