I want to make a tool which converts selected static meshes inside blueprint to hierarhical instanced static mesh and removes static meshes I tried every kind of blueprint utility I could find, but with no success, you have any tips / guidance how to do that? (Photo 1)
I Managed to do something similiar I have blueprint utility widget it takes selected actor and search for all static meshes and convert them to HISM, first it look for HISM which matches Static mesh compoent with Mesh and materials then add instance if cant find match it creates new HISM, problem is when I have HISM with few instances and I wan
t to add another instances it crashes here: (Photo 2)
Hey, thanks for your answer, I tried it but it broke actor, that actor has many Static meshes, hierarchical instanced static meshes, skeletal meshes etc. You know where I could find source code for that tool ?
If the BP already contains all the meshes you would need to add a HISM component, then add an instance for each static mesh component you have, and destroy them as you go.
It would make much more sense to construct the whole thing ‘procedurally’. So, rather than stacking lots of mesh components inside the blueprint, you use the construction script to add them as instances to the HISM ( it will be the only component to start with ).
This demo uses the right concept, but you would need to adjust it to your needs
Problem is that the artists made a mess inside a blueprints, we have like 100+ BP of buildings they were adding static meshes with props so its easier for them to move it around (There were a bug where you couldn’t move single instance of HISM so easily) and now we have mess in all BP ( some components are static meshes, some are HISM’s) I wanted to make a tool which could easily convert that SM to HISM’s for organizations purpose
I Managed to do blueprint utility which takes selected actor and convert all static mesh components to hisms but there are bugs with it (photo 2 at beggining of post) and it would be super handy to add menu action like in (photo 1 at beggining of post) but I guess it will be tough, its possible to make utlity blueprint which takes selected components inside blueprint ? For now I know how to loop on every component inside bp and I would love to skip some components without setting tags or other stuff so it would be easier for artists to use it
I hate to say it, but I think it might not help performance, and might even make it worse
It would be worth taking a good example BP and making an instanced version by hand.
Then try putting the BP version all over the map, vs, the HISM BP and compare performance. Because, for example, the instancing is only within the BP, not over the whole map.
Also, if you really want to take this route, it might be better to use ISM rather than HISM. HISM has several limitations, such as culling and LODding in chunks, which ISM does not. These don’t matter with things like foliage, the main use, but might give surprising results with buildings.
Later when we place a building into a world we have one manager which takes all HISM’s from building and put them all in one place so for example 10 copies of same building will be put in same HISM’s we decided for HISM’s because we need distance culling for some props
Only when we load levels we can have hitch but we have loading screen to cover it up, ISM’s have distance culling? I tought they are only culled by frustrum and occlusion, and in our game we have “bird view” is would be handy to have distance culling too for some props
To solve second problem, crashes when you are trying to add instance to HISM which already have x instances, I cache all instances in HISM then I remove HISM and add new HISM with all instances in one call