Rendering an interactive dynamic mesh in the editor

Hi,

I have a custom editor toolkit for a data asset and a custom viewport client. I am trying to create a solid mesh that is used to visualise data in the data asset. I want to be able to select and manipulate it also.

I have tried a few a couple of approaches but it either renders without hit proxies working or doesn’t render at all.

I have tried to override the draw viewport method on the viewport client, and have then used the dynamic mesh builder to build a new mesh. I then called the method to draw to the PDI (on the builder). I preceded this with a call to set the hit proxy on the PDI as I normally would but the hit proxy is never passed through when processing a click on the mesh. In this situation the mesh was rendered in the scene but no hit proxy clicks we’re processed when I clicked on it.

After this I tried a different approach by making a custom primitive scene component Which I marked as having dynamic view relevance. I overrided the call to construct dynamic meshes and did pretty much the same as above, but instead passed the collector in to the mesh builder instead. I then spawned an actor with this component into the preview world. The callbacks were happening on the scene proxy to make the dynamic meshes, but unfortunately nothing showed up.

In both situations I used the default widget material that ships with the engine. Is there something in particular I should do to make this work or is there a different approach I should take?

Thanks,

James

I discovered the fact that render proxies need to create their own hit proxies and return them via a base method that I overrode. Then I could use the hit proxy id when building the mesh a d this seemed to work.

After that things weren’t drawing and this was because of some view flags being incorrect in the custom editor and view relevancy also having some incorrect flags.

Took some time but now it’s working and I now know a little more about how to work in this system. Thanks!

Apologies for the delay, I’m glad you were able to work out a solution. Thank you for sharing your findings!

I’ll close this case, but please feel free to respond with any questions or follow-ups.

Regards