- Изменено
[UE4] Spine widget and Retainer box issue
Hello!
I want to make some material effects for Spine widget, and here is the issue: Retainer box always renders Spine widget in corner of the screen.
Also tried modify Spine widget material and changing material parameters via dynamic material instance, but it didn't work either. (thinking I doing it in wrong way)
Guess I should work with Spine materials rather than use Retainer box, but can't figure it out how.
Could you create a level in our spine-ue4 example project using our assets and whatever config/blue0rints you use for the retainer box? That way I can repro the issue. Please do the same for the material issue. It should work the way you do it The rendering code takes whatever materials you set and then uses them for rendering. https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp#L143
Here is setup I made.
Test widget with the retainer box and the spine widget, button and the spine widget with the modified UI_SplineUnlitNormalMaterial
Test material for the retainer box
Modified UI_SplineUnlitNormalMaterial
Blueprint logic for the spine widget with custom material. When button is clicked spine widget should get random color.
I get same results. Spine widget in retainer box render in the corner and logic not working
Please send the levels plus blueprints and .uasset files via email contact@esotericsoftware.com.
I sent files, engine version is 4.27
Cheers, I'll take a look this week.
Sorry it took so long to get to this. I've now tried your repro, but I'm afraid it looks exactly as expected in both the editor and standalone mode, both windowed and fullscreen mode.
I'm running the latest spine-cpp/spine-ue4 from the 4.1 branch with vanilla UE 4.27. I'm not sure what the difference between our two setups could be to be honest.
Thanks. Hmm, testing right now in the 4 version of plugin and seems the retainer box works as it should. I tested in 3.8 before that.
Anyway, found out how to edit MID's parameters in blueprint, simply exposed array with MIDs. It was easier than I thought :grinteeth:
SpineWidget.h
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Spine)
TArray<UMaterialInstanceDynamic*> atlasNormalBlendMaterials;
TMap<spine::AtlasPage*, UMaterialInstanceDynamic*> pageToNormalBlendMaterial;