Hey Harald, thank you for your answer.
So, I saw that the GetSkeletonData call this applyMaterials, but it's not blending correctly.
There is my runtime code to generate the asset:
_atlasAsset = SpineAtlasAsset.CreateRuntimeInstance(atlasTextAsset, atlasTextures, atlasSourceMaterial, true);
_skeletonDataAsset = SkeletonDataAsset.CreateRuntimeInstance(skeletonJsonTextAsset, _atlasAsset, true);
_skeletonDataAsset.blendModeMaterials.RequiresBlendModeMaterials = true;
_skeletonDataAsset.blendModeMaterials.applyAdditiveMaterial = true;
_skeletonDataAsset.isUpgradingBlendModeMaterials = true;
List<BlendModeMaterials.ReplacementMaterial> multiplyMaterials = new List<BlendModeMaterials.ReplacementMaterial>();
foreach (AtlasPage page in _atlasAsset.GetAtlas().Pages)
{
var repMaterial = new BlendModeMaterials.ReplacementMaterial();
repMaterial.pageName = page.name;
repMaterial.material = _atlasSourceMultiplyMaterial;
multiplyMaterials.Add(repMaterial);
}
_skeletonDataAsset.blendModeMaterials.multiplyMaterials = multiplyMaterials;
var sd = _skeletonDataAsset.GetSkeletonData(true);
_skeletonDataAsset.blendModeMaterials.ApplyMaterials(sd);
_skeletonAnimation = SkeletonAnimation.NewSkeletonAnimationGameObject(_skeletonDataAsset);
_skeleton = _skeletonAnimation.Skeleton;
_skeletonAnimation.gameObject.name = "Runtime Spine";
_skeletonAnimation.AnimationName = "idle";
_skeletonAnimation.gameObject.transform.SetParent(transform);
_skeletonAnimation.gameObject.transform.localScale = Vector3.one;
_skeletonAnimation.transform.localPosition = Vector3.zero;`
And the result spine character with weird blending:

There is something wrong on my code?
I found at the documentation about material configurations too:
And I check and looks like everything is correct:
Unity texture importer:

Unity Spine Settings:

The result with these configurations and the runtime code (without add blending material by hand):
_atlasAsset = SpineAtlasAsset.CreateRuntimeInstance(atlasTextAsset, atlasTextures, atlasSourceMaterial, true);
_skeletonDataAsset = SkeletonDataAsset.CreateRuntimeInstance(skeletonJsonTextAsset, _atlasAsset, true);
_skeletonAnimation = SkeletonAnimation.NewSkeletonAnimationGameObject(_skeletonDataAsset);
_skeleton = _skeletonAnimation.Skeleton;
_skeletonAnimation.gameObject.name = "Runtime Spine";
_skeletonAnimation.AnimationName = "idle";
_skeletonAnimation.gameObject.transform.SetParent(transform);
_skeletonAnimation.gameObject.transform.localScale = Vector3.one;
_skeletonAnimation.transform.localPosition = Vector3.zero;
_skeletonAnimation.Initialize(false);
_skeleton.SetSlotsToSetupPose();
_skeletonAnimation.AnimationState.Apply(_skeleton);
Is generating the dark borders:
