Hi - I’m complete newbie in UE4, so maybe my question is trivial. Suppose we create simple Actor class and we give it some primitive shape - sphere, for example. I would like now to access the mesh data from the level of C++ class - all vertices, triangles etc - and modify it for my application. So far, after few hours of searching and trying, I have found experimental plugin Procedural Mesh Component, which gives me - in very robust way - this option. I wonder, if there is a method to access same thing in vanilla UE4. We have UMeshComponent class, which should have some way to do it. This discussion on board had some trick to access it, but sadly, it doesn’t work where I try to implement it. Maybe I do something wrong.
What I ask is some example of complete new class creating it’s own mesh from scratch and reading it afterwards. Maybe it’s impossible without plugins.
Do you have any info for doing this in a packaged game? I was able to use the ENQUEUE_UNIQUE_RENDER_COMMAND_… to retrieve the indexbuffer but haven’t been able to get the positionvertexbuffer.
If you only want to read the geometry data in you packaged build, then cache it when building your custom mesh (we are doing this to dynamically paint explosion damages into a vertex color channel and we need the distance between vertices and explosion’s center).
If you want your geometry to be fully dynamic @ runtime, UStaticMesh is not a good option. I guess it is possible to go fully dynamic by packing you positions into OverrideVertexColors, then use this into your vertex shader with some crazy material hacks. Do you need more info on this?
Hello, I’m trying to access the bulkData, but for some reason I don’t have access to any of the functions (I already included “RawMesh.h”, even though I had to include it as “Developer/RawMesh/Public/RawMesh.h” otherwise I get an error)
Also when I go in to RawMesh.h I get those errors on each of them
Thanks a lot! This is helpful for me. But What if I want to create a UStaticMesh used vertices and indices data in a standalone build,what should I do?
Best Wish!