Jump to content
Attention! On March 5 (Thursday) from 6:00 to 8:00 UTC, the forum will be unavailable due to scheduled maintenance.

Clutters and Skinned meshes, crash impending


photo

Recommended Posts

Posted

Hello everyone,

Today is application crash time !

In our application, we provide the ability to the user to create clutters with the node references of their choosing, including skinned meshes. We allow the user to remove nodes from the clutter through the UI, by using clutter removeReference and clearReferences (but it's called in the UI callback itself...).

While this works, we've realized that if we remove a node reference including skinned meshes, it crashes our application. However if we don't see the skinned mesh (due to visibility distance for example), it doesn't crash, and works as expected. We couldn't reproduce this behavior in Unigine editor.

I suspect it is due to some unsafe threading case, where skinned mesh animation is still working on the node instances from the clutter. Have you seen this problem behavior ?
Should we call clutter operations on a specific thread ?

Thanks in advance !

Posted

Hi Kevin,

We don't do any specific magic in the Editor either. Just simply calling deleteLater() on required objects.

There is an article that helps understand basics of how to work with engine smart pointers: https://developer.unigine.com/en/docs/2.19.1/code/fundamentals/smartpointers

If you are working with WorldClutter it's required to call clearReferences() / removeReference() only from the main thread.

In order to provide any specific advices we would need to check a minimal repro with your delete logic, maybe the root cause hidden somewhere else :)

Thank you!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

I did try to reproduce with a minimal world (by modifying the object cluster to clutter sample world) and calling removeReference() for an ObjectMeshSkinned in the button callback.
I did not seem to be able to get it to crash from this minimal world, so it is still quite possibly some interaction with the rest of our code that I don't have in the minimal world.

There are notes in the documentation on deleteForce() needing to be in the main thresh, maybe we can add similar to removeReference() documentation. 

I am a bit confused, do you mean the editor calls deleteLater() on something when you click the Remove Button for a node WorldClutter rather than using removeReference()?
If so it seems interesting the editor would use deleteLater() which can be called on a separate thread but the API removeReference() must be on the main thread.

Posted

Hi Chris,

Just to clarify, deleteLater() is being called in Editor for the regular nodes (not inside clutters). To remove specific node from the clutter we still call removeReference() from the main thread.

Quote

There are notes in the documentation on deleteForce() needing to be in the main thresh, maybe we can add similar to removeReference() documentation. 

Yeah, will be added soon!

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

×
×
  • Create New...