How can I Set Billboard Elements[0].BaseSizeX/Y values using Blueprints?

I can’t figure out how to set a Billboards Element[0] (MaterialSpriteElement)[0].BaseSizeX and Y values using the blueprint editor. I’ve got as far as this to get the element at the first index but am unable to find how to set the BaseSizeX/Y parameters…

You need to make it back to MaterialSpriteElement struct and set those variables during making and put it back to array. Every struct have Make and Break node. In 4.2 non-C+±made structs will be officially introduced to Blueprint, maybe my then Epic will find nicer way to edit structs.

Does this mean the structure will have to be completely rebuild or destroyed/recreated every time I want to change the BaseSizeX/Y values? I will be doing this in game often. Also, can you show me an example of this. I’m not sure what nodes I need in order to get that working. I’m assuming I would have to use a SetElement and then set all values from the broken out GetElement with the new BaseSizeX/Y values.

Thanks,
-jv

Your problem inspired me to this feature request:

I dont know but currently it’s only way you can edit struct. You could make a funtion that will make things look nicer, or even better do static funtion in C++ which edits that struct.

I still can’t figure out all of the proper nodes for the blueprint in order to do this. Can you please send me an example. I’m just trying to expose a parameter I created called (Size) that will change Element[0].BaseSizeX/Y to that parameter on a MaterialBillboard.

Thank you so much!
-jv

Oh and here is an update as far as what I thought would work, however I don’t see any size change happening. I do see a size change happening if I manually change it in the designer though so I know the properties are correct.

try like this

If this won’t work it means you probably will need to wait for 4.2 or do struc edit in C++

So I guess you can’t really change these parameters on the fly. The whole idea is to expose as variables the ability to resize the billboard for animation purposes. What is interesting is that I’m able to expose a parameter that sets the BaseSizeX/Y properties and when I hit BUILD it will show the correct adjusted size in the editor. As soon as I play, however it will be set back to the defaults. It is like the properties are being set under the hood but the rendering engine doesn’t understand that it changed to update the vertices or whatnot…

So, has anyone else figured out how to use Billboards that can be adjusted at runtime through blueprints??

So I guess you can’t really change these parameters on the fly. The whole idea is to expose as variables the ability to resize the billboard for animation purposes. What is interesting is that I’m able to expose a parameter that sets the BaseSizeX/Y properties and when I hit BUILD it will show the correct adjusted size in the editor. As soon as I play, however it will be set back to the defaults. It is like the properties are being set under the hood but the rendering engine doesn’t understand that it changed to update the vertices or whatnot…

So, has anyone else figured out how to use Billboards that can be adjusted at runtime through blueprints??

So I finally jiggled the handle to make the engine know that something has changed. I mentioned that my blueprint was in fact updating the correct element with the correct base size X/Y values but it just wasn’t reflected in the rendering. I decided to try a hack by toggling the overall Visibility on the object to false and then true again and it WORKED!!!..

Here is my blueprint now. I wish it would work without this hack though =(

Maybe in 4.2 they will add better set node for structs :slight_smile:

The scale of the Base Size X and Base Size Y is from the billboard center.

Can I request an option to align pivot to right or to left, or top or bottom, for using Size value to create progress bars in blueprints?

Or is there already a way to do so?

I’m looking at that at the minute, The current fix I have is to update the Y transform at the same time as I update the Base Y. It’s a touch messy.

Have you considered a widget for the focus item instead?

Obviously not useful if you’re wanting to give visual feedback on a few things at once.

4.6.1, but I’ve discovered that is exactly correct. Changing the Elements array doesn’t do anything unless MarkRenderStateDirty (C++) is called on the UMaterialBillboardComponent. The blueprint API for UMaterialBillboardComponent doesn’t, as-is, allow you to modify any existing elements at run-time and have the modifications take effect.

thx mate, you save my day