So I unfortunately just noticed that any subclassing of this resorts in the instances within an actor to be unselectable in the viewport of an actor. I’m using 5.5.4
The mouse will show the icon but they are completely unclickable.
Using a regular ISM does not show this behavior. It is easily reproduced. Create a BP of a ISM, drag it into an actor viewport, set a mesh and create any number of instances.
The handling of mouse clicks in the viewport for InstancedStaticMeshComponents is handled by FInstancedStaticMeshSCSEditorCustomization, but this handler is registered explicitly for that component class. This happens in FBlueprintEditorModule::StartupModule() with a private class, so you’re out of luck:
I’ve logged this as a UE bug: UE-348569. Keep an eye on that for fixes.
If you’re C++ savvy, you can consider duplicating FInstancedStaticMeshSCSEditorCustomization code to your game project and registering that as an SCS Editor customization. Otherwise, you’ll need to work around the limitation.
Awesome thanks. My project is c++ maybe I’ll take a stab at that. I imagine we could re-direct selection and/or manipulate the selection to specific instance indexes ?
I’m using a helper struct to build walls and keeping track of sections based on index, ISMs seemed logical just mesh per material.
No problem, happy to log that bug for you since it’s a confusing one to run into.
You can have a look at having that actor class implement ISMInstanceManager:
* An interface for actors that manage static mesh instances.
* This exists so that actors that directly manage instances can inject custom logic around the manipulation of the underlying ISM component.
There are some examples of that in engine code. I don’t have hands-on experiencne with that myself so I’m not sure how user friendly that is, but it sounds like it’s the intended approach for game code to manage instances in special ways.