I am currently trying to change the material of a blueprint at run time (on a key press for the time being). I have the framework setup and it loads up a blueprint I created and sets an instance of that blueprint in the scene. The blueprint itself holds a staticmesh (shape_sphere) which also has a material attached to it.
static ConstructorHelpers::FObjectFinder<UBlueprint> BallBlueprintAsset(TEXT("Blueprint'/Game/Blueprints/Ball.Ball'"));
if (BallBlueprintAsset.Object != NULL)
{
BallBlueprint = (UClass*)BallBlueprintAsset.Object->GeneratedClass;
}
Now I need something along the lines of BallBlueprint->GetStaticMesh() or BallBlueprintAsset->GetStaticMesh().
I believe I need to access the staticmesh of this blueprint somehow, so that I am then able to change the material of the mesh to something else in C++ code. Is this the right way to be going about this and does anybody have any other methods/pointers?