x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Hierarchical instanced static mesh component crashing when compiling blueprint

The editor crashes trying to access an out of bounds array index from the hierarchical instanced static mesh component.

Steps to reproduce:

  1. Create a c++ class inheriting from the actor class

  2. Add a UPROPERTY(EditAnywhere, BlueprintReadWrite) UHierarchicalInstancedStaticMeshComponent* InstancedStaticMesh

  3. Add a UPROPERTY(EditAnywhere, BlueprintReadWrite) float InstanceCount

  4. Use CreateDefaultSubobject to create the hierarchical instanced static mesh component

  5. Add the function OnConstruction(const FTransform& Transform)

  6. In the OnConstruction function, call InstancedStaticMesh->ClearInstances(), and then add a for loop from 0 to InstanceCount calling InstancedStaticMesh->AddInstance(FTransform()) every loop (maybe add a translation so instances won't overlap).

  7. Create a blueprint inheriting from the c++ class

  8. Assign a mesh and material in the details panel for the hierarchical instanced static mesh component

  9. Change InstanceCount to 1

  10. Save and compile the blueprint, it should work the first time

  11. Change the InstanceCount to 2. The blueprint viewport should update showing a second instance added

  12. Save, then try to recompile the blueprint and it should crash

  13. If you relaunch the editor, you'll notice the blueprint now has InstanceCount at 2 (because it was saved before the crash), and there are 2 instances

  14. Change InstanceCount to 3, 4, 5, 6, notice every time the blueprint viewport updates accordingly

  15. Try to compile and it'll crash again

This doesn't happen with normal instanced static meshes. Nor does it happen when adding instances in the blueprint Construction Script node. I don't think it happened in 4.12 either, just 4.13.

Another bug that's probably related to this issue:

  1. Create a c++ class with a UInstancedStaticMeshComponent

  2. Create a blueprint inheriting from this class

  3. Change the UInstancedStaticMeshComponent to UHierarchicalInstancedStaticMeshComponent

  4. Try to compile with a hot reload in the editor and it should crash

  5. Build the solution in visual studio

  6. The editor will fail to launch as long as the blueprint in step 2 exists

The only way to get the editor to launch again is to change it back to UInstancedStaticMeshComponent and rebuild. You can only change a UinstancedStaticMeshComponent in a c++ class to a UHierarchcialStaticMeshComponent if there is no blueprint that currently inherits from that class.

Product Version: UE 4.13
Tags:
more ▼

asked Oct 13 '16 at 10:43 PM in Bug Reports

avatar image

vle07
100 11 12 19

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey vle07,

Thanks for the detailed report. I was able to reproduce the issue and have entered a issue report for it. You can follow it here:

https://issues.unrealengine.com/issue/UE-37316

more ▼

answered Oct 14 '16 at 01:23 PM

avatar image

ImVawx ♦♦ STAFF
6.8k 114 17 127

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question