Pushing verse changes breaks material_block after 37.00

Summary

After last update (37.00), pushing verse changes breaks material_blocks, replacing the original material with a white block. (The code remains the same, but a white block is displayed in the UI in game)

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Assets

Steps to Reproduce

Create a verse code that adds a material_block to the player’s UI.
Launch the session, start the game to see if the material_block appears.
Then, push verse changes and check again.

Expected Result

The material_block is always visible and displays the linked material.

Observed Result

The material block is only visible after launching the session. After pushing verse changes, it is replaced by a white block.

Platform(s)

Windows

Additional Notes

I know that the material block needs a proper reference created at runtime. I do that. It’s displayed correctly after launching the session, but then breaks after pushing verse changes. Building a proper UI is really hard like this.
I can’t provide informations about rounds, as the map this is happening on doesn’t have rounds.

This issue has been confirmed by another creator too.

Hey @giovafncreative , can you share a code snippet of how you’re applying the material_block? Thanks!

I know this issue exist because I saw lots of people commenting about, but I had never faced this on my usages…
Are you constructing the material at runtime?

Sure. This is the part that involves the material block:

var Overlay : overlay = overlay{}

Background : material_block = material_block{DefaultImage:=UI.Materials.M_AbilityCardMain{},   DefaultDesiredSize:=vector2{X:=600.0, Y:=775.0}}
var BackgroundMat : M_AbilityCardMain = M_AbilityCardMain{}    

Init():void=
    set BackgroundMat = M_AbilityCardMain{}
    Background.SetImage(BackgroundMat)


    set Overlay = overlay:
        Slots:=array:
            overlay_slot:
                Widget:=Background
                HorizontalAlignment:=horizontal_alignment.Center
                VerticalAlignment:=vertical_alignment.Center

Yes. I shared the code I use in another reply here just now

For more context, this is before and after pushing verse changes:

The white block in the first image is a texture_block, so not part of the problem. This is a WIP UI. The arrow is a material block too (placeholder for now)

1 Like

This is my code and it does the same massive white box

1 Like

It is from calling SetImage, I would recommend working around this bug for now and explicitly not using SetImage anywhere. I find SetImage causes this white block issue to happen inconsistently, Creating → Drawing → Destroying → Creating → Drawing → Destroying → Repeat causes the material_block to show correctly randomly or incorrectly randomly.

I know sometimes you want to change the underlying material as this was my first approach at using material_block, But currently I save the material and set the parameters for example if I need to change the texture I parameterize the texture in the material graph and just call set SomeMat.SomeParamName = SomeAsset

This does make your materials more complicated then they need to be of course, But seems to at least be consistent.

There are a few bugs I noticed, Not just with material_block but with material assets as well for example: Calling Print(“Some Text”) anytime from anywhere in any class before changing a parameterized material parameter with set causes roll back and you can see it in the log. I didnt notice this pre-37.00 so if you get roll back that could potentially be why.

Edit: Also I found that drawing a material block directly in a canvas slot or in a parent container with no other children elements causes the block to turn white randomly, Even with the work around above. There are a few spots where I actually just use a hidden element in a stack_box with the material_block and it behaves.

Interesting. I could use the material parameter approach, but I’m not sure it’s good for my case. I already use it to change the background color. But as for the arrow (see the image I uploaded), that’s supposed to be a flipbook showcasing the ability, and adding many into one material is not good, considering also that when using a numeric switch (so not the static one) everything will render even if hidden, so I would have many materials all rendered for every card. As for right now this happens during the session and not in a private code, so hopefully public version is fine. So I might just leave everything like this, as I basically finished the UI anyways now.

But I’ll keep in mind what you said about SetImage, as the same white block appears for images, which are loaded from the modular ability system, using set image :confused:

@Vath

It slipped my mind but i also noticed an issue with the epic hud controller too which i have yet to report. This could be connected.

When you have the hud controller to not show things or even turn off the hud in a session it doesnt always respect the settings. Also i had this white image thing on another map and i did report via this forum. I don’t think it happens on a published version as i published my map regardless and i never seen the white box in the published version.

The status of FORT-951136 changed to ‘Needs Triage’. We’ve confirmed the issue and it’s waiting to be assigned to someone to fix it.