Adding a new structure

Hi.

I’m trying to add a new structure (USD Collection), that should be almost similar to regular Blender’s Collection. Now Blender builds without errors and I can see that my structure is successfully registered and added to struct Main. But if I run Blender, ED_undo_stack_get() function returns NULL and Blender crashes. I’m stuck with this.

Can anyone give me some advice on how to fix it?

Adding a new datablock type requires changes in dozens of places, it’s difficult to guess which place was missed without a patch.

Though as mentioned in ⚓ T100569 USD Layers referencing, MaterialX, and USD Hydra rendering Addon for Blender, a new datablock may not be the design we agree on. So implementing this new datablock or having other developers review it may not be a good use of time.