iTwin / imodel-transformer

API for exporting an iModel's parts and also importing them into another iModel
MIT License
3 stars 2 forks source link

Materials lost when transforming a SnapshotDb #22

Open MichaelBelousov opened 1 year ago

MichaelBelousov commented 1 year ago

Copied from https://github.com/iTwin/itwinjs-core/issues/5307, original issue posted by @fatalstar

Describe the bug I try to transform a SnapshotDb to another, but materials lost. And then, I try to transform it to an empty SnapshotDb,materials get lost and error.

To Reproduce Steps to reproduce the behavior:

  1. Convert House_Model.dgn to a local house.bim file. And do same thing with testY1.dgn.
  2. Build an iModelTransformer with core-transformer@3.4.4
  3. Excute iModelTransformer.processAll( house.bim, testY1.bim, no options),
  4. When transform done, excute targetDb.saveChanges( )
  5. Open the targetDb in view, and could see the materials lost.

Expected behavior Materials exist and be correct.

Screenshots The house.bim view : image

The result.bim view: (materials get lost) image

If transform to an empty db, and view: (roof material lost, wall and steps meterial error) image

Desktop (please complete the applicable information):

MichaelBelousov commented 1 year ago

I have confirmed that this is because several json properties are not tracked by the transformer. I have added a tool to the test-app to detect them, ran it on the house_model, and am now able to find several. Can use it as a starting point to add better support for tracking known json properties in the transformer.

MichaelBelousov commented 1 year ago

@fatalstar I wanna apologize for how long this is taking. I had to shift focus to general transformation performance issues. I did work on this, but am yet to complete it. If you want me to give you a special monkey patch for iTwin.js to fix this, let me know. I will get back to this, I am just considering the other work higher priority.