AddActor in the editor via C++ module
Hi I'm trying to place some actor in the map via C++. The code runs in a secondary module associated with a menu item in the editor.
The actor is is visible in the scene outliner but the mesh is doesn't appear in the viewport. But when I change any property of the actor from the editor it magically start drawing. How can I notify the editor to start drawing my cube?
asked Jun 23 '15 at 10:32 AM in C++ Programming
I've run into the same issue and figured it out.
You need to call "MarkComponentsRenderStateDirty();" on StaticMeshActor.
Also, you don't need to call EditorUpdateComponents and the rest of the functions.
You only need:
"CubeActor->GetStaticMeshComponent()->StaticMesh = LoadObject" Followed by call to "MarkComponentsRenderStateDirty()" and that's it.
answered Oct 19 '15 at 02:33 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here